markus / KCOM / Controls / CheckList.xaml.cs @ dea3d68a
이력 | 보기 | 이력해설 | 다운로드 (57.1 KB)
1 | 787a4489 | KangIngu | using KCOMDataModel.Common; |
---|---|---|---|
2 | using KCOMDataModel.DataModel; |
||
3 | using System; |
||
4 | using System.Collections.Generic; |
||
5 | using System.Collections.ObjectModel; |
||
6 | using System.Linq; |
||
7 | using System.Text; |
||
8 | using System.Windows; |
||
9 | using System.Windows.Controls; |
||
10 | using System.Windows.Data; |
||
11 | using System.Windows.Documents; |
||
12 | using System.Windows.Input; |
||
13 | using System.Windows.Media; |
||
14 | using System.Windows.Media.Imaging; |
||
15 | using System.Windows.Navigation; |
||
16 | using System.Windows.Shapes; |
||
17 | using Telerik.Windows.Controls; |
||
18 | using KCOM.Common.Converter; |
||
19 | using System.ComponentModel; |
||
20 | using Telerik.Windows.Controls.GridView; |
||
21 | using KCOM.Controls; |
||
22 | using KCOM.Common; |
||
23 | using IKCOM; |
||
24 | 24a3178d | djkim | using System.Text.RegularExpressions; |
25 | aa73d664 | 이지연 | using GemBox.Spreadsheet; |
26 | using System.IO; |
||
27 | 787a4489 | KangIngu | |
28 | namespace KCOM.Controls |
||
29 | { |
||
30 | |||
31 | #region Customer |
||
32 | public class Customer |
||
33 | { |
||
34 | public string ID { get; set; } |
||
35 | public string DOCUMENT_ID { get; set; } |
||
36 | public string USER_ID { get; set; } |
||
37 | public string REVISION { get; set; } |
||
38 | public int PAGENUMBER { get; set; } |
||
39 | public string TODOLIST { get; set; } |
||
40 | public string IMAGE_URL { get; set; } |
||
41 | public string STATUS { get; set; } |
||
42 | public string STATUS_ { get; set; } |
||
43 | public string _STATUS { get; set; } |
||
44 | public string VENDOR { get; set; } |
||
45 | public string REMARK { get; set; } |
||
46 | public string PROJECT_NO { get; set; } |
||
47 | public string REV_19 { get; set; } |
||
48 | public string REV_18 { get; set; } |
||
49 | public string REV_17 { get; set; } |
||
50 | public string REV_16 { get; set; } |
||
51 | public string REV_15 { get; set; } |
||
52 | public string REV_14 { get; set; } |
||
53 | public string REV_13 { get; set; } |
||
54 | public string REV_12 { get; set; } |
||
55 | public string REV_11 { get; set; } |
||
56 | public string REV_10 { get; set; } |
||
57 | public string REV_9 { get; set; } |
||
58 | public string REV_8 { get; set; } |
||
59 | public string REV_7 { get; set; } |
||
60 | public string REV_6 { get; set; } |
||
61 | public string REV_5 { get; set; } |
||
62 | public string REV_4 { get; set; } |
||
63 | public string REV_3 { get; set; } |
||
64 | public string REV_2 { get; set; } |
||
65 | public string REV_1 { get; set; } |
||
66 | public string REV_0 { get; set; } |
||
67 | public string IMAGE_ANCHOR { get; set; } |
||
68 | public byte[] IMAGE_PATH { get; set; } |
||
69 | public string STATUS_DESC { get; set; } |
||
70 | public string REPLY { get; set; } |
||
71 | public DateTime CREATE_TIME { get; set; } |
||
72 | 90e7968d | ljiyeon | } |
73 | 787a4489 | KangIngu | #endregion |
74 | |||
75 | /// <summary> |
||
76 | /// Interaction logic for CheckList.xaml |
||
77 | /// </summary> |
||
78 | public partial class CheckList : UserControl |
||
79 | { |
||
80 | #region 프로퍼티 |
||
81 | List<CHECK_LIST> items = new List<CHECK_LIST>(); |
||
82 | List<Customer> Lists = new List<Customer>(); |
||
83 | 77922798 | 송근호 | MainWindow mainWindow; |
84 | 53880c83 | ljiyeon | //string old_Revision = ""; |
85 | 787a4489 | KangIngu | string old_DocID = ""; |
86 | string Current_Revision = ""; |
||
87 | 53880c83 | ljiyeon | //string Current_DocNo = ""; |
88 | //string Current_Slip = ""; |
||
89 | 787a4489 | KangIngu | bool Isinit = false; |
90 | int rev_cnt = 1; |
||
91 | 69ef0800 | KangIngu | bool isCheck_Status = false; |
92 | string Select_StatusID = ""; |
||
93 | 787a4489 | KangIngu | #endregion |
94 | |||
95 | #region 생성자 |
||
96 | 77922798 | 송근호 | public CheckList(MainWindow main) |
97 | 787a4489 | KangIngu | { |
98 | Common.ViewerDataModel.Instance.ViewVisible = Visibility.Visible; |
||
99 | InitializeComponent(); |
||
100 | 77922798 | 송근호 | mainWindow = main; |
101 | 787a4489 | KangIngu | this.Loaded += CheckList_Loaded; |
102 | this.KeyDown += new KeyEventHandler(KeyEventDownAction); |
||
103 | this.AddHandler(Image.MouseLeftButtonDownEvent, new MouseButtonEventHandler(mousedownOnImage), true); |
||
104 | 90e7968d | ljiyeon | |
105 | 77922798 | 송근호 | |
106 | 787a4489 | KangIngu | } |
107 | #endregion |
||
108 | |||
109 | public void DataBind() |
||
110 | { |
||
111 | 24a3178d | djkim | try |
112 | { |
||
113 | Isinit = false; |
||
114 | 0f065e57 | ljiyeon | |
115 | 24a3178d | djkim | Lists = new List<Customer>(); |
116 | 77922798 | 송근호 | string doc_no = mainWindow.dzMainMenu._DocItem.DOCUMENT_NO; |
117 | 24a3178d | djkim | string project_no = App.ViewInfo.ProjectNO; |
118 | string user_id = App.ViewInfo.UserID; |
||
119 | |||
120 | 664ea2e1 | taeseongkim | //Logger.sendReqLog("GetUserCheckList: ", project_no + "," + user_id + "," + doc_no, 1); |
121 | 24a3178d | djkim | |
122 | items = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetUserCheckList(project_no, user_id, doc_no); |
||
123 | if (items.Count() > 0) |
||
124 | { |
||
125 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetUserCheckList", "TRUE", 1); |
126 | 24a3178d | djkim | } |
127 | else |
||
128 | { |
||
129 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetUserCheckList", "FALSE", 1); |
130 | 24a3178d | djkim | } |
131 | 0f065e57 | ljiyeon | |
132 | 6c781c0c | djkim | foreach (var item in items) |
133 | 787a4489 | KangIngu | { |
134 | 6c781c0c | djkim | Customer customer = new Customer(); |
135 | customer.ID = item.ID; |
||
136 | customer.IMAGE_ANCHOR = item.IMAGE_ANCHOR; |
||
137 | if (item.IMAGE_URL != null && item.IMAGE_URL != "") |
||
138 | customer.IMAGE_PATH = Convert.FromBase64String(item.IMAGE_URL); |
||
139 | customer.PAGENUMBER = item.PAGENUMBER; |
||
140 | customer.PROJECT_NO = item.PROJECT_NO; |
||
141 | customer.REMARK = item.REMARK; |
||
142 | customer.REVISION = item.REVISION; |
||
143 | |||
144 | #region history |
||
145 | 664ea2e1 | taeseongkim | //Logger.sendReqLog("GetCheckListHistory: ", project_no + "," + item.ID, 1); |
146 | 0f065e57 | ljiyeon | var history = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetCheckListHistory(project_no, item.ID); |
147 | |||
148 | if (history.Count() > 0) |
||
149 | { |
||
150 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetCheckListHistory", "TRUE", 1); |
151 | 0f065e57 | ljiyeon | } |
152 | else |
||
153 | { |
||
154 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetCheckListHistory", "FALSE", 1); |
155 | 0f065e57 | ljiyeon | } |
156 | |||
157 | 6c781c0c | djkim | foreach (var rev in history) |
158 | 787a4489 | KangIngu | { |
159 | 6c781c0c | djkim | if (rev.REVISION == "A") |
160 | { customer.REV_0 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); } |
||
161 | if (rev.REVISION == "B") |
||
162 | { customer.REV_1 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 2 ? 2 : rev_cnt; } |
||
163 | if (rev.REVISION == "C") |
||
164 | { customer.REV_2 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 3 ? 3 : rev_cnt; } |
||
165 | if (rev.REVISION == "D") |
||
166 | { customer.REV_3 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 4 ? 4 : rev_cnt; } |
||
167 | if (rev.REVISION == "E") |
||
168 | { customer.REV_4 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 5 ? 5 : rev_cnt; } |
||
169 | if (rev.REVISION == "F") |
||
170 | { customer.REV_5 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 6 ? 6 : rev_cnt; } |
||
171 | if (rev.REVISION == "G") |
||
172 | { customer.REV_6 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 7 ? 7 : rev_cnt; } |
||
173 | if (rev.REVISION == "H") |
||
174 | { customer.REV_7 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 8 ? 8 : rev_cnt; } |
||
175 | if (rev.REVISION == "I") |
||
176 | { customer.REV_8 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 9 ? 9 : rev_cnt; } |
||
177 | if (rev.REVISION == "J") |
||
178 | { customer.REV_9 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 10 ? 10 : rev_cnt; } |
||
179 | if (rev.REVISION == "K") |
||
180 | { customer.REV_10 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 11 ? 11 : rev_cnt; } |
||
181 | if (rev.REVISION == "L") |
||
182 | { customer.REV_11 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 12 ? 12 : rev_cnt; } |
||
183 | if (rev.REVISION == "M") |
||
184 | { customer.REV_12 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 13 ? 13 : rev_cnt; } |
||
185 | if (rev.REVISION == "N") |
||
186 | { customer.REV_13 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 14 ? 14 : rev_cnt; } |
||
187 | if (rev.REVISION == "O") |
||
188 | { customer.REV_14 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 15 ? 15 : rev_cnt; } |
||
189 | if (rev.REVISION == "P") |
||
190 | { customer.REV_15 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 16 ? 16 : rev_cnt; } |
||
191 | if (rev.REVISION == "Q") |
||
192 | { customer.REV_16 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 17 ? 17 : rev_cnt; } |
||
193 | if (rev.REVISION == "R") |
||
194 | { customer.REV_17 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 18 ? 18 : rev_cnt; } |
||
195 | if (rev.REVISION == "S") |
||
196 | { customer.REV_18 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 19 ? 19 : rev_cnt; } |
||
197 | if (rev.REVISION == "T") |
||
198 | { customer.REV_19 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 20 ? 20 : rev_cnt; } |
||
199 | } |
||
200 | #endregion |
||
201 | 787a4489 | KangIngu | |
202 | 6c781c0c | djkim | customer.STATUS = item.STATUS; |
203 | customer.REPLY = item.REPLY; |
||
204 | customer.TODOLIST = item.TODOLIST; |
||
205 | customer.USER_ID = item.USER_ID; |
||
206 | customer.VENDOR = item.VENDOR; |
||
207 | customer.DOCUMENT_ID = item.DOCUMENT_ID; |
||
208 | customer.CREATE_TIME = DateTime.Parse(item.CREATE_TIME.ToString()); |
||
209 | 787a4489 | KangIngu | |
210 | 6c781c0c | djkim | if (item.STATUS == "True") |
211 | { |
||
212 | customer._STATUS = "Close"; |
||
213 | customer.STATUS_ = "False"; |
||
214 | customer.STATUS_DESC = item.STATUS_DESC_CLOSE; |
||
215 | 787a4489 | KangIngu | } |
216 | 6c781c0c | djkim | else |
217 | { |
||
218 | customer._STATUS = "Open"; |
||
219 | customer.STATUS_ = "True"; |
||
220 | customer.STATUS_DESC = item.STATUS_DESC_OPEN; |
||
221 | } |
||
222 | |||
223 | Lists.Add(customer); |
||
224 | 787a4489 | KangIngu | } |
225 | 24a3178d | djkim | } |
226 | catch (Exception ex) |
||
227 | { |
||
228 | 274cde11 | taeseongkim | Logger.sendResLog("Checklist DataBind", ex.Message, 0); |
229 | 24a3178d | djkim | } |
230 | |||
231 | |||
232 | 787a4489 | KangIngu | } |
233 | |||
234 | private void ChangeSize(double width, double height) |
||
235 | { |
||
236 | this.Width = width; |
||
237 | this.Height = height; |
||
238 | } |
||
239 | |||
240 | private void SyncInit() |
||
241 | { |
||
242 | 24a3178d | djkim | try |
243 | 787a4489 | KangIngu | { |
244 | 24a3178d | djkim | if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden) |
245 | { |
||
246 | ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden = true; |
||
247 | ViewerDataModel.Instance.PageBalanceMode = false; |
||
248 | ViewerDataModel.Instance.PageBalanceNumber = 0; |
||
249 | 752b18ef | taeseongkim | ViewerDataModel.Instance.SyncPageNumber = 0; |
250 | 24a3178d | djkim | ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
251 | ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewRevMarkup.Visibility = Visibility.Collapsed; |
||
252 | ViewerDataModel.Instance.SystemMain.dzMainMenu.UserList.IsChecked = false; |
||
253 | ViewerDataModel.Instance.SystemMain.dzMainMenu.BalanceMode.IsChecked = false; |
||
254 | } |
||
255 | 787a4489 | KangIngu | } |
256 | 90e7968d | ljiyeon | catch(Exception ex) |
257 | 24a3178d | djkim | { |
258 | 664ea2e1 | taeseongkim | //Logger.sendResLog("SyncInit", ex.Message, 0); |
259 | 24a3178d | djkim | } |
260 | 90e7968d | ljiyeon | |
261 | 787a4489 | KangIngu | } |
262 | |||
263 | private void DialogMessage_Alert(string Msg) |
||
264 | { |
||
265 | 24a3178d | djkim | try |
266 | { |
||
267 | RadWindow CheckPop = new RadWindow(); |
||
268 | Alert check = new Alert(Msg); |
||
269 | 787a4489 | KangIngu | |
270 | 24a3178d | djkim | CheckPop = new RadWindow |
271 | { |
||
272 | MinWidth = 400, |
||
273 | MinHeight = 100, |
||
274 | //Closed = (obj, args) => this.MarkupNamePromptClose(MarkupData, args), |
||
275 | Header = "Alert", |
||
276 | Content = check, |
||
277 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
278 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
279 | IsTopmost = true, |
||
280 | }; |
||
281 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
282 | CheckPop.ShowDialog(); |
||
283 | } |
||
284 | catch (Exception ex) |
||
285 | 787a4489 | KangIngu | { |
286 | 664ea2e1 | taeseongkim | //Logger.sendResLog("DialogMessage_Alert", ex.Message, 0); |
287 | 24a3178d | djkim | } |
288 | |||
289 | 787a4489 | KangIngu | } |
290 | |||
291 | private void History_Set() |
||
292 | { |
||
293 | 24a3178d | djkim | try |
294 | 787a4489 | KangIngu | { |
295 | 24a3178d | djkim | if (col1.Width != new GridLength(1200)) |
296 | { |
||
297 | Col_Remark.IsVisible = true; |
||
298 | Col_Reply.IsVisible = true; |
||
299 | Col_Vendor.IsVisible = true; |
||
300 | 787a4489 | KangIngu | |
301 | 24a3178d | djkim | if (Lists.Where(info => info.REV_1 != null).FirstOrDefault() != null) |
302 | REV_1.IsVisible = true; |
||
303 | 787a4489 | KangIngu | |
304 | 24a3178d | djkim | #region history |
305 | REV_0.IsVisible = true; |
||
306 | if (Lists.Where(info => info.REV_1 != null).FirstOrDefault() != null) |
||
307 | 787a4489 | KangIngu | { REV_1.IsVisible = true; REV_0.Width = 70; } |
308 | 24a3178d | djkim | else |
309 | { REV_0.Width = 140; } |
||
310 | if (Lists.Where(info => info.REV_2 != null).FirstOrDefault() != null) |
||
311 | REV_2.IsVisible = true; REV_2.IsVisible = true; |
||
312 | if (Lists.Where(info => info.REV_3 != null).FirstOrDefault() != null) |
||
313 | REV_3.IsVisible = true; |
||
314 | if (Lists.Where(info => info.REV_4 != null).FirstOrDefault() != null) |
||
315 | REV_4.IsVisible = true; |
||
316 | if (Lists.Where(info => info.REV_5 != null).FirstOrDefault() != null) |
||
317 | REV_5.IsVisible = true; |
||
318 | if (Lists.Where(info => info.REV_6 != null).FirstOrDefault() != null) |
||
319 | REV_6.IsVisible = true; |
||
320 | if (Lists.Where(info => info.REV_7 != null).FirstOrDefault() != null) |
||
321 | REV_7.IsVisible = true; |
||
322 | if (Lists.Where(info => info.REV_8 != null).FirstOrDefault() != null) |
||
323 | REV_8.IsVisible = true; |
||
324 | if (Lists.Where(info => info.REV_9 != null).FirstOrDefault() != null) |
||
325 | REV_9.IsVisible = true; |
||
326 | if (Lists.Where(info => info.REV_10 != null).FirstOrDefault() != null) |
||
327 | REV_10.IsVisible = true; |
||
328 | if (Lists.Where(info => info.REV_11 != null).FirstOrDefault() != null) |
||
329 | REV_11.IsVisible = true; |
||
330 | if (Lists.Where(info => info.REV_12 != null).FirstOrDefault() != null) |
||
331 | REV_12.IsVisible = true; |
||
332 | if (Lists.Where(info => info.REV_13 != null).FirstOrDefault() != null) |
||
333 | REV_13.IsVisible = true; |
||
334 | if (Lists.Where(info => info.REV_14 != null).FirstOrDefault() != null) |
||
335 | REV_14.IsVisible = true; |
||
336 | if (Lists.Where(info => info.REV_15 != null).FirstOrDefault() != null) |
||
337 | REV_15.IsVisible = true; |
||
338 | if (Lists.Where(info => info.REV_16 != null).FirstOrDefault() != null) |
||
339 | REV_16.IsVisible = true; |
||
340 | if (Lists.Where(info => info.REV_17 != null).FirstOrDefault() != null) |
||
341 | REV_17.IsVisible = true; |
||
342 | if (Lists.Where(info => info.REV_18 != null).FirstOrDefault() != null) |
||
343 | REV_18.IsVisible = true; |
||
344 | if (Lists.Where(info => info.REV_19 != null).FirstOrDefault() != null) |
||
345 | REV_19.IsVisible = true; |
||
346 | #endregion |
||
347 | |||
348 | } |
||
349 | 787a4489 | KangIngu | else |
350 | 24a3178d | djkim | { |
351 | Col_Remark.IsVisible = false; |
||
352 | Col_Reply.IsVisible = false; |
||
353 | Col_Vendor.IsVisible = false; |
||
354 | 787a4489 | KangIngu | |
355 | 24a3178d | djkim | #region history |
356 | REV_0.IsVisible = false; |
||
357 | REV_1.IsVisible = false; |
||
358 | REV_2.IsVisible = false; |
||
359 | REV_3.IsVisible = false; |
||
360 | REV_4.IsVisible = false; |
||
361 | REV_5.IsVisible = false; |
||
362 | REV_6.IsVisible = false; |
||
363 | REV_7.IsVisible = false; |
||
364 | REV_8.IsVisible = false; |
||
365 | REV_9.IsVisible = false; |
||
366 | REV_10.IsVisible = false; |
||
367 | REV_11.IsVisible = false; |
||
368 | REV_12.IsVisible = false; |
||
369 | REV_13.IsVisible = false; |
||
370 | REV_14.IsVisible = false; |
||
371 | REV_15.IsVisible = false; |
||
372 | REV_16.IsVisible = false; |
||
373 | REV_17.IsVisible = false; |
||
374 | REV_18.IsVisible = false; |
||
375 | REV_19.IsVisible = false; |
||
376 | #endregion |
||
377 | } |
||
378 | 787a4489 | KangIngu | } |
379 | 24a3178d | djkim | catch (Exception ex) |
380 | 787a4489 | KangIngu | { |
381 | 664ea2e1 | taeseongkim | //Logger.sendResLog("History_Set", ex.Message, 0); |
382 | 787a4489 | KangIngu | } |
383 | 24a3178d | djkim | |
384 | 787a4489 | KangIngu | } |
385 | |||
386 | #region Excel Export |
||
387 | |||
388 | aa73d664 | 이지연 | [Obsolete] |
389 | 787a4489 | KangIngu | private void ExportEvent(object sender, RoutedEventArgs e) |
390 | { |
||
391 | 24a3178d | djkim | try |
392 | 787a4489 | KangIngu | { |
393 | 77922798 | 송근호 | if (mainWindow.dzMainMenu.mouseHandlingMode == MouseHandlingMode.Capture) |
394 | 24a3178d | djkim | { |
395 | DialogMessage_Alert("Capture중 입니다."); |
||
396 | return; |
||
397 | } |
||
398 | this.ExportIndy.IsBusy = true; |
||
399 | 787a4489 | KangIngu | |
400 | 24a3178d | djkim | if (Lists.Count == 0) |
401 | 787a4489 | KangIngu | { |
402 | 24a3178d | djkim | DialogMessage_Alert("Data Not Found"); |
403 | this.ExportIndy.IsBusy = false; |
||
404 | return; |
||
405 | } |
||
406 | 787a4489 | KangIngu | |
407 | 24a3178d | djkim | string extension = "xlsx"; |
408 | 84c48033 | djkim | string excelpath = CommonLib.Common.GetConfigString("excelFilePath", "URL", "", App.isExternal); |
409 | b7637656 | djkim | Uri url = new Uri(excelpath); |
410 | 787a4489 | KangIngu | |
411 | 24a3178d | djkim | System.Windows.Forms.SaveFileDialog dialog = new System.Windows.Forms.SaveFileDialog() |
412 | { |
||
413 | DefaultExt = extension, |
||
414 | Filter = String.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", extension, "Excel"), |
||
415 | FilterIndex = 1 |
||
416 | }; |
||
417 | 787a4489 | KangIngu | |
418 | 24a3178d | djkim | if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) |
419 | { |
||
420 | using (var client = new System.Net.WebClient()) |
||
421 | { |
||
422 | client.DownloadFile(url, dialog.FileName); |
||
423 | aa73d664 | 이지연 | SpreadsheetInfo.SetLicense(Properties.Settings.Default.GemBoxLicense);// "EXK0-W4HZ-N518-IMEW"); |
424 | ExcelFile workbook = null; |
||
425 | ExcelWorksheet worksheet = null; |
||
426 | 24a3178d | djkim | try |
427 | 787a4489 | KangIngu | { |
428 | aa73d664 | 이지연 | // Excel 첫번째 워크시트 가져오기 |
429 | workbook = ExcelFile.Load(dialog.FileName); |
||
430 | worksheet = workbook.Worksheets[0]; |
||
431 | f9faf398 | 이지연 | |
432 | 24a3178d | djkim | // 데이타 넣기 |
433 | aa73d664 | 이지연 | int h = 8; |
434 | int w = 1; |
||
435 | 24a3178d | djkim | string project_no = App.ViewInfo.ProjectNO; |
436 | aa73d664 | 이지연 | worksheet.Cells[1, w + 8].Value = project_no; |
437 | 24a3178d | djkim | |
438 | string project_name = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetProjectName(project_no); |
||
439 | if (project_name != null || project_name != "") |
||
440 | { |
||
441 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetProjectName", "TRUE", 1); |
442 | 24a3178d | djkim | } |
443 | else |
||
444 | { |
||
445 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetProjectName", "FALSE", 1); |
446 | 24a3178d | djkim | } |
447 | aa73d664 | 이지연 | worksheet.Cells[2, w + 8].Value = project_name; |
448 | worksheet.Cells[3, w + 8].Value = (mainWindow as MainWindow).dzMainMenu._DocItem.DOCUMENT_NO; |
||
449 | worksheet.Cells[4, w + 8].Value = (mainWindow as MainWindow).dzMainMenu.userData.NAME + " (" + App.ViewInfo.UserID + ")"; |
||
450 | worksheet.Cells[5, w + 8].Value = DateTime.Now.ToString("yyyy.MM.dd"); |
||
451 | 787a4489 | KangIngu | |
452 | aa73d664 | 이지연 | ExcelCell Range_I = worksheet.Cells["K9"]; |
453 | 787a4489 | KangIngu | |
454 | 24a3178d | djkim | var Rev = Lists.Select(info => info.REVISION).Distinct(); |
455 | string[] Cell = { "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T" }; |
||
456 | string[] Range = { "L9", "M9", "N9", "O9", "P9", "Q9", "R9", "S9", "T9", "U9", "V9", "W9", "X9", "Y9", "Z9", "AA9", "AB9", "AC9", "AD9" }; |
||
457 | string Ran = "K"; |
||
458 | 787a4489 | KangIngu | |
459 | aa73d664 | 이지연 | worksheet.Cells.GetSubrangeAbsolute(8, 11, 8, 11 + rev_cnt - 1).Merged = true; |
460 | 787a4489 | KangIngu | |
461 | 24a3178d | djkim | if (rev_cnt != 1) |
462 | 787a4489 | KangIngu | { |
463 | 24a3178d | djkim | Ran = Range[rev_cnt - 2].Substring(0, Range[rev_cnt - 2].Length - 1); |
464 | } |
||
465 | aa73d664 | 이지연 | CellRange iRange = worksheet.Cells.GetSubrange("B10:" + Ran + "10"); |
466 | |||
467 | 24a3178d | djkim | //필터 기능 추가 |
468 | aa73d664 | 이지연 | CellRange Filter_Range = worksheet.Cells.GetSubrange("B9:" + Ran + "9"); |
469 | Filter_Range.Filter(true); |
||
470 | ExcelCell Range_b = worksheet.Cells["B10"]; |
||
471 | f9faf398 | 이지연 | Range_b.Row.SetHeight(190, LengthUnit.Pixel); |
472 | 24a3178d | djkim | Lists.ForEach(data => |
473 | { |
||
474 | h++; |
||
475 | aa73d664 | 이지연 | // Get the range. |
476 | CellRange oRange = worksheet.Cells.GetSubrange("B" + (h + 1) + ":" + Ran + (h + 1)); |
||
477 | foreach (var cell in oRange) |
||
478 | { |
||
479 | cell.Style.Borders.SetBorders(MultipleBorders.Outside, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin); |
||
480 | } |
||
481 | 787a4489 | KangIngu | |
482 | 24a3178d | djkim | if (data.IMAGE_PATH != null) |
483 | 787a4489 | KangIngu | { |
484 | f9faf398 | 이지연 | ExcelCell ImageRange = worksheet.Cells[h, w + 2]; |
485 | aa73d664 | 이지연 | ImageRange.Row.Height = Range_b.Row.Height; |
486 | 24a3178d | djkim | System.Drawing.Image I_Image = byteArrayToImage(data.IMAGE_PATH); |
487 | f9faf398 | 이지연 | System.Drawing.Image o_Image = Resize(I_Image, 180, 180); |
488 | |||
489 | 24a3178d | djkim | System.Windows.Forms.Clipboard.SetDataObject(o_Image, true); |
490 | aa73d664 | 이지연 | ImageRange.Style.HorizontalAlignment = HorizontalAlignmentStyle.Left; |
491 | ImageRange.Style.VerticalAlignment = VerticalAlignmentStyle.Top; |
||
492 | byte[] imageData = data.IMAGE_PATH; |
||
493 | MemoryStream memoryStream = new MemoryStream(); |
||
494 | o_Image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg); |
||
495 | int column = 2; // 이미지를 삽입할 열 |
||
496 | int row = h; // 이미지를 삽입할 행 |
||
497 | // 이미지를 워크시트에 추가 |
||
498 | f9faf398 | 이지연 | ExcelPicture picture = worksheet.Pictures.Add(memoryStream, PositioningMode.Move, new AnchorCell(ImageRange.Column, ImageRange.Row, 0, 0), ExcelPictureFormat.Jpeg); |
499 | picture.Position.SetTop(picture.Position.Top + 7, LengthUnit.Point); |
||
500 | picture.Position.SetLeft(picture.Position.Left + 7, LengthUnit.Point); |
||
501 | |||
502 | int Height = o_Image.Height > 100 ? o_Image.Height : 100; |
||
503 | ImageRange.Row.SetHeight(Height + 20, LengthUnit.Pixel); |
||
504 | aa73d664 | 이지연 | |
505 | //foreach (Microsoft.Office.Interop.Excel.Shape shp in worksheet.Shapes) |
||
506 | //{ |
||
507 | // if (shp.TopLeftCell.Address != ImageRange.Address) |
||
508 | // continue; |
||
509 | |||
510 | // double Left = shp.TopLeftCell.Left + (shp.TopLeftCell.Width - shp.Width) / 2; |
||
511 | // double Top = shp.TopLeftCell.Top + (shp.TopLeftCell.Height - shp.Height) / 2; |
||
512 | |||
513 | // shp.Left = float.Parse(Left.ToString()); |
||
514 | // shp.Top = float.Parse(Top.ToString()); |
||
515 | |||
516 | // break; |
||
517 | //} |
||
518 | 787a4489 | KangIngu | } |
519 | |||
520 | 24a3178d | djkim | #region Excel Bind |
521 | aa73d664 | 이지연 | worksheet.Cells[h, w].Value = data.REVISION; |
522 | worksheet.Cells[h, w + 1].Value = data.PAGENUMBER; |
||
523 | worksheet.Cells[h, w + 3].Value = data.TODOLIST; |
||
524 | worksheet.Cells[h, w + 4].Value = data.STATUS.ToUpper() == "TRUE" ? "closed" : "open"; |
||
525 | worksheet.Cells[h, w + 5].Value = data.STATUS_DESC; |
||
526 | worksheet.Cells[h, w + 6].Value = data.VENDOR; |
||
527 | worksheet.Cells[h, w + 7].Value = data.REMARK; |
||
528 | worksheet.Cells[h, w + 8].Value = data.REPLY; |
||
529 | worksheet.Cells[h, w + 9].Value = data.REV_0 == null ? "" : data.REV_0.Replace("", " / "); |
||
530 | worksheet.Cells[h, w + 10].Value = data.REV_1 == null ? "" : data.REV_1.Replace("", " / "); |
||
531 | worksheet.Cells[h, w + 11].Value = data.REV_2 == null ? "" : data.REV_2.Replace("", " / "); |
||
532 | worksheet.Cells[h, w + 12].Value = data.REV_3 == null ? "" : data.REV_3.Replace("", " / "); |
||
533 | worksheet.Cells[h, w + 13].Value = data.REV_4 == null ? "" : data.REV_4.Replace("", " / "); |
||
534 | worksheet.Cells[h, w + 14].Value = data.REV_5 == null ? "" : data.REV_5.Replace("", " / "); |
||
535 | worksheet.Cells[h, w + 15].Value = data.REV_6 == null ? "" : data.REV_6.Replace("", " / "); |
||
536 | worksheet.Cells[h, w + 16].Value = data.REV_7 == null ? "" : data.REV_7.Replace("", " / "); |
||
537 | worksheet.Cells[h, w + 17].Value = data.REV_8 == null ? "" : data.REV_8.Replace("", " / "); |
||
538 | worksheet.Cells[h, w + 18].Value = data.REV_9 == null ? "" : data.REV_9.Replace("", " / "); |
||
539 | worksheet.Cells[h, w + 19].Value = data.REV_10 == null ? "" : data.REV_10.Replace("", " / "); |
||
540 | worksheet.Cells[h, w + 20].Value = data.REV_11 == null ? "" : data.REV_11.Replace("", " / "); |
||
541 | worksheet.Cells[h, w + 21].Value = data.REV_12 == null ? "" : data.REV_12.Replace("", " / "); |
||
542 | worksheet.Cells[h, w + 22].Value = data.REV_13 == null ? "" : data.REV_13.Replace("", " / "); |
||
543 | worksheet.Cells[h, w + 23].Value = data.REV_14 == null ? "" : data.REV_14.Replace("", " / "); |
||
544 | worksheet.Cells[h, w + 24].Value = data.REV_15 == null ? "" : data.REV_15.Replace("", " / "); |
||
545 | worksheet.Cells[h, w + 25].Value = data.REV_16 == null ? "" : data.REV_16.Replace("", " / "); |
||
546 | worksheet.Cells[h, w + 26].Value = data.REV_17 == null ? "" : data.REV_17.Replace("", " / "); |
||
547 | worksheet.Cells[h, w + 27].Value = data.REV_18 == null ? "" : data.REV_18.Replace("", " / "); |
||
548 | worksheet.Cells[h, w + 28].Value = data.REV_19 == null ? "" : data.REV_19.Replace("", " / "); |
||
549 | f9faf398 | 이지연 | //worksheet.Rows[h] |
550 | |||
551 | 24a3178d | djkim | #endregion |
552 | }); |
||
553 | aa73d664 | 이지연 | |
554 | for (int columnIndex = 1; columnIndex < 11; ++columnIndex) |
||
555 | { |
||
556 | worksheet.Columns[columnIndex].AutoFit(); |
||
557 | } |
||
558 | 24a3178d | djkim | |
559 | f9faf398 | 이지연 | worksheet.Columns["D"].SetWidth(200, LengthUnit.Pixel); |
560 | aa73d664 | 이지연 | worksheet.Columns["G"].Width = Convert.ToInt32(worksheet.Columns["G"].Width * 1.1); |
561 | 24a3178d | djkim | // 엑셀파일 저장 |
562 | aa73d664 | 이지연 | workbook.Save(dialog.FileName); |
563 | |||
564 | 787a4489 | KangIngu | } |
565 | 24a3178d | djkim | finally |
566 | aa73d664 | 이지연 | { |
567 | 24a3178d | djkim | // Clean up |
568 | ReleaseExcelObject(worksheet); |
||
569 | ReleaseExcelObject(workbook); |
||
570 | } |
||
571 | 787a4489 | KangIngu | } |
572 | 24a3178d | djkim | DialogMessage_Alert("Success"); |
573 | 787a4489 | KangIngu | } |
574 | 24a3178d | djkim | |
575 | this.ExportIndy.IsBusy = false; |
||
576 | } |
||
577 | catch (Exception ex) |
||
578 | { |
||
579 | 664ea2e1 | taeseongkim | //Logger.sendResLog("CheckList ExportEvent", ex.Message, 0); |
580 | 787a4489 | KangIngu | } |
581 | |||
582 | } |
||
583 | |||
584 | aa73d664 | 이지연 | private static void SetWidth(ExcelColumn column, double width) |
585 | { |
||
586 | column.SetWidth( |
||
587 | Math.Truncate((width * 7 + 5) / 7 * 256) / 256, |
||
588 | LengthUnit.ZeroCharacterWidth); |
||
589 | } |
||
590 | |||
591 | |||
592 | 787a4489 | KangIngu | public System.Drawing.Image byteArrayToImage(byte[] byteArrayIn) |
593 | { |
||
594 | using (var ms = new System.IO.MemoryStream(byteArrayIn)) |
||
595 | { |
||
596 | return System.Drawing.Image.FromStream(ms); |
||
597 | } |
||
598 | } |
||
599 | |||
600 | public System.Drawing.Image Resize(System.Drawing.Image image, int newWidth, int maxHeight) |
||
601 | { |
||
602 | //if (onlyResizeIfWider && image.Width <= newWidth) newWidth = image.Width; |
||
603 | |||
604 | 24a3178d | djkim | try |
605 | 787a4489 | KangIngu | { |
606 | 24a3178d | djkim | var newHeight = image.Height * newWidth / image.Width; |
607 | if (newHeight > maxHeight) |
||
608 | { |
||
609 | // Resize with height instead |
||
610 | newWidth = image.Width * maxHeight / image.Height; |
||
611 | newHeight = maxHeight; |
||
612 | } |
||
613 | 787a4489 | KangIngu | |
614 | 24a3178d | djkim | var res = new System.Drawing.Bitmap(newWidth, newHeight); |
615 | 787a4489 | KangIngu | |
616 | 24a3178d | djkim | using (var graphic = System.Drawing.Graphics.FromImage(res)) |
617 | { |
||
618 | graphic.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; |
||
619 | graphic.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; |
||
620 | graphic.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; |
||
621 | graphic.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; |
||
622 | graphic.DrawImage(image, 0, 0, newWidth, newHeight); |
||
623 | } |
||
624 | return res; |
||
625 | } |
||
626 | catch (Exception ex) |
||
627 | 787a4489 | KangIngu | { |
628 | 664ea2e1 | taeseongkim | //Logger.sendResLog("Resize", ex.Message, 0); |
629 | 24a3178d | djkim | return null; |
630 | 787a4489 | KangIngu | } |
631 | 90e7968d | ljiyeon | |
632 | 787a4489 | KangIngu | |
633 | 90e7968d | ljiyeon | |
634 | 787a4489 | KangIngu | } |
635 | |||
636 | private static void ReleaseExcelObject(object obj) |
||
637 | { |
||
638 | try |
||
639 | { |
||
640 | if (obj != null) |
||
641 | { |
||
642 | obj = null; |
||
643 | } |
||
644 | } |
||
645 | catch (Exception ex) |
||
646 | { |
||
647 | obj = null; |
||
648 | throw ex; |
||
649 | } |
||
650 | finally |
||
651 | { |
||
652 | GC.Collect(); |
||
653 | } |
||
654 | } |
||
655 | |||
656 | #endregion |
||
657 | |||
658 | #region 이벤트 |
||
659 | |||
660 | void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e) |
||
661 | { |
||
662 | ChangeSize(e.NewSize.Width, e.NewSize.Height); |
||
663 | } |
||
664 | |||
665 | private void CheckList_Loaded(object sender, RoutedEventArgs e) |
||
666 | { |
||
667 | 24a3178d | djkim | DataBind(); |
668 | this.tb.ItemsSource = null; |
||
669 | this.tb.ItemsSource = Lists; |
||
670 | History_Set(); |
||
671 | 787a4489 | KangIngu | } |
672 | 90e7968d | ljiyeon | |
673 | 787a4489 | KangIngu | private void RadGridView_Loaded(object sender, RoutedEventArgs e) |
674 | { |
||
675 | DataBind(); |
||
676 | (sender as Telerik.Windows.Controls.RadGridView).ItemsSource = null; |
||
677 | (sender as Telerik.Windows.Controls.RadGridView).ItemsSource = Lists; |
||
678 | |||
679 | ChangeSize(this.ActualWidth, this.ActualHeight); |
||
680 | this.SizeChanged += new SizeChangedEventHandler(MainWindow_SizeChanged); |
||
681 | } |
||
682 | |||
683 | private void AddEvent(object sender, RoutedEventArgs e) |
||
684 | { |
||
685 | 24a3178d | djkim | try |
686 | { |
||
687 | 77922798 | 송근호 | mainWindow.Focus(); |
688 | 24a3178d | djkim | |
689 | 5a223b60 | humkyung | Common.ViewerDataModel.Instance.CheckList_ID = Commons.ShortGuid(); |
690 | 24a3178d | djkim | Common.ViewerDataModel.Instance.Capture_Opacity = 0.5; |
691 | 77922798 | 송근호 | (mainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture; |
692 | 24a3178d | djkim | } |
693 | 90e7968d | ljiyeon | catch(Exception ex) |
694 | 24a3178d | djkim | { |
695 | 664ea2e1 | taeseongkim | //Logger.sendResLog("Checklist Addevent", ex.Message, 0); |
696 | 24a3178d | djkim | } |
697 | 90e7968d | ljiyeon | |
698 | 787a4489 | KangIngu | } |
699 | |||
700 | private void SaveEvent(object sender, RoutedEventArgs e) |
||
701 | { |
||
702 | 24a3178d | djkim | try |
703 | 787a4489 | KangIngu | { |
704 | 77922798 | 송근호 | if ((mainWindow as MainWindow).dzMainMenu.mouseHandlingMode == MouseHandlingMode.Capture) |
705 | 0f065e57 | ljiyeon | { |
706 | 24a3178d | djkim | DialogMessage_Alert("Capture중 입니다."); |
707 | return; |
||
708 | 0f065e57 | ljiyeon | } |
709 | 24a3178d | djkim | CHECK_LIST Check_value = new CHECK_LIST(); |
710 | CHECK_LIST_HISTORY Check_History = new CHECK_LIST_HISTORY(); |
||
711 | 0f065e57 | ljiyeon | |
712 | 24a3178d | djkim | foreach (var item in tb.Items) |
713 | 787a4489 | KangIngu | { |
714 | 24a3178d | djkim | string Check_ID = (item as Customer).ID.ToString(); |
715 | string state = ""; |
||
716 | |||
717 | 664ea2e1 | taeseongkim | //Logger.sendReqLog("GetCheckList: ", App.ViewInfo.ProjectNO + "," + Check_ID, 1); |
718 | 24a3178d | djkim | Check_value = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetCheckList(App.ViewInfo.ProjectNO, Check_ID); |
719 | if (Check_value != null) |
||
720 | 6c781c0c | djkim | { |
721 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetCheckList", "TRUE", 1); |
722 | 24a3178d | djkim | } |
723 | 6c781c0c | djkim | else |
724 | { |
||
725 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetCheckList", "FALSE", 1); |
726 | 6c781c0c | djkim | } |
727 | 787a4489 | KangIngu | |
728 | 24a3178d | djkim | if (Check_value != null) |
729 | 787a4489 | KangIngu | { |
730 | 24a3178d | djkim | if ((item as Customer).STATUS.ToUpper() == "TRUE") |
731 | 0f065e57 | ljiyeon | { |
732 | 24a3178d | djkim | state = "Closed"; |
733 | Check_value.STATUS_DESC_CLOSE = (item as Customer).STATUS_DESC; |
||
734 | 0f065e57 | ljiyeon | } |
735 | else |
||
736 | { |
||
737 | 24a3178d | djkim | state = "Open"; |
738 | Check_value.STATUS_DESC_OPEN = (item as Customer).STATUS_DESC; |
||
739 | 0f065e57 | ljiyeon | } |
740 | 787a4489 | KangIngu | |
741 | 24a3178d | djkim | string Rev = state + "" + DateTime.Now.ToString("yyyy.MM.dd"); |
742 | string description = ""; |
||
743 | 787a4489 | KangIngu | |
744 | 24a3178d | djkim | if (char.Parse(ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision) >= char.Parse(Check_value.REVISION)) |
745 | 6c781c0c | djkim | { |
746 | 24a3178d | djkim | Check_value.REMARK = (item as Customer).REMARK; |
747 | Check_value.STATUS = (item as Customer).STATUS; |
||
748 | Check_value.TODOLIST = (item as Customer).TODOLIST; |
||
749 | Check_value.VENDOR = (item as Customer).VENDOR; |
||
750 | Check_value.REPLY = (item as Customer).REPLY; |
||
751 | |||
752 | if ((item as Customer).STATUS == "False") |
||
753 | description = Check_value.STATUS_DESC_OPEN; |
||
754 | else |
||
755 | description = Check_value.STATUS_DESC_CLOSE; |
||
756 | 787a4489 | KangIngu | |
757 | 664ea2e1 | taeseongkim | //Logger.sendReqLog("GetCheckListHistory: ", App.ViewInfo.ProjectNO + "," + Check_ID, 1); |
758 | 24a3178d | djkim | var history = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetCheckListHistory(App.ViewInfo.ProjectNO, Check_ID); |
759 | if (history.Count() > 0) |
||
760 | 787a4489 | KangIngu | { |
761 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetCheckList", "TRUE", 1); |
762 | 787a4489 | KangIngu | } |
763 | 6c781c0c | djkim | else |
764 | 787a4489 | KangIngu | { |
765 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetCheckList", "FALSE", 1); |
766 | 24a3178d | djkim | } |
767 | Check_History = history.Where(info => info.REVISION == ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision).FirstOrDefault(); |
||
768 | |||
769 | List<string> validation = new List<string>(); |
||
770 | |||
771 | foreach (var his in history) |
||
772 | { |
||
773 | if (his.TODOLIST == Check_value.TODOLIST) |
||
774 | validation.Add("TODOLIST"); |
||
775 | if (his.STATUS_DESC == description) |
||
776 | validation.Add("STATUS_DESC"); |
||
777 | if (his.VENDOR == Check_value.VENDOR) |
||
778 | validation.Add("VENDOR"); |
||
779 | if (his.REMARK == Check_value.REMARK) |
||
780 | validation.Add("REMARK"); |
||
781 | if (his.REPLY == Check_value.REPLY) |
||
782 | validation.Add("REPLY"); |
||
783 | } |
||
784 | |||
785 | if (validation.Count < 5) |
||
786 | { |
||
787 | if (Check_History == null) |
||
788 | 5de0c110 | ljiyeon | { |
789 | 24a3178d | djkim | Check_History = new CHECK_LIST_HISTORY() |
790 | { |
||
791 | 5a223b60 | humkyung | ID = Commons.ShortGuid(), |
792 | 24a3178d | djkim | CHECKLIST_ID = Check_ID, |
793 | REVISION = ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision, |
||
794 | STATUS = state, |
||
795 | IMAGE_URL = Check_value.IMAGE_URL, |
||
796 | STATUS_DESC = validation.Where(i => i.ToString() == "STATUS_DESC").FirstOrDefault() == null ? description : "", |
||
797 | TODOLIST = validation.Where(i => i.ToString() == "TODOLIST").FirstOrDefault() == null ? Check_value.TODOLIST : "", |
||
798 | VENDOR = validation.Where(i => i.ToString() == "VENDOR").FirstOrDefault() == null ? Check_value.VENDOR : "", |
||
799 | REMARK = validation.Where(i => i.ToString() == "REMARK").FirstOrDefault() == null ? Check_value.REMARK : "", |
||
800 | REPLY = validation.Where(i => i.ToString() == "REPLY").FirstOrDefault() == null ? Check_value.REPLY : "", |
||
801 | CREATE_TIME = DateTime.Now, |
||
802 | UPDATE_TIME = DateTime.Now |
||
803 | }; |
||
804 | |||
805 | 274cde11 | taeseongkim | var result = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddCheckListHistory(App.ViewInfo.ProjectNO, Check_History).ToString(); |
806 | |||
807 | Logger.sendReqLog("AddCheckListHistory: ", App.ViewInfo.ProjectNO + "," + Check_History, 1); |
||
808 | Logger.sendResLog("AddCheckListHistory", result, 1); |
||
809 | |||
810 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddCheckListHistory(App.ViewInfo.ProjectNO, Check_History); |
||
811 | 24a3178d | djkim | |
812 | Check_value.REVISION = Current_Revision; |
||
813 | 5de0c110 | ljiyeon | } |
814 | else |
||
815 | { |
||
816 | 24a3178d | djkim | Check_History.IMAGE_URL = Check_value.IMAGE_URL; |
817 | Check_History.STATUS = state; |
||
818 | Check_History.TODOLIST = Check_value.TODOLIST; |
||
819 | Check_History.VENDOR = Check_value.VENDOR; |
||
820 | Check_History.REMARK = Check_value.REMARK; |
||
821 | Check_History.REPLY = Check_value.REPLY; |
||
822 | Check_History.UPDATE_TIME = DateTime.Now; |
||
823 | if (state == "Open") |
||
824 | { |
||
825 | Check_History.STATUS_DESC = Check_value.STATUS_DESC_OPEN; |
||
826 | } |
||
827 | else |
||
828 | { |
||
829 | Check_History.STATUS_DESC = Check_value.STATUS_DESC_CLOSE; |
||
830 | } |
||
831 | |||
832 | 274cde11 | taeseongkim | Logger.sendReqLog("SaveCheckListHistory: ", App.ViewInfo.ProjectNO + "," + ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision + "," + Check_History, 1); |
833 | 664ea2e1 | taeseongkim | //Logger.sendResLog("SaveCheckListHistory", Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveCheckListHistory(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision, Check_History).ToString(), 1); |
834 | 24a3178d | djkim | |
835 | 274cde11 | taeseongkim | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveCheckListHistory(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision, Check_History); |
836 | 5de0c110 | ljiyeon | } |
837 | 787a4489 | KangIngu | } |
838 | 24a3178d | djkim | validation = new List<string>(); |
839 | 787a4489 | KangIngu | } |
840 | } |
||
841 | 24a3178d | djkim | |
842 | 274cde11 | taeseongkim | Logger.sendReqLog("SaveCheckList: ", App.ViewInfo.ProjectNO + "," + Check_ID + "," + Check_value, 1); |
843 | 664ea2e1 | taeseongkim | //Logger.sendResLog("SaveCheckList", Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveCheckList(App.ViewInfo.ProjectNO, Check_ID, Check_value).ToString(), 1); |
844 | 274cde11 | taeseongkim | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveCheckList(App.ViewInfo.ProjectNO, Check_ID, Check_value); |
845 | 787a4489 | KangIngu | } |
846 | 0f065e57 | ljiyeon | |
847 | 24a3178d | djkim | DataBind(); |
848 | tb.ItemsSource = null; |
||
849 | tb.ItemsSource = Lists; |
||
850 | History_Set(); |
||
851 | |||
852 | DialogMessage_Alert("Success"); |
||
853 | } |
||
854 | catch (Exception ex) |
||
855 | { |
||
856 | 664ea2e1 | taeseongkim | //Logger.sendResLog("Checklist SaveEvent", ex.Message, 0); |
857 | 787a4489 | KangIngu | } |
858 | 90e7968d | ljiyeon | |
859 | 787a4489 | KangIngu | } |
860 | |||
861 | private void CheckListEvent(object sender, RoutedEventArgs e) |
||
862 | { |
||
863 | if (col1.Width == new GridLength(1200)) |
||
864 | { |
||
865 | this.Width += 600; |
||
866 | col1.Width = new GridLength(1800); |
||
867 | } |
||
868 | else |
||
869 | { |
||
870 | this.Width -= 600; |
||
871 | col1.Width = new GridLength(1200); |
||
872 | } |
||
873 | History_Set(); |
||
874 | } |
||
875 | |||
876 | private void CommentMoveEvent(object sender, MouseButtonEventArgs e) |
||
877 | { |
||
878 | SyncInit(); |
||
879 | |||
880 | Rect rect = new Rect(); |
||
881 | string[] RectPoint = ((e.Source as Image).DataContext as Customer).IMAGE_ANCHOR.Split(','); |
||
882 | //string[] RectPoint = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).IMAGE_ANCHOR.Split(','); |
||
883 | |||
884 | rect = new Rect(new Point(double.Parse(RectPoint[0]), double.Parse(RectPoint[1])), new Point(double.Parse(RectPoint[0]) + double.Parse(RectPoint[2]), double.Parse(RectPoint[1]) + double.Parse(RectPoint[3]))); |
||
885 | |||
886 | //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).PAGENUMBER); |
||
887 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Image).DataContext as Customer).PAGENUMBER); |
||
888 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.ZoomTo(rect); |
||
889 | 77922798 | 송근호 | mainWindow.Focus(); |
890 | 787a4489 | KangIngu | } |
891 | |||
892 | private void CaptureEvent(object sender, MouseButtonEventArgs e) |
||
893 | { |
||
894 | SyncInit(); |
||
895 | |||
896 | //캡쳐 하기 전에 코멘트 저장 |
||
897 | 77922798 | 송근호 | if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (mainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0) |
898 | 787a4489 | KangIngu | { |
899 | 77922798 | 송근호 | var menu = (mainWindow as MainWindow).dzMainMenu; |
900 | 077896be | humkyung | SelectionSet.Instance.UnSelect(menu); |
901 | 787a4489 | KangIngu | if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
902 | { |
||
903 | 77922798 | 송근호 | (mainWindow as MainWindow).dzTopMenu.SaveEventCallback(null, null); |
904 | 787a4489 | KangIngu | } |
905 | else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID) |
||
906 | { |
||
907 | |||
908 | } |
||
909 | else |
||
910 | { |
||
911 | 77922798 | 송근호 | (mainWindow as MainWindow).dzTopMenu.SaveEventCallback(null, null); |
912 | 787a4489 | KangIngu | } |
913 | } |
||
914 | |||
915 | //Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).ID; |
||
916 | Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Image).DataContext as Customer).ID; |
||
917 | 24a3178d | djkim | //Common.ViewerDataModel.Instance.PageNumber = ((e.Source as Image).DataContext as Customer).PAGENUMBER; |
918 | 77922798 | 송근호 | mainWindow.Focus(); |
919 | 787a4489 | KangIngu | Common.ViewerDataModel.Instance.Capture_Opacity = 0.49; |
920 | 77922798 | 송근호 | (mainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture; |
921 | 787a4489 | KangIngu | } |
922 | |||
923 | public void KeyEventDownAction(object sender, KeyEventArgs e) |
||
924 | { |
||
925 | switch (e.Key) |
||
926 | { |
||
927 | case Key.Escape: |
||
928 | { |
||
929 | 77922798 | 송근호 | (mainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
930 | 787a4489 | KangIngu | Common.ViewerDataModel.Instance.Capture_Opacity = 0; |
931 | } |
||
932 | break; |
||
933 | } |
||
934 | } |
||
935 | |||
936 | private void tb_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) |
||
937 | { |
||
938 | 24a3178d | djkim | try |
939 | 787a4489 | KangIngu | { |
940 | 24a3178d | djkim | if (ViewerDataModel.Instance.Capture_Opacity == 0) |
941 | return; |
||
942 | |||
943 | DataBind(); |
||
944 | tb.ItemsSource = null; |
||
945 | tb.ItemsSource = Lists.OrderBy(info => info.CREATE_TIME); |
||
946 | //tb1.ItemsSource = Lists.OrderBy(info => info.CREATE_TIME); |
||
947 | 787a4489 | KangIngu | |
948 | 24a3178d | djkim | if (ViewerDataModel.Instance.Capture_Opacity == 0.5) |
949 | 787a4489 | KangIngu | { |
950 | 24a3178d | djkim | tb.SortDescriptors.Clear(); |
951 | tb.FilterDescriptors.Clear(); |
||
952 | 787a4489 | KangIngu | |
953 | 24a3178d | djkim | var scrollViewer = this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault(); |
954 | if (scrollViewer != null) |
||
955 | { |
||
956 | //this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset(this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ExtentHeight); |
||
957 | //this.tb1.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset(this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ExtentHeight); |
||
958 | 787a4489 | KangIngu | |
959 | 24a3178d | djkim | tb.ScrollIndexIntoView(tb.Items.Count - 1); |
960 | tb.CurrentCellInfo = new GridViewCellInfo(tb.Items[tb.Items.Count - 1], tb.Columns["TODOLIST"]); |
||
961 | tb.Focus(); |
||
962 | |||
963 | } |
||
964 | 787a4489 | KangIngu | } |
965 | } |
||
966 | 90e7968d | ljiyeon | catch(Exception ex) |
967 | 24a3178d | djkim | { |
968 | 664ea2e1 | taeseongkim | //Logger.sendResLog("tb_IsVisibleChanged", ex.Message, 0); |
969 | 24a3178d | djkim | } |
970 | 90e7968d | ljiyeon | |
971 | 787a4489 | KangIngu | } |
972 | |||
973 | private void Radio_Open_Checked(object sender, RoutedEventArgs e) |
||
974 | { |
||
975 | 24a3178d | djkim | try |
976 | 787a4489 | KangIngu | { |
977 | 24a3178d | djkim | (e.Source as RadioButton).Foreground = Brushes.Red; |
978 | (e.Source as RadioButton).FontWeight = FontWeights.Bold; |
||
979 | 787a4489 | KangIngu | |
980 | 24a3178d | djkim | if ((((e.OriginalSource as RadioButton).Parent as StackPanel).Parent as GridViewCell).ParentRow.Item != null) |
981 | 787a4489 | KangIngu | { |
982 | 24a3178d | djkim | ((((e.OriginalSource as RadioButton).Parent as StackPanel).Parent as GridViewCell).ParentRow.Item as Customer)._STATUS = "Open"; |
983 | } |
||
984 | |||
985 | if (Isinit) |
||
986 | { |
||
987 | Isinit = false; |
||
988 | if ((e.Source as RadioButton).DataContext != null) |
||
989 | 787a4489 | KangIngu | { |
990 | 24a3178d | djkim | if (((e.Source as RadioButton).DataContext as Customer).STATUS_DESC != "Vendor 반영 필요") |
991 | { |
||
992 | ((e.Source as RadioButton).DataContext as Customer).STATUS_DESC = "Vendor 반영 필요"; |
||
993 | 787a4489 | KangIngu | |
994 | 24a3178d | djkim | tb.Rebind(); |
995 | } |
||
996 | 787a4489 | KangIngu | } |
997 | } |
||
998 | } |
||
999 | 90e7968d | ljiyeon | catch(Exception ex) |
1000 | 24a3178d | djkim | { |
1001 | 664ea2e1 | taeseongkim | //Logger.sendResLog("Radio_Open_Checked", ex.Message, 0); |
1002 | 24a3178d | djkim | } |
1003 | 90e7968d | ljiyeon | |
1004 | 787a4489 | KangIngu | } |
1005 | |||
1006 | private void Radio_Close_Checked(object sender, RoutedEventArgs e) |
||
1007 | { |
||
1008 | 24a3178d | djkim | try |
1009 | 69ef0800 | KangIngu | { |
1010 | 24a3178d | djkim | if (Isinit) |
1011 | 69ef0800 | KangIngu | { |
1012 | 24a3178d | djkim | if (!isCheck_Status) |
1013 | { |
||
1014 | Select_StatusID = ((e.Source as RadioButton).DataContext as Customer).ID; |
||
1015 | 69ef0800 | KangIngu | |
1016 | 24a3178d | djkim | isCheck_Status = true; |
1017 | 69ef0800 | KangIngu | |
1018 | 24a3178d | djkim | RadWindow CheckPop = new RadWindow(); |
1019 | 69ef0800 | KangIngu | |
1020 | 24a3178d | djkim | CheckList_Status check = new CheckList_Status(); |
1021 | 69ef0800 | KangIngu | |
1022 | 24a3178d | djkim | CheckPop = new RadWindow |
1023 | { |
||
1024 | MinWidth = 350, |
||
1025 | MinHeight = 150, |
||
1026 | Header = "Status Description을 입력하세요", |
||
1027 | Content = check, |
||
1028 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
1029 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
1030 | IsTopmost = true, |
||
1031 | }; |
||
1032 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
1033 | CheckPop.Closed += CheckPop_Closed; |
||
1034 | CheckPop.Show(); |
||
1035 | |||
1036 | Isinit = false; |
||
1037 | tb.Rebind(); |
||
1038 | } |
||
1039 | 69ef0800 | KangIngu | } |
1040 | 787a4489 | KangIngu | |
1041 | (e.Source as RadioButton).FontWeight = FontWeights.Bold; |
||
1042 | |||
1043 | 24a3178d | djkim | if ((((e.OriginalSource as RadioButton).Parent as StackPanel).Parent as GridViewCell).ParentRow.Item != null) |
1044 | { |
||
1045 | ((((e.OriginalSource as RadioButton).Parent as StackPanel).Parent as GridViewCell).ParentRow.Item as Customer)._STATUS = "Close"; |
||
1046 | } |
||
1047 | } |
||
1048 | 90e7968d | ljiyeon | catch(Exception ex) |
1049 | 787a4489 | KangIngu | { |
1050 | 664ea2e1 | taeseongkim | //Logger.sendResLog("Radio_Close_Checked", ex.Message, 0); |
1051 | 787a4489 | KangIngu | } |
1052 | 90e7968d | ljiyeon | |
1053 | 69ef0800 | KangIngu | } |
1054 | 787a4489 | KangIngu | |
1055 | 69ef0800 | KangIngu | private void CheckPop_Closed(object sender, WindowClosedEventArgs e) |
1056 | { |
||
1057 | 24a3178d | djkim | try |
1058 | 787a4489 | KangIngu | { |
1059 | 24a3178d | djkim | isCheck_Status = false; |
1060 | |||
1061 | foreach (var item in tb.Items) |
||
1062 | 787a4489 | KangIngu | { |
1063 | 24a3178d | djkim | if (Select_StatusID == (item as Customer).ID.ToString()) |
1064 | 69ef0800 | KangIngu | { |
1065 | 24a3178d | djkim | if (ViewerDataModel.Instance.CheckStatus != "" && ViewerDataModel.Instance.CheckStatus != null) |
1066 | { |
||
1067 | (item as Customer).STATUS_DESC = ViewerDataModel.Instance.CheckStatus; |
||
1068 | } |
||
1069 | else |
||
1070 | { |
||
1071 | (item as Customer).STATUS = "False"; |
||
1072 | (item as Customer)._STATUS = "Open"; |
||
1073 | (item as Customer).STATUS_ = "True"; |
||
1074 | } |
||
1075 | 69ef0800 | KangIngu | |
1076 | 24a3178d | djkim | ViewerDataModel.Instance.CheckStatus = ""; |
1077 | Select_StatusID = ""; |
||
1078 | tb.Rebind(); |
||
1079 | return; |
||
1080 | } |
||
1081 | 787a4489 | KangIngu | } |
1082 | } |
||
1083 | 90e7968d | ljiyeon | catch(Exception ex) |
1084 | 24a3178d | djkim | { |
1085 | 664ea2e1 | taeseongkim | //Logger.sendResLog("CheckPop_Closed", ex.Message, 0); |
1086 | 24a3178d | djkim | } |
1087 | 90e7968d | ljiyeon | |
1088 | 69ef0800 | KangIngu | |
1089 | 787a4489 | KangIngu | } |
1090 | |||
1091 | private void Radio_Unchecked(object sender, RoutedEventArgs e) |
||
1092 | { |
||
1093 | 24a3178d | djkim | try |
1094 | { |
||
1095 | (e.Source as RadioButton).Foreground = Brushes.Black; |
||
1096 | (e.Source as RadioButton).FontWeight = FontWeights.Normal; |
||
1097 | } |
||
1098 | 90e7968d | ljiyeon | catch(Exception ex) |
1099 | 24a3178d | djkim | { |
1100 | 664ea2e1 | taeseongkim | //Logger.sendResLog("Radio_Unchecked", ex.Message, 0); |
1101 | 24a3178d | djkim | } |
1102 | 90e7968d | ljiyeon | |
1103 | 787a4489 | KangIngu | } |
1104 | |||
1105 | private void mousedownOnImage(object sender, MouseButtonEventArgs args) |
||
1106 | { |
||
1107 | 24a3178d | djkim | try |
1108 | 787a4489 | KangIngu | { |
1109 | 24a3178d | djkim | if (args.OriginalSource as TextBlock != null && (args.OriginalSource as TextBlock).Parent != null) |
1110 | 787a4489 | KangIngu | { |
1111 | 24a3178d | djkim | if ((args.OriginalSource as TextBlock).Parent.GetType().Name == "GridViewHeaderCell") |
1112 | { |
||
1113 | Isinit = false; |
||
1114 | return; |
||
1115 | } |
||
1116 | 787a4489 | KangIngu | } |
1117 | |||
1118 | 24a3178d | djkim | Isinit = true; |
1119 | 787a4489 | KangIngu | |
1120 | 24a3178d | djkim | RadWindow CheckPop = new RadWindow(); |
1121 | 787a4489 | KangIngu | |
1122 | 24a3178d | djkim | if (args.OriginalSource is Image) |
1123 | { |
||
1124 | Image img = (args.OriginalSource as Image); |
||
1125 | if (img.Height != 45) |
||
1126 | return; |
||
1127 | 787a4489 | KangIngu | |
1128 | 24a3178d | djkim | CommantImage check = new CommantImage(img); |
1129 | 787a4489 | KangIngu | |
1130 | 24a3178d | djkim | CheckPop = new RadWindow |
1131 | { |
||
1132 | MinWidth = 500, |
||
1133 | MinHeight = 500, |
||
1134 | Header = "Image", |
||
1135 | Content = check, |
||
1136 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
1137 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
1138 | IsTopmost = true, |
||
1139 | }; |
||
1140 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
1141 | CheckPop.Show(); |
||
1142 | } |
||
1143 | |||
1144 | if (args.OriginalSource as TextBlock == null || (args.OriginalSource as TextBlock).Parent == null || ((args.OriginalSource as TextBlock).Parent) as GridViewCell == null) |
||
1145 | 787a4489 | KangIngu | { |
1146 | 24a3178d | djkim | return; |
1147 | } |
||
1148 | 787a4489 | KangIngu | |
1149 | 24a3178d | djkim | if ((((args.OriginalSource as TextBlock).Parent) as GridViewCell).DataColumn.ColumnGroupName.ToString() == "History") |
1150 | { |
||
1151 | 787a4489 | KangIngu | |
1152 | 24a3178d | djkim | CheckList_Detail Detail = new CheckList_Detail((((args.OriginalSource as TextBlock).Parent as GridViewCell).ParentRow.Item as KCOM.Controls.Customer).ID, (((args.OriginalSource as TextBlock).Parent) as GridViewCell).DataColumn.Header.ToString()); |
1153 | 787a4489 | KangIngu | |
1154 | 24a3178d | djkim | CheckPop = new RadWindow |
1155 | { |
||
1156 | MinWidth = 800, |
||
1157 | MinHeight = 400, |
||
1158 | Header = "Detail", |
||
1159 | Content = Detail, |
||
1160 | //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
||
1161 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
1162 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
1163 | IsTopmost = true, |
||
1164 | }; |
||
1165 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
1166 | //CheckPop.ShowDialog(); |
||
1167 | CheckPop.Show(); |
||
1168 | } |
||
1169 | } |
||
1170 | 90e7968d | ljiyeon | catch(Exception ex) |
1171 | 24a3178d | djkim | { |
1172 | 664ea2e1 | taeseongkim | //Logger.sendResLog("mousedownOnImage", ex.Message, 0); |
1173 | 787a4489 | KangIngu | } |
1174 | 90e7968d | ljiyeon | |
1175 | 24a3178d | djkim | |
1176 | 787a4489 | KangIngu | } |
1177 | |||
1178 | private void SyncEvent(object sender, MouseButtonEventArgs e) |
||
1179 | { |
||
1180 | 24a3178d | djkim | try |
1181 | 0f065e57 | ljiyeon | { |
1182 | 24a3178d | djkim | old_DocID = ((e.Source as Image).DataContext as Customer).DOCUMENT_ID; |
1183 | if (old_DocID.Equals(Current_Revision)) |
||
1184 | { |
||
1185 | DialogMessage_Alert("같은 Revision 은 비교할 수 없습니다."); |
||
1186 | return; |
||
1187 | } |
||
1188 | 664ea2e1 | taeseongkim | //Logger.sendReqLog("GetVPRevisionFirstOrDefault: ", App.ViewInfo.ProjectNO + "," + old_DocID, 1); |
1189 | 24a3178d | djkim | var _vpList = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetVPRevisionFirstOrDefault(App.ViewInfo.ProjectNO, old_DocID); |
1190 | if (_vpList != null) |
||
1191 | { |
||
1192 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetVPRevisionFirstOrDefault", "TRUE", 1); |
1193 | 24a3178d | djkim | } |
1194 | else |
||
1195 | { |
||
1196 | 664ea2e1 | taeseongkim | //Logger.sendResLog("GetVPRevisionFirstOrDefault", "FALSE", 1); |
1197 | 24a3178d | djkim | } |
1198 | |||
1199 | 0f065e57 | ljiyeon | |
1200 | 787a4489 | KangIngu | |
1201 | 24a3178d | djkim | SyncInit(); |
1202 | Rect rect = new Rect(); |
||
1203 | string[] RectPoint = ((e.Source as Image).DataContext as Customer).IMAGE_ANCHOR.Split(','); |
||
1204 | rect = new Rect(new Point(double.Parse(RectPoint[0]), double.Parse(RectPoint[1])), new Point(double.Parse(RectPoint[0]) + double.Parse(RectPoint[2]), double.Parse(RectPoint[1]) + double.Parse(RectPoint[3]))); |
||
1205 | ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Image).DataContext as Customer).PAGENUMBER); |
||
1206 | ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.Sync_ZoomTo(rect); |
||
1207 | 77922798 | 송근호 | (mainWindow as MainWindow).dzMainMenu.Sync_Event(_vpList); |
1208 | 24a3178d | djkim | |
1209 | } |
||
1210 | catch (Exception ex) |
||
1211 | 787a4489 | KangIngu | { |
1212 | 664ea2e1 | taeseongkim | //Logger.sendResLog("SyncEvent", ex.Message, 0); |
1213 | 787a4489 | KangIngu | } |
1214 | 90e7968d | ljiyeon | |
1215 | 787a4489 | KangIngu | } |
1216 | |||
1217 | #endregion |
||
1218 | } |
||
1219 | } |