-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMachineCheckForm.xaml
More file actions
184 lines (170 loc) · 8.25 KB
/
MachineCheckForm.xaml
File metadata and controls
184 lines (170 loc) · 8.25 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<Window x:Class="MachineCheck.MachineCheckForm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Przegląd maszyny"
Height="600" Width="700"
Loaded="Window_Loaded"
WindowStartupLocation="CenterOwner"
ResizeMode="NoResize"
Background="#F4F6F8"
FontFamily="Segoe UI"
FontSize="14">
<Window.Resources>
<Style x:Key="ThemedButton" TargetType="Button">
<Setter Property="Background" Value="#8E44AD" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Padding" Value="12,8" />
<Setter Property="MinHeight" Value="40" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<!-- Disabled state -->
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#333333" />
<!-- darker gray -->
<Setter Property="Foreground" Value="#BBBBBB" />
</Trigger>
<!-- Mouse over -->
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#9B59B6" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Title -->
<TextBlock Text="Formularz przeglądu maszyny"
FontSize="20"
FontWeight="Bold"
Margin="0,0,0,20"
HorizontalAlignment="Center"
Foreground="#333" />
<!-- Form Fields -->
<Grid Grid.Row="1" Margin="0,0,0,10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Machine Code -->
<TextBlock Text="Kod maszyny:" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,10" />
<TextBox x:Name="txtMachineCode" Grid.Row="0" Grid.Column="1"
Padding="6" Margin="0,0,0,10"
Background="#EEE" BorderBrush="#CCC" BorderThickness="1"
HorizontalAlignment="Stretch"
IsReadOnly="True"
Text="{Binding MachineCode}" />
<!-- Machine Name -->
<TextBlock Text="Nazwa maszyny:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,10" />
<TextBox x:Name="txtMachineName" Grid.Row="1" Grid.Column="1"
Padding="6" Margin="0,0,0,10"
Background="#EEE" BorderBrush="#CCC" BorderThickness="1"
HorizontalAlignment="Stretch"
IsReadOnly="True"
Text="{Binding MachineName}" />
<!-- Machine Name -->
<TextBlock Text="Numer seryjny:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,10" />
<TextBox x:Name="txtSerialNumber" Grid.Row="2" Grid.Column="1"
Padding="6" Margin="0,0,0,10"
Background="White" BorderBrush="#CCC" BorderThickness="1"
HorizontalAlignment="Stretch"
Text="{Binding MachineSerialNumber}" />
<!-- Interval in Months -->
<TextBlock Text="Interwał przeglądu (miesiące):" Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,10" />
<ComboBox x:Name="cmbInterval" Grid.Row="3" Grid.Column="1"
Padding="4" Margin="0,0,0,10"
Background="White" BorderBrush="#CCC" BorderThickness="1"
HorizontalAlignment="Left" Width="100"
SelectedValue="{Binding CheckInterval}" SelectedValuePath="Content">
<ComboBoxItem Content="1" />
<ComboBoxItem Content="3" />
<ComboBoxItem Content="6" />
<ComboBoxItem Content="12" />
</ComboBox>
<!-- First Check Date -->
<TextBlock x:Name="dpFirstCheckLabel" Text="Data pierwszego przeglądu:" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,10" Visibility ="Collapsed" />
<DatePicker x:Name="dpFirstCheck"
Grid.Row="4" Grid.Column="1"
Margin="0,0,0,10"
Background="White" BorderBrush="#CCC" BorderThickness="1"
HorizontalAlignment="Left" Width="160"
Visibility ="Collapsed"
SelectedDate="{Binding FirstCheckDate}">
</DatePicker>
<!-- Last Check Date -->
<TextBlock x:Name="dpLastCheckLabel" Text="Data ostatniego przeglądu:" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,10" />
<DatePicker x:Name="dpLastCheck"
Grid.Row="4" Grid.Column="1"
Margin="0,0,0,10"
Background="#EEE" BorderBrush="#CCC" BorderThickness="1"
HorizontalAlignment="Left" Width="160"
IsEnabled="False"
SelectedDate="{Binding LastCheckDate}">
</DatePicker>
<!-- Next Check Date -->
<TextBlock Text="Data następnego przeglądu:" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,10" />
<TextBox x:Name="txtNextCheck" Grid.Row="5" Grid.Column="1"
Padding="6" Margin="0,0,0,10"
Background="#EEE" BorderBrush="#CCC" BorderThickness="1"
IsReadOnly="True"
HorizontalAlignment="Left" Width="160"
Text="{Binding NextCheckDate}" />
<!-- Days Before Notification -->
<TextBlock Text="Dni przed powiadomieniem:" Grid.Row="6" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,10" />
<TextBox x:Name="txtDaysBefore" Grid.Row="6" Grid.Column="1"
Padding="6" Margin="0,0,0,10"
Background="White" BorderBrush="#CCC" BorderThickness="1"
HorizontalAlignment="Left" Width="80"
Text="{Binding DaysBeforeNotif}" />
<!-- Email -->
<TextBlock Text="Email do powiadomień:" Grid.Row="7" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,0" />
<TextBox x:Name="txtEmail" Grid.Row="7" Grid.Column="1"
Padding="6"
Background="White" BorderBrush="#CCC" BorderThickness="1"
HorizontalAlignment="Stretch"
Text="{Binding NotifEmail}" />
</Grid>
<!-- Buttons -->
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,20,0,0">
<Button x:Name="HistoryButton" Content="Historia przeglądów" Width="160" Margin="0,0,10,0"
Background="#8E44AD" Style="{StaticResource ThemedButton}"
IsEnabled="{Binding CanShowHistory}"
Click="HistoryButton_Click" />
<Button x:Name="GenerateProtocolButton" Content="Generuj protokół" Width="150" Margin="0,0,10,0"
Background="#2196F3" Style="{StaticResource ThemedButton}"
IsEnabled="{Binding IsSaved}" Click="GenerateProtocolButton_Click" />
<Button x:Name="CheckButton" Content="Wgraj protokół" Width="150" Margin="0,0,10,0"
Background="#FF9800" Style="{StaticResource ThemedButton}"
IsEnabled="{Binding IsSaved}" Click="CheckButton_Click" />
<Button x:Name="SaveButton" Content="Zapisz" Width="100"
Background="#4CAF50" Style="{StaticResource ThemedButton}"
Click="SaveButton_Click" />
</StackPanel>
</Grid>
</Window>