개정판 78cffba9
Insert Dialog Final & Convert Validation 완료
Change-Id: I1132b9a0c0e9e3aab0bf5e79770529f81bec4a81
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/ConvertAddDialogViewModel.cs | ||
---|---|---|
13 | 13 |
|
14 | 14 |
namespace Markus.Service.StationController.ViewModel |
15 | 15 |
{ |
16 |
class ConvertAddDialogViewModel : Mvvm.ToolKit.ViewModelBase, IDataErrorInfo
|
|
16 |
class ConvertAddDialogViewModel : Mvvm.ToolKit.ViewModelBase |
|
17 | 17 |
{ |
18 | 18 |
#region Construrtor |
19 | 19 |
|
... | ... | |
24 | 24 |
|
25 | 25 |
#endregion |
26 | 26 |
|
27 |
#region IDataErrorInfo Members |
|
28 |
|
|
29 |
public string Error |
|
30 |
{ |
|
31 |
get { throw new NotImplementedException(); } |
|
32 |
} |
|
33 |
|
|
34 |
public string this[string columnName] |
|
35 |
{ |
|
36 |
get |
|
37 |
{ |
|
38 |
string result = null; |
|
39 |
if (string.IsNullOrEmpty(ConverAdd_Project_NO)) |
|
40 |
{ |
|
41 |
if (string.IsNullOrEmpty(ConverAdd_Project_NO)) |
|
42 |
result = "Please enter a Project NO"; |
|
43 |
} |
|
44 |
if (columnName == "ConverAdd_DOCUMENT_ID") |
|
45 |
{ |
|
46 |
if (string.IsNullOrEmpty(ConverAdd_DOCUMENT_ID)) |
|
47 |
result = "Please enter a DOCUMENT ID"; |
|
48 |
} |
|
49 |
if (columnName == "ConverAdd_DOCUMENT_URL") |
|
50 |
{ |
|
51 |
if (string.IsNullOrEmpty(ConverAdd_DOCUMENT_URL)) |
|
52 |
result = "Please enter a DOCUMENT URL"; |
|
53 |
} |
|
54 |
return result; |
|
55 |
} |
|
56 |
} |
|
57 |
|
|
58 |
#endregion |
|
59 |
|
|
60 | 27 |
#region Propertise |
61 | 28 |
|
62 | 29 |
DataService.DataServiceClient WcfClient = new DataService.DataServiceClient(); |
... | ... | |
241 | 208 |
Project_NO_Color = ""; |
242 | 209 |
DOCUMENT_ID_Color = ""; |
243 | 210 |
DOCUMENT_URL_Color = ""; |
244 |
//if (String.IsNullOrEmpty(ConverAdd_Project_NO)) |
|
245 |
//{ |
|
246 |
// //ConverAdd_Project_NO = "Project_NOisEmpty"; |
|
247 |
// Project_NO_Border = "#FFFF0000"; |
|
248 |
//} |
|
249 |
//if (String.IsNullOrEmpty(ConverAdd_DOCUMENT_URL)) |
|
250 |
//{ |
|
251 |
// //ConverAdd_DOCUMENT_URL = "DOCUMENT_URLisEmpty"; |
|
252 |
// DOCUMENT_URL_Border = "#FFFF0000"; |
|
253 |
//} |
|
254 |
//if (String.IsNullOrEmpty(ConverAdd_DOCUMENT_ID)) |
|
255 |
//{ |
|
256 |
// //ConverAdd_DOCUMENT_ID = "DOCUMENT_IDisEmpty"; |
|
257 |
// DOCUMENT_ID_Border = "#FFFF0000"; |
|
258 |
//} |
|
259 | 211 |
} |
260 | 212 |
else |
261 | 213 |
{ |
... | ... | |
282 | 234 |
|
283 | 235 |
#endregion |
284 | 236 |
} |
285 |
public class NameValidator : ValidationRule |
|
286 |
{ |
|
287 |
public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo) |
|
288 |
{ |
|
289 |
if (value == null) |
|
290 |
return new ValidationResult(false, "value cannot be empty."); |
|
291 |
|
|
292 |
return ValidationResult.ValidResult; |
|
293 |
} |
|
294 |
} |
|
295 | 237 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/FinalPDFAddDialogViewModel.cs | ||
---|---|---|
56 | 56 |
OnPropertyChanged(() => FinalPDFAdd_DocInfo_ID); |
57 | 57 |
} |
58 | 58 |
} |
59 |
|
|
60 |
private string _Project_NO_Border = "#FF000000"; |
|
61 |
public string Project_NO_Border |
|
62 |
{ |
|
63 |
get { return _Project_NO_Border; } |
|
64 |
set |
|
65 |
{ |
|
66 |
if (FinalPDFAdd_Project_NO != null) |
|
67 |
{ |
|
68 |
_Project_NO_Border = "#FF000000"; |
|
69 |
OnPropertyChanged(() => Project_NO_Border); |
|
70 |
} |
|
71 |
else |
|
72 |
{ |
|
73 |
_Project_NO_Border = "#FFFF0000"; |
|
74 |
OnPropertyChanged(() => Project_NO_Border); |
|
75 |
} |
|
76 |
} |
|
77 |
} |
|
78 |
|
|
79 |
private string _DOCUMENT_ID_Border = "#FF000000"; |
|
80 |
public string DOCUMENT_ID_Border |
|
81 |
{ |
|
82 |
get { return _DOCUMENT_ID_Border; } |
|
83 |
set |
|
84 |
{ |
|
85 |
if (FinalPDFAdd_Document_ID != null) |
|
86 |
{ |
|
87 |
_DOCUMENT_ID_Border = "#FF000000"; |
|
88 |
OnPropertyChanged(() => DOCUMENT_ID_Border); |
|
89 |
} |
|
90 |
else |
|
91 |
{ |
|
92 |
_DOCUMENT_ID_Border = "#FFFF0000"; |
|
93 |
OnPropertyChanged(() => DOCUMENT_ID_Border); |
|
94 |
} |
|
95 |
} |
|
96 |
} |
|
97 |
|
|
98 |
private string _DocInfo_ID_Border = "#FF000000"; |
|
99 |
public string DocInfo_ID_Border |
|
100 |
{ |
|
101 |
get { return _DocInfo_ID_Border; } |
|
102 |
set |
|
103 |
{ |
|
104 |
if (FinalPDFAdd_DocInfo_ID != null) |
|
105 |
{ |
|
106 |
_DocInfo_ID_Border = "#FF000000"; |
|
107 |
OnPropertyChanged(() => DocInfo_ID_Border); |
|
108 |
} |
|
109 |
else |
|
110 |
{ |
|
111 |
_DocInfo_ID_Border = "#FFFF0000"; |
|
112 |
OnPropertyChanged(() => DocInfo_ID_Border); |
|
113 |
} |
|
114 |
} |
|
115 |
} |
|
116 |
|
|
117 |
private string _Project_NO_Color = "#FFFFFFFF"; |
|
118 |
public string Project_NO_Color |
|
119 |
{ |
|
120 |
get { return _Project_NO_Color; } |
|
121 |
set |
|
122 |
{ |
|
123 |
if (FinalPDFAdd_Project_NO != null) |
|
124 |
{ |
|
125 |
_Project_NO_Color = "#FFFFFFFF"; |
|
126 |
OnPropertyChanged(() => Project_NO_Color); |
|
127 |
} |
|
128 |
else |
|
129 |
{ |
|
130 |
_Project_NO_Color = "#FFFF0000"; |
|
131 |
OnPropertyChanged(() => Project_NO_Color); |
|
132 |
} |
|
133 |
} |
|
134 |
} |
|
135 |
|
|
136 |
private string _DOCUMENT_ID_Color = "#FFFFFFFF"; |
|
137 |
public string DOCUMENT_ID_Color |
|
138 |
{ |
|
139 |
get { return _DOCUMENT_ID_Color; } |
|
140 |
set |
|
141 |
{ |
|
142 |
if (FinalPDFAdd_Document_ID != null) |
|
143 |
{ |
|
144 |
_DOCUMENT_ID_Color = "#FFFFFFFF"; |
|
145 |
OnPropertyChanged(() => DOCUMENT_ID_Color); |
|
146 |
} |
|
147 |
else |
|
148 |
{ |
|
149 |
_DOCUMENT_ID_Color = "#FFFF0000"; |
|
150 |
OnPropertyChanged(() => DOCUMENT_ID_Color); |
|
151 |
} |
|
152 |
} |
|
153 |
} |
|
59 | 154 |
|
155 |
private string _DocInfo_ID_Color = "#FFFFFFFF"; |
|
156 |
public string DocInfo_ID_Color |
|
157 |
{ |
|
158 |
get { return _DocInfo_ID_Color; } |
|
159 |
set |
|
160 |
{ |
|
161 |
if (FinalPDFAdd_DocInfo_ID != null) |
|
162 |
{ |
|
163 |
_DocInfo_ID_Color = "#FFFFFFFF"; |
|
164 |
OnPropertyChanged(() => DocInfo_ID_Color); |
|
165 |
} |
|
166 |
else |
|
167 |
{ |
|
168 |
_DocInfo_ID_Color = "#FFFF0000"; |
|
169 |
OnPropertyChanged(() => DocInfo_ID_Color); |
|
170 |
} |
|
171 |
} |
|
172 |
} |
|
60 | 173 |
#endregion |
61 | 174 |
|
62 | 175 |
#region Command |
... | ... | |
74 | 187 |
/// </summary> |
75 | 188 |
public async void FinalPDFAdd_OK(object obj) |
76 | 189 |
{ |
77 |
try
|
|
190 |
if (String.IsNullOrEmpty(FinalPDFAdd_Project_NO) || String.IsNullOrEmpty(FinalPDFAdd_DocInfo_ID) || String.IsNullOrEmpty(FinalPDFAdd_Document_ID))
|
|
78 | 191 |
{ |
79 |
string ConverAdd_ID = GuidExtension.shortGuid(); |
|
80 |
var items = await WcfClient.GET_SELECT_CONVERT_INSERTAsync(ConverAdd_ID, FinalPDFAdd_Project_NO, FinalPDFAdd_DocInfo_ID, FinalPDFAdd_Document_ID); |
|
81 |
System.Diagnostics.Debug.WriteLine(items); |
|
82 |
|
|
83 |
MessageBox.Show("데이터베이스에 추가 완료! "); |
|
192 |
Project_NO_Border = ""; |
|
193 |
DOCUMENT_ID_Border = ""; |
|
194 |
DocInfo_ID_Border = ""; |
|
195 |
Project_NO_Color = ""; |
|
196 |
DOCUMENT_ID_Color = ""; |
|
197 |
DocInfo_ID_Color = ""; |
|
84 | 198 |
} |
85 |
catch (Exception ex)
|
|
199 |
else
|
|
86 | 200 |
{ |
87 |
MessageBox.Show(ex.ToString()); |
|
201 |
try |
|
202 |
{ |
|
203 |
string ConverAdd_ID = GuidExtension.shortGuid(); |
|
204 |
var items = await WcfClient.GET_SELECT_CONVERT_INSERTAsync(ConverAdd_ID, FinalPDFAdd_Project_NO, FinalPDFAdd_DocInfo_ID, FinalPDFAdd_Document_ID); |
|
205 |
System.Diagnostics.Debug.WriteLine(items); |
|
206 |
|
|
207 |
MessageBox.Show("데이터베이스에 추가 완료! "); |
|
208 |
} |
|
209 |
catch (Exception ex) |
|
210 |
{ |
|
211 |
MessageBox.Show(ex.ToString()); |
|
212 |
} |
|
213 |
|
|
214 |
FinalPDFAdd_Project_NO = null; |
|
215 |
FinalPDFAdd_DocInfo_ID = null; |
|
216 |
FinalPDFAdd_Document_ID = null; |
|
88 | 217 |
} |
89 |
|
|
90 |
FinalPDFAdd_Project_NO = null; |
|
91 |
FinalPDFAdd_DocInfo_ID = null; |
|
92 |
FinalPDFAdd_Document_ID = null; |
|
93 | 218 |
} |
94 | 219 |
|
95 | 220 |
#endregion |
ConvertService/ServiceBase/Markus.Service.StationController/Views/FinalPDFAddDialog.xaml | ||
---|---|---|
69 | 69 |
<ColumnDefinition Width="1.5*"/> |
70 | 70 |
</Grid.ColumnDefinitions> |
71 | 71 |
<Grid.RowDefinitions> |
72 |
<RowDefinition Height="25"/> |
|
73 |
<RowDefinition Height="25"/> |
|
72 |
<RowDefinition Height="12"/> |
|
73 |
<RowDefinition /> |
|
74 |
<RowDefinition Height="12"/> |
|
75 |
<RowDefinition /> |
|
74 | 76 |
</Grid.RowDefinitions> |
75 |
<TextBlock Grid.Row="0" Text="Project NO" />
|
|
76 |
<TextBlock Grid.Row="0" Grid.Column="4" Text="Document ID" />
|
|
77 |
<TextBlock Grid.Row="1" Grid.Column="0" Text="DocInfo_ID" />
|
|
77 |
<TextBlock Grid.Row="1" Text="Project NO" />
|
|
78 |
<TextBlock Grid.Row="1" Grid.Column="4" Text="Document ID" />
|
|
79 |
<TextBlock Grid.Row="3" Grid.Column="0" Text="DocInfo_ID" />
|
|
78 | 80 |
|
79 |
<TextBox Text="{Binding FinalPDFAdd_Project_NO, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.Column="2" /> |
|
80 |
<TextBox Text="{Binding FinalPDFAdd_Document_ID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.Column="6" /> |
|
81 |
<TextBox Text="{Binding FinalPDFAdd_DocInfo_ID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="5"/> |
|
81 |
<TextBox Text="{Binding FinalPDFAdd_Project_NO, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="2" BorderBrush="{Binding Project_NO_Border}" /> |
|
82 |
<TextBox Text="{Binding FinalPDFAdd_Document_ID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="6" BorderBrush="{Binding DOCUMENT_ID_Border}" /> |
|
83 |
<TextBox Text="{Binding FinalPDFAdd_DocInfo_ID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="5" BorderBrush="{Binding DocInfo_ID_Border}"/> |
|
84 |
|
|
85 |
<DockPanel Grid.Column="2" Grid.Row="0"> |
|
86 |
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> |
|
87 |
<Grid Width="12" Height="12"> |
|
88 |
<Ellipse Width="12" Height="12" Fill="{Binding Project_NO_Color}" HorizontalAlignment="Center" VerticalAlignment="Center" ></Ellipse> |
|
89 |
<TextBlock Foreground="White" FontWeight="Heavy" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" |
|
90 |
ToolTip="{Binding ElementName=ErrorAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" >!</TextBlock> |
|
91 |
</Grid> |
|
92 |
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="ProjectNO empty" FontSize="9" Foreground="{Binding Project_NO_Color}" /> |
|
93 |
</StackPanel> |
|
94 |
</DockPanel> |
|
95 |
<DockPanel Grid.Column="6" Grid.Row="0"> |
|
96 |
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> |
|
97 |
<Grid Width="12" Height="12"> |
|
98 |
<Ellipse Width="12" Height="12" HorizontalAlignment="Center" VerticalAlignment="Center" |
|
99 |
Fill="{Binding DOCUMENT_ID_Color}"/> |
|
100 |
<TextBlock Foreground="White" FontWeight="Heavy" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" |
|
101 |
ToolTip="{Binding ElementName=ErrorAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" >!</TextBlock> |
|
102 |
</Grid> |
|
103 |
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="DOCUMENT ID empty" FontSize="9" Foreground="{Binding DOCUMENT_ID_Color}" /> |
|
104 |
</StackPanel> |
|
105 |
</DockPanel> |
|
106 |
|
|
107 |
<DockPanel Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="5" > |
|
108 |
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> |
|
109 |
<Grid Width="12" Height="12"> |
|
110 |
<Ellipse Width="12" Height="12" Fill="{Binding DocInfo_ID_Color}" HorizontalAlignment="Center" VerticalAlignment="Center" /> |
|
111 |
<TextBlock Foreground="White" FontWeight="Heavy" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" |
|
112 |
ToolTip="{Binding ElementName=ErrorAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" >!</TextBlock> |
|
113 |
</Grid> |
|
114 |
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="Document ID empty" FontSize="9" Foreground="{Binding DocInfo_ID_Color}" /> |
|
115 |
</StackPanel> |
|
116 |
</DockPanel> |
|
82 | 117 |
</Grid> |
83 | 118 |
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" Margin="0 0 0 10"> |
84 | 119 |
<telerik:RadButton Content=" SEND" MinWidth="50" Margin="8 0" VerticalAlignment="Center" |
내보내기 Unified diff