markus / ConvertService / ServiceBase / Markus.Service.StationController / ViewModel / FinalPDFAddDialogViewModel.cs @ 78cffba9
이력 | 보기 | 이력해설 | 다운로드 (6.68 KB)
1 | 3bde451b | semi | using Markus.Service.Extensions; |
---|---|---|---|
2 | using System; |
||
3 | using System.Collections.Generic; |
||
4 | using System.Linq; |
||
5 | using System.Text; |
||
6 | using System.Threading.Tasks; |
||
7 | using System.Windows; |
||
8 | using Telerik.Windows.Controls; |
||
9 | |||
10 | namespace Markus.Service.StationController.ViewModel |
||
11 | { |
||
12 | class FinalPDFAddDialogViewModel : Mvvm.ToolKit.ViewModelBase |
||
13 | { |
||
14 | #region Construrtor |
||
15 | |||
16 | public FinalPDFAddDialogViewModel() |
||
17 | { |
||
18 | FinalPDFAdd_OKCommand = new DelegateCommand(FinalPDFAdd_OK); |
||
19 | } |
||
20 | |||
21 | #endregion |
||
22 | |||
23 | #region Propertise |
||
24 | |||
25 | 037ab674 | semi | DataService.DataServiceClient WcfClient = new DataService.DataServiceClient(); |
26 | |||
27 | 3bde451b | semi | private string _FinalPDFAdd_Project_NO; |
28 | public string FinalPDFAdd_Project_NO |
||
29 | { |
||
30 | get { return _FinalPDFAdd_Project_NO; } |
||
31 | set |
||
32 | { |
||
33 | _FinalPDFAdd_Project_NO = value; |
||
34 | OnPropertyChanged(() => FinalPDFAdd_Project_NO); |
||
35 | } |
||
36 | } |
||
37 | |||
38 | private string _FinalPDFAdd_Document_ID; |
||
39 | public string FinalPDFAdd_Document_ID |
||
40 | { |
||
41 | get { return _FinalPDFAdd_Document_ID; } |
||
42 | set |
||
43 | { |
||
44 | _FinalPDFAdd_Document_ID = value; |
||
45 | OnPropertyChanged(() => FinalPDFAdd_Document_ID); |
||
46 | } |
||
47 | } |
||
48 | |||
49 | private string _FinalPDFAdd_DocInfo_ID; |
||
50 | public string FinalPDFAdd_DocInfo_ID |
||
51 | { |
||
52 | get { return _FinalPDFAdd_DocInfo_ID; } |
||
53 | set |
||
54 | { |
||
55 | _FinalPDFAdd_DocInfo_ID = value; |
||
56 | OnPropertyChanged(() => FinalPDFAdd_DocInfo_ID); |
||
57 | } |
||
58 | } |
||
59 | 78cffba9 | semi | |
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 | } |
||
154 | 3bde451b | semi | |
155 | 78cffba9 | semi | 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 | } |
||
173 | 3bde451b | semi | #endregion |
174 | |||
175 | #region Command |
||
176 | |||
177 | public DelegateCommand FinalPDFAdd_OKCommand { get; private set; } |
||
178 | |||
179 | #endregion |
||
180 | |||
181 | #region Fuction |
||
182 | |||
183 | #region ConverAdd_OK |
||
184 | /// <summary> |
||
185 | /// 그리드 상단 Conver 추가 버튼 |
||
186 | /// ProjectNo, DocumentURL, DocumentID, 입력해서 저장 프로시저에서 추가 |
||
187 | /// </summary> |
||
188 | 037ab674 | semi | public async void FinalPDFAdd_OK(object obj) |
189 | 3bde451b | semi | { |
190 | 78cffba9 | semi | if (String.IsNullOrEmpty(FinalPDFAdd_Project_NO) || String.IsNullOrEmpty(FinalPDFAdd_DocInfo_ID) || String.IsNullOrEmpty(FinalPDFAdd_Document_ID)) |
191 | 3bde451b | semi | { |
192 | 78cffba9 | semi | Project_NO_Border = ""; |
193 | DOCUMENT_ID_Border = ""; |
||
194 | DocInfo_ID_Border = ""; |
||
195 | Project_NO_Color = ""; |
||
196 | DOCUMENT_ID_Color = ""; |
||
197 | DocInfo_ID_Color = ""; |
||
198 | 3bde451b | semi | } |
199 | 78cffba9 | semi | else |
200 | 3bde451b | semi | { |
201 | 78cffba9 | semi | 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; |
||
217 | 3bde451b | semi | } |
218 | } |
||
219 | |||
220 | #endregion |
||
221 | |||
222 | #endregion |
||
223 | } |
||
224 | } |