Skip to content

Commit

Permalink
Add data copier
Browse files Browse the repository at this point in the history
  • Loading branch information
nh43de committed Mar 13, 2023
1 parent 56b30e2 commit ea584fd
Show file tree
Hide file tree
Showing 3 changed files with 423 additions and 1 deletion.
106 changes: 106 additions & 0 deletions DataToolChain.Ui/DataCopier/DataCopier.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<Window x:Class="DataToolChain.DataCopier"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DataToolChain"
mc:Ignorable="d"
Title="Data Copier" Height="528.5" Width="700"
d:DataContext="{d:DesignInstance Type=local:DataCopierViewModel, IsDesignTimeCreatable=True}"
>
<Grid Background="Beige">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
<ColumnDefinition Width="300"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="447*"/>
<RowDefinition Height="22*"/>
</Grid.RowDefinitions>

<StackPanel Grid.Row="0">


<StackPanel Background="Beige" VerticalAlignment="Stretch" >


<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Source Server:</Label>
<TextBox Width="200" Margin="5" Text="{Binding Path=SourceConfig.ServerName}"></TextBox>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Source Database:</Label>
<TextBox Width="200" Margin="5" Text="{Binding Path=SourceConfig.DbName}"></TextBox>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Source Table Name:</Label>
<TextBox Width="200" Margin="5" IsEnabled="{Binding Path=InputTableEnabled}" Text="{Binding Path=SourceConfig.DestinationTable}"></TextBox>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Username:</Label>
<TextBox Width="200" Margin="5" Text="{Binding Path=SourceConfig.Username}"></TextBox>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Password:</Label>
<PasswordBox Width="200" Margin="5" x:Name="SourcePasswordBox"></PasswordBox>
</StackPanel>
</StackPanel>

<StackPanel Background="Beige" VerticalAlignment="Stretch">
<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Destination Server:</Label>
<TextBox Width="200" Margin="5" Text="{Binding Path=DestinationConfig.ServerName}"></TextBox>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Destination Database:</Label>
<TextBox Width="200" Margin="5" Text="{Binding Path=DestinationConfig.DbName}"></TextBox>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Destination Table Name:</Label>
<TextBox Width="200" Margin="5" IsEnabled="{Binding Path=InputTableEnabled}" Text="{Binding Path=DestinationConfig.DestinationTable}"></TextBox>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Username:</Label>
<TextBox Width="200" Margin="5" Text="{Binding Path=DestinationConfig.Username}"></TextBox>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Password:</Label>
<PasswordBox Width="200" Margin="5" x:Name="DestinationPasswordBox"></PasswordBox>
</StackPanel>
</StackPanel>
</StackPanel>

<StackPanel Grid.Column="1" Grid.Row="0">
<StackPanel Orientation="Horizontal" Margin="5">
<Label Width="150" Margin="5">Bulk copy rows per batch:</Label>
<TextBox Width="50" Margin="5" Text="{Binding Path=BulkCopyRowsPerBatch}"></TextBox>
</StackPanel>
<StackPanel Margin="5" HorizontalAlignment="Left">
<CheckBox Margin="5" IsChecked="{Binding Path=CopyAllTables}" Content="Copy All Tables"/>
<CheckBox Margin="5" IsChecked="{Binding Path=DeleteDestinationData}" Content="Delete Data in Destination"/>
<CheckBox Margin="5" IsChecked="{Binding Path=UseOrdinals}" Content="Use Ordinals"/>
<CheckBox Margin="5" IsChecked="{Binding Path=KeepNulls}" Content="Keep Nulls"/>
<CheckBox Margin="5" IsChecked="{Binding Path=KeepIdentity}" Content="Keep Identity"/>
<CheckBox Margin="5" IsChecked="{Binding Path=CheckConstraints}" Content="Check Constraints"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Button Width="100" Margin="5" Click="ButtonGo_Click" Content="Go"/>
<Button Width="100" Margin="5" Click="ButtonCancel_Click" Content="Cancel"/>
</StackPanel>
</StackPanel>

<StatusBar Grid.Row="1" Grid.ColumnSpan="2">
<TextBlock Text="{Binding Path=WindowStatusDisplay}"></TextBlock>
</StatusBar>


</Grid>
</Window>
Loading

0 comments on commit ea584fd

Please sign in to comment.