Repository navigation
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
158 lines (134 loc) · 9.41 KB
/
Copy pathMainWindow.xaml
File metadata and controls
158 lines (134 loc) · 9.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<Window x:Class="DateTimeTable.MainWindow"
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:DateTimeTable"
mc:Ignorable="d"
Title="Date Time Table Creator"
Height="640"
MaxHeight="800"
MaxWidth="900"
Width="800"
FontFamily="Segoe UI">
<Grid x:Name="MainGrid" Background="#F3F4F6">
<Grid.RowDefinitions>
<RowDefinition Height="72" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Header: app icon, title, language selector -->
<Border Grid.Row="0" Background="#0B5FFF" CornerRadius="0,0,8,8" Padding="12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Globe icon -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Column="0">
<TextBlock Text="🌐" FontSize="22" Margin="4" Foreground="#FFFFED2E" />
<TextBlock x:Name="HeaderTitleText" Text="DateTime Table" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" Margin="8,0,0,0" />
</StackPanel>
<!-- Spacer and subtitle -->
<StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="12,0">
<TextBlock x:Name="HeaderSubtitleText" Text="Create calendar tables quickly" Foreground="White" Opacity="0.95" />
</StackPanel>
<!-- Language selector -->
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock x:Name="LanguageLabel" Text="Language:" Foreground="White" VerticalAlignment="Center" Margin="0,0,8,0" />
<ComboBox x:Name="LanguageCombo" Width="120" SelectedIndex="0" SelectionChanged="LanguageCombo_SelectionChanged">
<ComboBoxItem Content="English" />
<ComboBoxItem Content="فارسی" />
</ComboBox>
</StackPanel>
</Grid>
</Border>
<!-- Main content -->
<Grid Grid.Row="1" Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Left panel: connection and table info -->
<Border Grid.Column="0" Background="White" CornerRadius="8" Padding="14" Margin="0,0,12,0">
<StackPanel VerticalAlignment="Top">
<TextBlock x:Name="ConnectionHeader" Text="Connection" FontSize="16" FontWeight="SemiBold" Margin="0,0,0,8" />
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,4,0,4">
<TextBlock Text="🖥️" FontSize="18" VerticalAlignment="Center" Foreground="#FF157F07" />
<TextBlock x:Name="ServerLabel" Text="Server:" FontSize="14" VerticalAlignment="Center" Width="75" FontWeight="Bold"/>
<ComboBox x:Name="ServersCombo" MinWidth="200" MaxWidth="210" Height="32" HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="12"
IsEditable="True" Margin="10,0,0,0" Text="{Binding SelectedServer, Mode=TwoWay}" SelectionChanged="ServersCombo_SelectionChanged" />
<Button x:Name="BrowseServerButton" Content="🔍" Click="BrowseServers_Click"
BorderThickness="0" Foreground="#FF0BADAA" Background="Transparent" />
</StackPanel>
<Button x:Name="Testbtn" Content="Load Databases" Height="32" Margin="0,8,0,8" Click="Fill_databases"
HorizontalAlignment="Center" BorderThickness="0,2,0,2" BorderBrush="BlueViolet" />
<StackPanel Orientation="Horizontal" Margin="0,4,0,4">
<TextBlock Text="🗄️" FontSize="18" VerticalAlignment="Center" />
<TextBlock x:Name="DatabaseLabel" Text="Database:" FontSize="14" VerticalAlignment="Center" Width="85" FontWeight="Bold" />
<ComboBox x:Name="Databases" Height="30" SelectedValue="{Binding SelectedDatebase}" Background="AliceBlue" Margin="10,0,0,0"
MaxHeight="255" MinWidth="200" HorizontalAlignment="Center" VerticalAlignment="Center" IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,4,0,4">
<TextBlock Text="🔒" FontSize="18" VerticalAlignment="Center" />
<TextBlock x:Name="SecurityLabel" Text="Security:" FontSize="14" VerticalAlignment="Center"
Width="85" FontWeight="Bold"/>
<CheckBox x:Name="Integrated" IsEnabled="{Binding IntegratedEnable}" IsChecked="{Binding IntegratedChecked}" Margin="10,0,0,0"
Content="Integrated Security" Unchecked="GetCredentialEvent" HorizontalAlignment="Center" VerticalAlignment="Center" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
<TextBlock Text="📋" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock x:Name="TableNameLabel" Text="Table Name:" Width="85" FontSize="14" VerticalAlignment="Center" FontWeight="Bold" />
<TextBox x:Name="TableNameTextBox" Text="{Binding TableName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Width="200" MaxWidth="250" Height="32" Margin="10,0,0,0" />
</StackPanel>
<Separator Margin="0,12" />
<TextBlock x:Name="ActionsTextBlock" Text="Actions" FontSize="14" FontWeight="SemiBold" Margin="0,6,0,6" />
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<Button x:Name="CreateTableButton" Content="Create Table" Width="140" Height="36" Click="StartToCreate" VerticalAlignment="Center" IsEnabled="False" />
</StackPanel>
</StackPanel>
</Border>
<!-- Right panel: date range and description -->
<Border Grid.Column="1" Background="White" CornerRadius="8" Padding="14">
<StackPanel>
<Border BorderBrush="DarkGreen" BorderThickness="0,0,0,1" Margin="0,5,0,20">
<TextBlock x:Name="CalendarRangeTextBlock" Text="Calendar Range" FontSize="16" FontWeight="SemiBold" />
</Border>
<StackPanel Orientation="Horizontal" Margin="0,4,0,4" HorizontalAlignment="Left">
<StackPanel>
<TextBlock x:Name="StartLabel" Text="Start" FontWeight="Medium" />
<DatePicker x:Name="StartDatePicker" Width="160" Height="30" SelectedDateFormat="Long" />
</StackPanel>
<StackPanel Margin="12,0,0,0">
<TextBlock x:Name="EndLabel" Text="End" FontWeight="Medium" />
<DatePicker x:Name="EndDatePicker" Width="160" Height="30" SelectedDateFormat="Long" />
</StackPanel>
</StackPanel>
<Border BorderBrush="DarkGreen" BorderThickness="0,0,0,1" Margin="0,25,0,20">
<TextBlock x:Name="DescriptionTextBlock" Text="Description" FontSize="14" FontWeight="SemiBold"/>
</Border>
<TextBlock TextWrapping="Wrap" Opacity="0.85" FontSize="13" x:Name="DescriptionBody">
This application creates a calendar table in the selected database. Choose the server and database, set your date range, and press Create Table. Existing table names will be checked to avoid duplicates.
</TextBlock>
<TextBlock x:Name="TipIcon" Text="📌" FontSize="14" VerticalAlignment="Top" FontWeight="SemiBold" Margin="0,10,0,6" Foreground="Red" />
<TextBlock x:Name="FlowTipText" Text="Please load databases first." TextWrapping="Wrap"
Foreground="Red" FontWeight="SemiBold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</StackPanel>
</Border>
</Grid>
<!-- Footer: progress and status -->
<Border Grid.Row="2" Background="Transparent" Padding="10">
<StackPanel>
<StatusBar>
<StatusBarItem>
<TextBlock x:Name="StatusText" Text="Ready" />
</StatusBarItem>
</StatusBar>
<ProgressBar x:Name="Progressbar" Minimum="0" Height="6" VerticalAlignment="Center" HorizontalAlignment="Left" />
</StackPanel>
</Border>
</Grid>
</Window>