markus / KCOM / Controls / CheckList.xaml.cs @ f87ee33e
이력 | 보기 | 이력해설 | 다운로드 (47.3 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 | using Excel = Microsoft.Office.Interop.Excel; |
||
25 | |||
26 | |||
27 | namespace KCOM.Controls |
||
28 | { |
||
29 | |||
30 | #region Customer |
||
31 | public class Customer |
||
32 | { |
||
33 | public string ID { get; set; } |
||
34 | public string DOCUMENT_ID { get; set; } |
||
35 | public string USER_ID { get; set; } |
||
36 | public string REVISION { get; set; } |
||
37 | public int PAGENUMBER { get; set; } |
||
38 | public string TODOLIST { get; set; } |
||
39 | public string IMAGE_URL { get; set; } |
||
40 | public string STATUS { get; set; } |
||
41 | public string STATUS_ { get; set; } |
||
42 | public string _STATUS { get; set; } |
||
43 | public string VENDOR { get; set; } |
||
44 | public string REMARK { get; set; } |
||
45 | public string PROJECT_NO { get; set; } |
||
46 | public string REV_19 { get; set; } |
||
47 | public string REV_18 { get; set; } |
||
48 | public string REV_17 { get; set; } |
||
49 | public string REV_16 { get; set; } |
||
50 | public string REV_15 { get; set; } |
||
51 | public string REV_14 { get; set; } |
||
52 | public string REV_13 { get; set; } |
||
53 | public string REV_12 { get; set; } |
||
54 | public string REV_11 { get; set; } |
||
55 | public string REV_10 { get; set; } |
||
56 | public string REV_9 { get; set; } |
||
57 | public string REV_8 { get; set; } |
||
58 | public string REV_7 { get; set; } |
||
59 | public string REV_6 { get; set; } |
||
60 | public string REV_5 { get; set; } |
||
61 | public string REV_4 { get; set; } |
||
62 | public string REV_3 { get; set; } |
||
63 | public string REV_2 { get; set; } |
||
64 | public string REV_1 { get; set; } |
||
65 | public string REV_0 { get; set; } |
||
66 | public string IMAGE_ANCHOR { get; set; } |
||
67 | public byte[] IMAGE_PATH { get; set; } |
||
68 | public string STATUS_DESC { get; set; } |
||
69 | public string REPLY { get; set; } |
||
70 | public DateTime CREATE_TIME { get; set; } |
||
71 | } |
||
72 | #endregion |
||
73 | |||
74 | /// <summary> |
||
75 | /// Interaction logic for CheckList.xaml |
||
76 | /// </summary> |
||
77 | public partial class CheckList : UserControl |
||
78 | { |
||
79 | #region 프로퍼티 |
||
80 | List<CHECK_LIST> items = new List<CHECK_LIST>(); |
||
81 | List<Customer> Lists = new List<Customer>(); |
||
82 | string old_Revision = ""; |
||
83 | string old_DocID = ""; |
||
84 | string Current_Revision = ""; |
||
85 | string Current_DocNo = ""; |
||
86 | int Current_Slip = 0; |
||
87 | bool Isinit = false; |
||
88 | int rev_cnt = 1; |
||
89 | 69ef0800 | KangIngu | bool isCheck_Status = false; |
90 | string Select_StatusID = ""; |
||
91 | 787a4489 | KangIngu | #endregion |
92 | |||
93 | #region 생성자 |
||
94 | public CheckList() |
||
95 | { |
||
96 | Common.ViewerDataModel.Instance.ViewVisible = Visibility.Visible; |
||
97 | InitializeComponent(); |
||
98 | this.Loaded += CheckList_Loaded; |
||
99 | this.KeyDown += new KeyEventHandler(KeyEventDownAction); |
||
100 | this.AddHandler(Image.MouseLeftButtonDownEvent, new MouseButtonEventHandler(mousedownOnImage), true); |
||
101 | |||
102 | } |
||
103 | #endregion |
||
104 | |||
105 | public void DataBind() |
||
106 | { |
||
107 | Isinit = false; |
||
108 | 6c781c0c | djkim | |
109 | 787a4489 | KangIngu | Lists = new List<Customer>(); |
110 | string doc_no = (Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.DOCUMENT_NO; |
||
111 | 6c781c0c | djkim | string project_no = App.ViewInfo.ProjectNO; |
112 | string user_id = App.ViewInfo.UserID; |
||
113 | items = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetUserCheckList(project_no, user_id, doc_no); |
||
114 | if (Lists.Count == 0) |
||
115 | 787a4489 | KangIngu | { |
116 | 6c781c0c | djkim | foreach (var item in items) |
117 | 787a4489 | KangIngu | { |
118 | 6c781c0c | djkim | Customer customer = new Customer(); |
119 | customer.ID = item.ID; |
||
120 | customer.IMAGE_ANCHOR = item.IMAGE_ANCHOR; |
||
121 | if (item.IMAGE_URL != null && item.IMAGE_URL != "") |
||
122 | customer.IMAGE_PATH = Convert.FromBase64String(item.IMAGE_URL); |
||
123 | customer.PAGENUMBER = item.PAGENUMBER; |
||
124 | customer.PROJECT_NO = item.PROJECT_NO; |
||
125 | customer.REMARK = item.REMARK; |
||
126 | customer.REVISION = item.REVISION; |
||
127 | |||
128 | #region history |
||
129 | var history = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetCheckListHistory(project_no, item.ID); |
||
130 | foreach (var rev in history) |
||
131 | 787a4489 | KangIngu | { |
132 | 6c781c0c | djkim | if (rev.REVISION == "A") |
133 | { customer.REV_0 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); } |
||
134 | if (rev.REVISION == "B") |
||
135 | { customer.REV_1 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 2 ? 2 : rev_cnt; } |
||
136 | if (rev.REVISION == "C") |
||
137 | { customer.REV_2 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 3 ? 3 : rev_cnt; } |
||
138 | if (rev.REVISION == "D") |
||
139 | { customer.REV_3 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 4 ? 4 : rev_cnt; } |
||
140 | if (rev.REVISION == "E") |
||
141 | { customer.REV_4 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 5 ? 5 : rev_cnt; } |
||
142 | if (rev.REVISION == "F") |
||
143 | { customer.REV_5 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 6 ? 6 : rev_cnt; } |
||
144 | if (rev.REVISION == "G") |
||
145 | { customer.REV_6 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 7 ? 7 : rev_cnt; } |
||
146 | if (rev.REVISION == "H") |
||
147 | { customer.REV_7 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 8 ? 8 : rev_cnt; } |
||
148 | if (rev.REVISION == "I") |
||
149 | { customer.REV_8 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 9 ? 9 : rev_cnt; } |
||
150 | if (rev.REVISION == "J") |
||
151 | { customer.REV_9 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 10 ? 10 : rev_cnt; } |
||
152 | if (rev.REVISION == "K") |
||
153 | { customer.REV_10 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 11 ? 11 : rev_cnt; } |
||
154 | if (rev.REVISION == "L") |
||
155 | { customer.REV_11 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 12 ? 12 : rev_cnt; } |
||
156 | if (rev.REVISION == "M") |
||
157 | { customer.REV_12 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 13 ? 13 : rev_cnt; } |
||
158 | if (rev.REVISION == "N") |
||
159 | { customer.REV_13 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 14 ? 14 : rev_cnt; } |
||
160 | if (rev.REVISION == "O") |
||
161 | { customer.REV_14 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 15 ? 15 : rev_cnt; } |
||
162 | if (rev.REVISION == "P") |
||
163 | { customer.REV_15 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 16 ? 16 : rev_cnt; } |
||
164 | if (rev.REVISION == "Q") |
||
165 | { customer.REV_16 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 17 ? 17 : rev_cnt; } |
||
166 | if (rev.REVISION == "R") |
||
167 | { customer.REV_17 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 18 ? 18 : rev_cnt; } |
||
168 | if (rev.REVISION == "S") |
||
169 | { customer.REV_18 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 19 ? 19 : rev_cnt; } |
||
170 | if (rev.REVISION == "T") |
||
171 | { customer.REV_19 = rev.STATUS + "" + rev.CREATE_TIME.ToString("yyyy.MM.dd"); rev_cnt = rev_cnt < 20 ? 20 : rev_cnt; } |
||
172 | } |
||
173 | #endregion |
||
174 | 787a4489 | KangIngu | |
175 | 6c781c0c | djkim | customer.STATUS = item.STATUS; |
176 | customer.REPLY = item.REPLY; |
||
177 | customer.TODOLIST = item.TODOLIST; |
||
178 | customer.USER_ID = item.USER_ID; |
||
179 | customer.VENDOR = item.VENDOR; |
||
180 | customer.DOCUMENT_ID = item.DOCUMENT_ID; |
||
181 | customer.CREATE_TIME = DateTime.Parse(item.CREATE_TIME.ToString()); |
||
182 | 787a4489 | KangIngu | |
183 | 6c781c0c | djkim | if (item.STATUS == "True") |
184 | { |
||
185 | customer._STATUS = "Close"; |
||
186 | customer.STATUS_ = "False"; |
||
187 | customer.STATUS_DESC = item.STATUS_DESC_CLOSE; |
||
188 | 787a4489 | KangIngu | } |
189 | 6c781c0c | djkim | else |
190 | { |
||
191 | customer._STATUS = "Open"; |
||
192 | customer.STATUS_ = "True"; |
||
193 | customer.STATUS_DESC = item.STATUS_DESC_OPEN; |
||
194 | } |
||
195 | |||
196 | Lists.Add(customer); |
||
197 | 787a4489 | KangIngu | } |
198 | 6c781c0c | djkim | } |
199 | 787a4489 | KangIngu | } |
200 | |||
201 | private void ChangeSize(double width, double height) |
||
202 | { |
||
203 | this.Width = width; |
||
204 | this.Height = height; |
||
205 | } |
||
206 | |||
207 | private void SyncInit() |
||
208 | { |
||
209 | if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden) |
||
210 | { |
||
211 | ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden = true; |
||
212 | ViewerDataModel.Instance.PageBalanceMode = false; |
||
213 | ViewerDataModel.Instance.PageBalanceNumber = 0; |
||
214 | ViewerDataModel.Instance.PageNumber = 0; |
||
215 | ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
||
216 | ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewRevMarkup.Visibility = Visibility.Collapsed; |
||
217 | ViewerDataModel.Instance.SystemMain.dzMainMenu.UserList.IsChecked = false; |
||
218 | ViewerDataModel.Instance.SystemMain.dzMainMenu.BalanceMode.IsChecked = false; |
||
219 | } |
||
220 | } |
||
221 | |||
222 | private void DialogMessage_Alert(string Msg) |
||
223 | { |
||
224 | RadWindow CheckPop = new RadWindow(); |
||
225 | Alert check = new Alert(Msg); |
||
226 | |||
227 | CheckPop = new RadWindow |
||
228 | { |
||
229 | MinWidth = 400, |
||
230 | MinHeight = 100, |
||
231 | 01cbc243 | KangIngu | //Closed = (obj, args) => this.MarkupNamePromptClose(MarkupData, args), |
232 | 787a4489 | KangIngu | Header = "Alert", |
233 | Content = check, |
||
234 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
235 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
236 | IsTopmost = true, |
||
237 | }; |
||
238 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
239 | CheckPop.ShowDialog(); |
||
240 | } |
||
241 | |||
242 | private void History_Set() |
||
243 | { |
||
244 | if (col1.Width != new GridLength(1200)) |
||
245 | { |
||
246 | Col_Remark.IsVisible = true; |
||
247 | Col_Reply.IsVisible = true; |
||
248 | Col_Vendor.IsVisible = true; |
||
249 | |||
250 | if (Lists.Where(info => info.REV_1 != null).FirstOrDefault() != null) |
||
251 | REV_1.IsVisible = true; |
||
252 | |||
253 | #region history |
||
254 | REV_0.IsVisible = true; |
||
255 | if (Lists.Where(info => info.REV_1 != null).FirstOrDefault() != null) |
||
256 | { REV_1.IsVisible = true; REV_0.Width = 70; } |
||
257 | else |
||
258 | { REV_0.Width = 140;} |
||
259 | if (Lists.Where(info => info.REV_2 != null).FirstOrDefault() != null) |
||
260 | REV_2.IsVisible = true; REV_2.IsVisible = true; |
||
261 | if (Lists.Where(info => info.REV_3 != null).FirstOrDefault() != null) |
||
262 | REV_3.IsVisible = true; |
||
263 | if (Lists.Where(info => info.REV_4 != null).FirstOrDefault() != null) |
||
264 | REV_4.IsVisible = true; |
||
265 | if (Lists.Where(info => info.REV_5 != null).FirstOrDefault() != null) |
||
266 | REV_5.IsVisible = true; |
||
267 | if (Lists.Where(info => info.REV_6 != null).FirstOrDefault() != null) |
||
268 | REV_6.IsVisible = true; |
||
269 | if (Lists.Where(info => info.REV_7 != null).FirstOrDefault() != null) |
||
270 | REV_7.IsVisible = true; |
||
271 | if (Lists.Where(info => info.REV_8 != null).FirstOrDefault() != null) |
||
272 | REV_8.IsVisible = true; |
||
273 | if (Lists.Where(info => info.REV_9 != null).FirstOrDefault() != null) |
||
274 | REV_9.IsVisible = true; |
||
275 | if (Lists.Where(info => info.REV_10 != null).FirstOrDefault() != null) |
||
276 | REV_10.IsVisible = true; |
||
277 | if (Lists.Where(info => info.REV_11 != null).FirstOrDefault() != null) |
||
278 | REV_11.IsVisible = true; |
||
279 | if (Lists.Where(info => info.REV_12 != null).FirstOrDefault() != null) |
||
280 | REV_12.IsVisible = true; |
||
281 | if (Lists.Where(info => info.REV_13 != null).FirstOrDefault() != null) |
||
282 | REV_13.IsVisible = true; |
||
283 | if (Lists.Where(info => info.REV_14 != null).FirstOrDefault() != null) |
||
284 | REV_14.IsVisible = true; |
||
285 | if (Lists.Where(info => info.REV_15 != null).FirstOrDefault() != null) |
||
286 | REV_15.IsVisible = true; |
||
287 | if (Lists.Where(info => info.REV_16 != null).FirstOrDefault() != null) |
||
288 | REV_16.IsVisible = true; |
||
289 | if (Lists.Where(info => info.REV_17 != null).FirstOrDefault() != null) |
||
290 | REV_17.IsVisible = true; |
||
291 | if (Lists.Where(info => info.REV_18 != null).FirstOrDefault() != null) |
||
292 | REV_18.IsVisible = true; |
||
293 | if (Lists.Where(info => info.REV_19 != null).FirstOrDefault() != null) |
||
294 | REV_19.IsVisible = true; |
||
295 | #endregion |
||
296 | |||
297 | } |
||
298 | else |
||
299 | { |
||
300 | Col_Remark.IsVisible = false; |
||
301 | Col_Reply.IsVisible = false; |
||
302 | Col_Vendor.IsVisible = false; |
||
303 | |||
304 | #region history |
||
305 | REV_0.IsVisible = false; |
||
306 | REV_1.IsVisible = false; |
||
307 | REV_2.IsVisible = false; |
||
308 | REV_3.IsVisible = false; |
||
309 | REV_4.IsVisible = false; |
||
310 | REV_5.IsVisible = false; |
||
311 | REV_6.IsVisible = false; |
||
312 | REV_7.IsVisible = false; |
||
313 | REV_8.IsVisible = false; |
||
314 | REV_9.IsVisible = false; |
||
315 | REV_10.IsVisible = false; |
||
316 | REV_11.IsVisible = false; |
||
317 | REV_12.IsVisible = false; |
||
318 | REV_13.IsVisible = false; |
||
319 | REV_14.IsVisible = false; |
||
320 | REV_15.IsVisible = false; |
||
321 | REV_16.IsVisible = false; |
||
322 | REV_17.IsVisible = false; |
||
323 | REV_18.IsVisible = false; |
||
324 | REV_19.IsVisible = false; |
||
325 | #endregion |
||
326 | } |
||
327 | } |
||
328 | |||
329 | #region Excel Export |
||
330 | |||
331 | private void ExportEvent(object sender, RoutedEventArgs e) |
||
332 | { |
||
333 | this.ExportIndy.IsBusy = true; |
||
334 | |||
335 | if (Lists.Count == 0) |
||
336 | { |
||
337 | DialogMessage_Alert("Data Not Found"); |
||
338 | this.ExportIndy.IsBusy = false; |
||
339 | return; |
||
340 | } |
||
341 | |||
342 | string extension = "xlsx"; |
||
343 | //Uri url = new Uri("http://cloud.devdoftech.co.kr:5977/TileSource/Check_Test/CheckList.xlsx"); |
||
344 | Uri url = new Uri("http://cloud.devdoftech.co.kr:5977/TileSource/Check_Test/CheckList_T.xlsx"); |
||
345 | |||
346 | System.Windows.Forms.SaveFileDialog dialog = new System.Windows.Forms.SaveFileDialog() |
||
347 | { |
||
348 | DefaultExt = extension, |
||
349 | Filter = String.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", extension, "Excel"), |
||
350 | FilterIndex = 1 |
||
351 | }; |
||
352 | |||
353 | if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) |
||
354 | { |
||
355 | using (var client = new System.Net.WebClient()) |
||
356 | { |
||
357 | client.DownloadFile(url, dialog.FileName); |
||
358 | |||
359 | Excel.Application application = null; |
||
360 | Excel.Workbook workbook = null; |
||
361 | Excel.Worksheet worksheet = null; |
||
362 | |||
363 | try |
||
364 | { |
||
365 | // Excel 첫번째 워크시트 가져오기 |
||
366 | application = new Excel.Application(); |
||
367 | workbook = application.Workbooks.Open(dialog.FileName); |
||
368 | worksheet = (Excel.Worksheet)workbook.Worksheets.get_Item("Sheet1"); |
||
369 | |||
370 | // 데이타 넣기 |
||
371 | int h = 9; |
||
372 | int w = 2; |
||
373 | 6c781c0c | djkim | string project_no = App.ViewInfo.ProjectNO; |
374 | worksheet.Cells[2, w + 8] = project_no; |
||
375 | string project_name = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetProjectName(project_no); |
||
376 | worksheet.Cells[3, w + 8] = project_name; |
||
377 | 787a4489 | KangIngu | |
378 | worksheet.Cells[4, w + 8] = (Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.DOCUMENT_NO; |
||
379 | worksheet.Cells[5, w + 8] = (Application.Current.MainWindow as MainWindow).dzMainMenu.userData.NAME + " (" + App.ViewInfo.UserID + ")"; |
||
380 | worksheet.Cells[6, w + 8] = DateTime.Now.ToString("yyyy.MM.dd"); |
||
381 | |||
382 | Excel.Range Range_I = worksheet.Range["K9"]; |
||
383 | Excel.Range Range_O = null; |
||
384 | Excel.Borders border_ = null; |
||
385 | |||
386 | var Rev = Lists.Select(info => info.REVISION).Distinct(); |
||
387 | string[] Cell = { "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T" }; |
||
388 | string[] Range = { "L9", "M9", "N9", "O9", "P9", "Q9", "R9", "S9", "T9", "U9", "V9", "W9", "X9", "Y9", "Z9", "AA9", "AB9", "AC9", "AD9" }; |
||
389 | string Ran = "K"; |
||
390 | |||
391 | for (int i = 0; i < rev_cnt - 1; i++) |
||
392 | { |
||
393 | worksheet.Cells[9, 12 + i] = Cell[i]; |
||
394 | Range_O = worksheet.Range[Range[i]]; |
||
395 | border_ = Range_O.Borders; |
||
396 | border_.LineStyle = Range_I.Borders.LineStyle; |
||
397 | border_.Weight = Range_I.Borders.Weight; |
||
398 | Range_O.Interior.Color = Range_I.Interior.Color; |
||
399 | } |
||
400 | |||
401 | worksheet.Range[worksheet.Cells[8, 11], worksheet.Cells[8, 11 + rev_cnt - 1]].Merge(); |
||
402 | |||
403 | if (rev_cnt != 1) |
||
404 | { |
||
405 | Ran = Range[rev_cnt - 2].Substring(0, Range[rev_cnt - 2].Length - 1); |
||
406 | } |
||
407 | Excel.Range iRange = worksheet.Range["B10:" + Ran + "10"]; |
||
408 | |||
409 | //필터 기능 추가 |
||
410 | Excel.Range Filter_Range = worksheet.Range["B9:" + Ran + "9"]; |
||
411 | Filter_Range.AutoFilter(1, Type.Missing, Excel.XlAutoFilterOperator.xlAnd, Type.Missing, true); |
||
412 | |||
413 | Lists.ForEach(data => |
||
414 | { |
||
415 | h++; |
||
416 | |||
417 | Excel.Range oRange = worksheet.Range["B" + h + ":" + Ran + h]; |
||
418 | oRange.RowHeight = iRange.RowHeight; |
||
419 | Excel.Borders border = oRange.Borders; |
||
420 | border.LineStyle = Excel.XlLineStyle.xlContinuous; |
||
421 | border.Weight = 2d; |
||
422 | |||
423 | if (data.IMAGE_PATH != null) |
||
424 | { |
||
425 | Excel.Range ImageRange = worksheet.Cells[h, w + 2]; |
||
426 | |||
427 | System.Drawing.Image I_Image = byteArrayToImage(data.IMAGE_PATH); |
||
428 | System.Drawing.Image o_Image = Resize(I_Image, 80, 80); |
||
429 | System.Windows.Forms.Clipboard.SetDataObject(o_Image, true); |
||
430 | |||
431 | ImageRange.Cells.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenterAcrossSelection; |
||
432 | ImageRange.Cells.VerticalAlignment = Excel.XlHAlign.xlHAlignCenter; |
||
433 | |||
434 | worksheet.Paste(ImageRange.Cells, "TEST"); |
||
435 | |||
436 | foreach (Microsoft.Office.Interop.Excel.Shape shp in worksheet.Shapes) |
||
437 | { |
||
438 | if (shp.TopLeftCell.Address != ImageRange.Address) |
||
439 | continue; |
||
440 | |||
441 | double Left = shp.TopLeftCell.Left + (shp.TopLeftCell.Width - shp.Width) / 2; |
||
442 | double Top = shp.TopLeftCell.Top + (shp.TopLeftCell.Height - shp.Height) / 2; |
||
443 | |||
444 | shp.Left = float.Parse(Left.ToString()); |
||
445 | shp.Top = float.Parse(Top.ToString()); |
||
446 | |||
447 | break; |
||
448 | } |
||
449 | } |
||
450 | |||
451 | #region Excel Bind |
||
452 | worksheet.Cells[h, w] = data.REVISION; |
||
453 | worksheet.Cells[h, w + 1] = data.PAGENUMBER; |
||
454 | worksheet.Cells[h, w + 3] = data.TODOLIST; |
||
455 | b05da22f | KangIngu | worksheet.Cells[h, w + 4] = data.STATUS.ToUpper() == "TRUE" ? "closed" : "open"; |
456 | 787a4489 | KangIngu | worksheet.Cells[h, w + 5] = data.STATUS_DESC; |
457 | worksheet.Cells[h, w + 6] = data.VENDOR; |
||
458 | worksheet.Cells[h, w + 7] = data.REMARK; |
||
459 | worksheet.Cells[h, w + 8] = data.REPLY; |
||
460 | worksheet.Cells[h, w + 9] = data.REV_0 == null ? "" : data.REV_0.Replace("", " / "); |
||
461 | worksheet.Cells[h, w + 10] = data.REV_1 == null ? "" : data.REV_1.Replace("", " / "); |
||
462 | worksheet.Cells[h, w + 11] = data.REV_2 == null ? "" : data.REV_2.Replace("", " / "); |
||
463 | worksheet.Cells[h, w + 12] = data.REV_3 == null ? "" : data.REV_3.Replace("", " / "); |
||
464 | worksheet.Cells[h, w + 13] = data.REV_4 == null ? "" : data.REV_4.Replace("", " / "); |
||
465 | worksheet.Cells[h, w + 14] = data.REV_5 == null ? "" : data.REV_5.Replace("", " / "); |
||
466 | worksheet.Cells[h, w + 15] = data.REV_6 == null ? "" : data.REV_6.Replace("", " / "); |
||
467 | worksheet.Cells[h, w + 16] = data.REV_7 == null ? "" : data.REV_7.Replace("", " / "); |
||
468 | worksheet.Cells[h, w + 17] = data.REV_8 == null ? "" : data.REV_8.Replace("", " / "); |
||
469 | worksheet.Cells[h, w + 18] = data.REV_9 == null ? "" : data.REV_9.Replace("", " / "); |
||
470 | worksheet.Cells[h, w + 19] = data.REV_10 == null ? "" : data.REV_10.Replace("", " / "); |
||
471 | worksheet.Cells[h, w + 20] = data.REV_11 == null ? "" : data.REV_11.Replace("", " / "); |
||
472 | worksheet.Cells[h, w + 21] = data.REV_12 == null ? "" : data.REV_12.Replace("", " / "); |
||
473 | worksheet.Cells[h, w + 22] = data.REV_13 == null ? "" : data.REV_13.Replace("", " / "); |
||
474 | worksheet.Cells[h, w + 23] = data.REV_14 == null ? "" : data.REV_14.Replace("", " / "); |
||
475 | worksheet.Cells[h, w + 24] = data.REV_15 == null ? "" : data.REV_15.Replace("", " / "); |
||
476 | worksheet.Cells[h, w + 25] = data.REV_16 == null ? "" : data.REV_16.Replace("", " / "); |
||
477 | worksheet.Cells[h, w + 26] = data.REV_17 == null ? "" : data.REV_17.Replace("", " / "); |
||
478 | worksheet.Cells[h, w + 27] = data.REV_18 == null ? "" : data.REV_18.Replace("", " / "); |
||
479 | worksheet.Cells[h, w + 28] = data.REV_19 == null ? "" : data.REV_19.Replace("", " / "); |
||
480 | #endregion |
||
481 | }); |
||
482 | |||
483 | worksheet.Columns.AutoFit(); |
||
484 | // 엑셀파일 저장 |
||
485 | workbook.Save(); |
||
486 | workbook.Close(true); |
||
487 | application.Quit(); |
||
488 | } |
||
489 | finally |
||
490 | { |
||
491 | System.Diagnostics.Process[] ExCel = System.Diagnostics.Process.GetProcessesByName("EXCEL"); |
||
492 | if (ExCel.Count() != 0) |
||
493 | { |
||
494 | ExCel[0].Kill(); |
||
495 | } |
||
496 | |||
497 | // Clean up |
||
498 | ReleaseExcelObject(worksheet); |
||
499 | ReleaseExcelObject(workbook); |
||
500 | ReleaseExcelObject(application); |
||
501 | } |
||
502 | } |
||
503 | DialogMessage_Alert("Success"); |
||
504 | } |
||
505 | |||
506 | this.ExportIndy.IsBusy = false; |
||
507 | } |
||
508 | |||
509 | public System.Drawing.Image byteArrayToImage(byte[] byteArrayIn) |
||
510 | { |
||
511 | using (var ms = new System.IO.MemoryStream(byteArrayIn)) |
||
512 | { |
||
513 | return System.Drawing.Image.FromStream(ms); |
||
514 | } |
||
515 | } |
||
516 | |||
517 | public System.Drawing.Image Resize(System.Drawing.Image image, int newWidth, int maxHeight) |
||
518 | { |
||
519 | //if (onlyResizeIfWider && image.Width <= newWidth) newWidth = image.Width; |
||
520 | |||
521 | var newHeight = image.Height * newWidth / image.Width; |
||
522 | if (newHeight > maxHeight) |
||
523 | { |
||
524 | // Resize with height instead |
||
525 | newWidth = image.Width * maxHeight / image.Height; |
||
526 | newHeight = maxHeight; |
||
527 | } |
||
528 | |||
529 | var res = new System.Drawing.Bitmap(newWidth, newHeight); |
||
530 | |||
531 | using (var graphic = System.Drawing.Graphics.FromImage(res)) |
||
532 | { |
||
533 | graphic.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; |
||
534 | graphic.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; |
||
535 | graphic.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; |
||
536 | graphic.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; |
||
537 | graphic.DrawImage(image, 0, 0, newWidth, newHeight); |
||
538 | } |
||
539 | |||
540 | return res; |
||
541 | } |
||
542 | |||
543 | private static void ReleaseExcelObject(object obj) |
||
544 | { |
||
545 | try |
||
546 | { |
||
547 | if (obj != null) |
||
548 | { |
||
549 | obj = null; |
||
550 | } |
||
551 | } |
||
552 | catch (Exception ex) |
||
553 | { |
||
554 | obj = null; |
||
555 | throw ex; |
||
556 | } |
||
557 | finally |
||
558 | { |
||
559 | GC.Collect(); |
||
560 | } |
||
561 | } |
||
562 | |||
563 | #endregion |
||
564 | |||
565 | #region 이벤트 |
||
566 | |||
567 | void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e) |
||
568 | { |
||
569 | ChangeSize(e.NewSize.Width, e.NewSize.Height); |
||
570 | } |
||
571 | |||
572 | private void CheckList_Loaded(object sender, RoutedEventArgs e) |
||
573 | { |
||
574 | Current_DocNo = (Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.DOCUMENT_NO; |
||
575 | Current_Revision = (Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.REVISION; |
||
576 | Current_Slip = int.Parse((Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.GROUP_NO); |
||
577 | |||
578 | 6c781c0c | djkim | string project_no = App.ViewInfo.ProjectNO; |
579 | 787a4489 | KangIngu | |
580 | 6c781c0c | djkim | List<DOCUMENT_ITEM> list = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetPreRevSelect(project_no, Current_DocNo, Current_Revision); |
581 | foreach (var I in list) |
||
582 | { |
||
583 | if (int.Parse(I.GROUP_NO) < Current_Slip) |
||
584 | 787a4489 | KangIngu | { |
585 | 6c781c0c | djkim | old_Revision = I.REVISION; |
586 | old_DocID = I.DOCUMENT_ID; |
||
587 | return; |
||
588 | 787a4489 | KangIngu | } |
589 | 6c781c0c | djkim | } |
590 | 787a4489 | KangIngu | } |
591 | |||
592 | private void RadGridView_Loaded(object sender, RoutedEventArgs e) |
||
593 | { |
||
594 | DataBind(); |
||
595 | (sender as Telerik.Windows.Controls.RadGridView).ItemsSource = null; |
||
596 | (sender as Telerik.Windows.Controls.RadGridView).ItemsSource = Lists; |
||
597 | |||
598 | ChangeSize(this.ActualWidth, this.ActualHeight); |
||
599 | this.SizeChanged += new SizeChangedEventHandler(MainWindow_SizeChanged); |
||
600 | } |
||
601 | |||
602 | private void AddEvent(object sender, RoutedEventArgs e) |
||
603 | { |
||
604 | Application.Current.MainWindow.Focus(); |
||
605 | |||
606 | Common.ViewerDataModel.Instance.CheckList_ID = KCOM.Events.Save.shortGuid(); |
||
607 | Common.ViewerDataModel.Instance.Capture_Opacity = 0.5; |
||
608 | (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture; |
||
609 | } |
||
610 | |||
611 | private void SaveEvent(object sender, RoutedEventArgs e) |
||
612 | { |
||
613 | CHECK_LIST Check_value = new CHECK_LIST(); |
||
614 | CHECK_LIST_HISTORY Check_History = new CHECK_LIST_HISTORY(); |
||
615 | |||
616 | 6c781c0c | djkim | foreach (var item in tb.Items) |
617 | 787a4489 | KangIngu | { |
618 | 6c781c0c | djkim | string Check_ID = (item as Customer).ID.ToString(); |
619 | string state = ""; |
||
620 | |||
621 | Check_value = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetCheckList(App.ViewInfo.ProjectNO, Check_ID); |
||
622 | |||
623 | if (Check_value != null) |
||
624 | 787a4489 | KangIngu | { |
625 | 6c781c0c | djkim | if ((item as Customer).STATUS.ToUpper() == "TRUE") |
626 | { |
||
627 | state = "Closed"; |
||
628 | Check_value.STATUS_DESC_CLOSE = (item as Customer).STATUS_DESC; |
||
629 | } |
||
630 | else |
||
631 | { |
||
632 | state = "Open"; |
||
633 | Check_value.STATUS_DESC_OPEN = (item as Customer).STATUS_DESC; |
||
634 | } |
||
635 | 787a4489 | KangIngu | |
636 | 6c781c0c | djkim | string Rev = state + "" + DateTime.Now.ToString("yyyy.MM.dd"); |
637 | string description = ""; |
||
638 | 787a4489 | KangIngu | |
639 | 6c781c0c | djkim | if (char.Parse(ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision) >= char.Parse(Check_value.REVISION)) |
640 | 787a4489 | KangIngu | { |
641 | 6c781c0c | djkim | Check_value.REMARK = (item as Customer).REMARK; |
642 | Check_value.STATUS = (item as Customer).STATUS; |
||
643 | Check_value.TODOLIST = (item as Customer).TODOLIST; |
||
644 | Check_value.VENDOR = (item as Customer).VENDOR; |
||
645 | Check_value.REPLY = (item as Customer).REPLY; |
||
646 | |||
647 | if (state == "Open") |
||
648 | description = Check_value.STATUS_DESC_OPEN; |
||
649 | 787a4489 | KangIngu | else |
650 | 6c781c0c | djkim | description = Check_value.STATUS_DESC_CLOSE; |
651 | 787a4489 | KangIngu | |
652 | 6c781c0c | djkim | var history = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetCheckListHistory(App.ViewInfo.ProjectNO, Check_ID); |
653 | |||
654 | Check_History = history.Where(info => info.REVISION == ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision).FirstOrDefault(); |
||
655 | 787a4489 | KangIngu | |
656 | 6c781c0c | djkim | List<string> validation = new List<string>(); |
657 | 787a4489 | KangIngu | |
658 | 6c781c0c | djkim | foreach (var his in history) |
659 | { |
||
660 | if (his.TODOLIST == Check_value.TODOLIST) |
||
661 | validation.Add("TODOLIST"); |
||
662 | if (his.STATUS_DESC == description) |
||
663 | validation.Add("STATUS_DESC"); |
||
664 | if (his.VENDOR == Check_value.VENDOR) |
||
665 | validation.Add("VENDOR"); |
||
666 | if (his.REMARK == Check_value.REMARK) |
||
667 | validation.Add("REMARK"); |
||
668 | if (his.REPLY == Check_value.REPLY) |
||
669 | validation.Add("REPLY"); |
||
670 | } |
||
671 | 787a4489 | KangIngu | |
672 | 6c781c0c | djkim | if (validation.Count < 5) |
673 | { |
||
674 | if (Check_History == null) |
||
675 | 787a4489 | KangIngu | { |
676 | 6c781c0c | djkim | Check_History = new CHECK_LIST_HISTORY() |
677 | { |
||
678 | ID = Events.Save.shortGuid(), |
||
679 | CHECKLIST_ID = Check_ID, |
||
680 | REVISION = ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision, |
||
681 | STATUS = state, |
||
682 | IMAGE_URL = Check_value.IMAGE_URL, |
||
683 | STATUS_DESC = validation.Where(i => i.ToString() == "STATUS_DESC").FirstOrDefault() == null ? description : "", |
||
684 | TODOLIST = validation.Where(i => i.ToString() == "TODOLIST").FirstOrDefault() == null ? Check_value.TODOLIST : "", |
||
685 | VENDOR = validation.Where(i => i.ToString() == "VENDOR").FirstOrDefault() == null ? Check_value.VENDOR : "", |
||
686 | REMARK = validation.Where(i => i.ToString() == "REMARK").FirstOrDefault() == null ? Check_value.REMARK : "", |
||
687 | REPLY = validation.Where(i => i.ToString() == "REPLY").FirstOrDefault() == null ? Check_value.REPLY : "", |
||
688 | CREATE_TIME = DateTime.Now, |
||
689 | UPDATE_TIME = DateTime.Now |
||
690 | }; |
||
691 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddCheckListHistory(App.ViewInfo.ProjectNO, Check_History); |
||
692 | |||
693 | Check_value.REVISION = Current_Revision; |
||
694 | 787a4489 | KangIngu | } |
695 | 6c781c0c | djkim | else |
696 | 787a4489 | KangIngu | { |
697 | 6c781c0c | djkim | Check_History.IMAGE_URL = Check_value.IMAGE_URL; |
698 | Check_History.STATUS = state; |
||
699 | Check_History.TODOLIST = Check_value.TODOLIST; |
||
700 | Check_History.VENDOR = Check_value.VENDOR; |
||
701 | Check_History.REMARK = Check_value.REMARK; |
||
702 | Check_History.REPLY = Check_value.REPLY; |
||
703 | Check_History.UPDATE_TIME = DateTime.Now; |
||
704 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveCheckListHistory(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision, Check_History); |
||
705 | 787a4489 | KangIngu | } |
706 | } |
||
707 | 6c781c0c | djkim | validation = new List<string>(); |
708 | 787a4489 | KangIngu | } |
709 | } |
||
710 | 6c781c0c | djkim | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveCheckList(App.ViewInfo.ProjectNO, Check_ID, Check_value); |
711 | 787a4489 | KangIngu | } |
712 | 6c781c0c | djkim | |
713 | DataBind(); |
||
714 | tb.ItemsSource = null; |
||
715 | tb.ItemsSource = Lists; |
||
716 | History_Set(); |
||
717 | |||
718 | DialogMessage_Alert("Success"); |
||
719 | 787a4489 | KangIngu | } |
720 | |||
721 | private void CheckListEvent(object sender, RoutedEventArgs e) |
||
722 | { |
||
723 | if (col1.Width == new GridLength(1200)) |
||
724 | { |
||
725 | this.Width += 600; |
||
726 | col1.Width = new GridLength(1800); |
||
727 | } |
||
728 | else |
||
729 | { |
||
730 | this.Width -= 600; |
||
731 | col1.Width = new GridLength(1200); |
||
732 | } |
||
733 | History_Set(); |
||
734 | } |
||
735 | |||
736 | private void CommentMoveEvent(object sender, MouseButtonEventArgs e) |
||
737 | { |
||
738 | SyncInit(); |
||
739 | |||
740 | Rect rect = new Rect(); |
||
741 | string[] RectPoint = ((e.Source as Image).DataContext as Customer).IMAGE_ANCHOR.Split(','); |
||
742 | //string[] RectPoint = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).IMAGE_ANCHOR.Split(','); |
||
743 | |||
744 | 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]))); |
||
745 | |||
746 | //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).PAGENUMBER); |
||
747 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Image).DataContext as Customer).PAGENUMBER); |
||
748 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.ZoomTo(rect); |
||
749 | Application.Current.MainWindow.Focus(); |
||
750 | } |
||
751 | |||
752 | private void CaptureEvent(object sender, MouseButtonEventArgs e) |
||
753 | { |
||
754 | SyncInit(); |
||
755 | |||
756 | //캡쳐 하기 전에 코멘트 저장 |
||
757 | if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (Application.Current.MainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0) |
||
758 | { |
||
759 | var menu = (Application.Current.MainWindow as MainWindow).dzMainMenu; |
||
760 | menu.ReleaseAdorner(); |
||
761 | if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
||
762 | { |
||
763 | (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
||
764 | } |
||
765 | else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID) |
||
766 | { |
||
767 | |||
768 | } |
||
769 | else |
||
770 | { |
||
771 | (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
||
772 | } |
||
773 | } |
||
774 | |||
775 | //Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).ID; |
||
776 | Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Image).DataContext as Customer).ID; |
||
777 | Application.Current.MainWindow.Focus(); |
||
778 | Common.ViewerDataModel.Instance.Capture_Opacity = 0.49; |
||
779 | (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture; |
||
780 | } |
||
781 | |||
782 | public void KeyEventDownAction(object sender, KeyEventArgs e) |
||
783 | { |
||
784 | switch (e.Key) |
||
785 | { |
||
786 | case Key.Escape: |
||
787 | { |
||
788 | (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
789 | Common.ViewerDataModel.Instance.Capture_Opacity = 0; |
||
790 | } |
||
791 | break; |
||
792 | } |
||
793 | } |
||
794 | |||
795 | private void tb_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) |
||
796 | { |
||
797 | if(ViewerDataModel.Instance.Capture_Opacity == 0) |
||
798 | return; |
||
799 | |||
800 | DataBind(); |
||
801 | tb.ItemsSource = null; |
||
802 | tb.ItemsSource = Lists.OrderBy(info => info.CREATE_TIME); |
||
803 | //tb1.ItemsSource = Lists.OrderBy(info => info.CREATE_TIME); |
||
804 | |||
805 | if (ViewerDataModel.Instance.Capture_Opacity == 0.5) |
||
806 | { |
||
807 | tb.SortDescriptors.Clear(); |
||
808 | tb.FilterDescriptors.Clear(); |
||
809 | |||
810 | var scrollViewer = this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault(); |
||
811 | if (scrollViewer != null) |
||
812 | { |
||
813 | //this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset(this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ExtentHeight); |
||
814 | //this.tb1.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset(this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ExtentHeight); |
||
815 | |||
816 | tb.ScrollIndexIntoView(tb.Items.Count - 1); |
||
817 | tb.CurrentCellInfo = new GridViewCellInfo(tb.Items[tb.Items.Count - 1], tb.Columns["TODOLIST"]); |
||
818 | tb.Focus(); |
||
819 | |||
820 | } |
||
821 | } |
||
822 | } |
||
823 | |||
824 | private void Radio_Open_Checked(object sender, RoutedEventArgs e) |
||
825 | { |
||
826 | (e.Source as RadioButton).Foreground = Brushes.Red; |
||
827 | (e.Source as RadioButton).FontWeight = FontWeights.Bold; |
||
828 | |||
829 | if ((((e.OriginalSource as RadioButton).Parent as StackPanel).Parent as GridViewCell).ParentRow.Item != null) |
||
830 | { |
||
831 | ((((e.OriginalSource as RadioButton).Parent as StackPanel).Parent as GridViewCell).ParentRow.Item as Customer)._STATUS = "Open"; |
||
832 | } |
||
833 | |||
834 | if (Isinit) |
||
835 | { |
||
836 | Isinit = false; |
||
837 | if ((e.Source as RadioButton).DataContext != null) |
||
838 | { |
||
839 | if (((e.Source as RadioButton).DataContext as Customer).STATUS_DESC != "Vendor 반영 필요") |
||
840 | { |
||
841 | ((e.Source as RadioButton).DataContext as Customer).STATUS_DESC = "Vendor 반영 필요"; |
||
842 | |||
843 | tb.Rebind(); |
||
844 | } |
||
845 | } |
||
846 | } |
||
847 | } |
||
848 | |||
849 | private void Radio_Close_Checked(object sender, RoutedEventArgs e) |
||
850 | { |
||
851 | 69ef0800 | KangIngu | if (Isinit) |
852 | { |
||
853 | if (!isCheck_Status) |
||
854 | { |
||
855 | Select_StatusID = ((e.Source as RadioButton).DataContext as Customer).ID; |
||
856 | |||
857 | isCheck_Status = true; |
||
858 | |||
859 | RadWindow CheckPop = new RadWindow(); |
||
860 | |||
861 | CheckList_Status check = new CheckList_Status(); |
||
862 | |||
863 | CheckPop = new RadWindow |
||
864 | { |
||
865 | MinWidth = 350, |
||
866 | MinHeight = 150, |
||
867 | Header = "Status Description을 입력하세요", |
||
868 | Content = check, |
||
869 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
870 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
871 | IsTopmost = true, |
||
872 | }; |
||
873 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
874 | CheckPop.Closed += CheckPop_Closed; |
||
875 | CheckPop.Show(); |
||
876 | |||
877 | Isinit = false; |
||
878 | tb.Rebind(); |
||
879 | } |
||
880 | } |
||
881 | 787a4489 | KangIngu | |
882 | (e.Source as RadioButton).FontWeight = FontWeights.Bold; |
||
883 | |||
884 | if ((((e.OriginalSource as RadioButton).Parent as StackPanel).Parent as GridViewCell).ParentRow.Item != null) |
||
885 | { |
||
886 | ((((e.OriginalSource as RadioButton).Parent as StackPanel).Parent as GridViewCell).ParentRow.Item as Customer)._STATUS = "Close"; |
||
887 | } |
||
888 | 69ef0800 | KangIngu | } |
889 | 787a4489 | KangIngu | |
890 | 69ef0800 | KangIngu | private void CheckPop_Closed(object sender, WindowClosedEventArgs e) |
891 | { |
||
892 | isCheck_Status = false; |
||
893 | |||
894 | foreach(var item in tb.Items) |
||
895 | 787a4489 | KangIngu | { |
896 | 69ef0800 | KangIngu | if(Select_StatusID == (item as Customer).ID.ToString()) |
897 | 787a4489 | KangIngu | { |
898 | 69ef0800 | KangIngu | if (ViewerDataModel.Instance.CheckStatus != "" && ViewerDataModel.Instance.CheckStatus != null) |
899 | 787a4489 | KangIngu | { |
900 | 69ef0800 | KangIngu | (item as Customer).STATUS_DESC = ViewerDataModel.Instance.CheckStatus; |
901 | } |
||
902 | else |
||
903 | { |
||
904 | (item as Customer).STATUS = "False"; |
||
905 | (item as Customer)._STATUS = "Open"; |
||
906 | (item as Customer).STATUS_ = "True"; |
||
907 | 787a4489 | KangIngu | } |
908 | 69ef0800 | KangIngu | |
909 | ViewerDataModel.Instance.CheckStatus = ""; |
||
910 | Select_StatusID = ""; |
||
911 | tb.Rebind(); |
||
912 | return; |
||
913 | 787a4489 | KangIngu | } |
914 | } |
||
915 | 69ef0800 | KangIngu | |
916 | 787a4489 | KangIngu | } |
917 | |||
918 | private void Radio_Unchecked(object sender, RoutedEventArgs e) |
||
919 | { |
||
920 | (e.Source as RadioButton).Foreground = Brushes.Black; |
||
921 | (e.Source as RadioButton).FontWeight = FontWeights.Normal; |
||
922 | } |
||
923 | |||
924 | private void mousedownOnImage(object sender, MouseButtonEventArgs args) |
||
925 | { |
||
926 | if(args.OriginalSource as TextBlock != null && (args.OriginalSource as TextBlock).Parent != null) |
||
927 | { |
||
928 | if((args.OriginalSource as TextBlock).Parent.GetType().Name == "GridViewHeaderCell") |
||
929 | { |
||
930 | Isinit = false; |
||
931 | return; |
||
932 | } |
||
933 | } |
||
934 | |||
935 | Isinit = true; |
||
936 | |||
937 | RadWindow CheckPop = new RadWindow(); |
||
938 | |||
939 | if (args.OriginalSource is Image) |
||
940 | { |
||
941 | Image img = (args.OriginalSource as Image); |
||
942 | if (img.Height != 45) |
||
943 | return; |
||
944 | |||
945 | CommantImage check = new CommantImage(img); |
||
946 | |||
947 | CheckPop = new RadWindow |
||
948 | { |
||
949 | MinWidth = 500, |
||
950 | MinHeight = 500, |
||
951 | Header = "Image", |
||
952 | Content = check, |
||
953 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
954 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
955 | IsTopmost = true, |
||
956 | }; |
||
957 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
958 | CheckPop.Show(); |
||
959 | } |
||
960 | |||
961 | if (args.OriginalSource as TextBlock == null || (args.OriginalSource as TextBlock).Parent == null || ((args.OriginalSource as TextBlock).Parent) as GridViewCell == null) |
||
962 | { |
||
963 | return; |
||
964 | } |
||
965 | |||
966 | if ((((args.OriginalSource as TextBlock).Parent) as GridViewCell).DataColumn.ColumnGroupName.ToString() == "History") |
||
967 | { |
||
968 | |||
969 | 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()); |
||
970 | |||
971 | CheckPop = new RadWindow |
||
972 | { |
||
973 | MinWidth = 800, |
||
974 | MinHeight = 400, |
||
975 | Header = "Detail", |
||
976 | Content = Detail, |
||
977 | //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
||
978 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
979 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
980 | IsTopmost = true, |
||
981 | }; |
||
982 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
983 | //CheckPop.ShowDialog(); |
||
984 | CheckPop.Show(); |
||
985 | } |
||
986 | |||
987 | } |
||
988 | |||
989 | private void SyncEvent(object sender, MouseButtonEventArgs e) |
||
990 | { |
||
991 | 6c781c0c | djkim | var _vpList = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetVPRevisionFirstOrDefault(App.ViewInfo.ProjectNO, old_DocID); |
992 | 787a4489 | KangIngu | |
993 | 6c781c0c | djkim | if (old_DocID == "") |
994 | 787a4489 | KangIngu | { |
995 | 6c781c0c | djkim | DialogMessage_Alert("상위 리비전이 없습니다."); |
996 | return; |
||
997 | 787a4489 | KangIngu | } |
998 | 6c781c0c | djkim | |
999 | SyncInit(); |
||
1000 | Rect rect = new Rect(); |
||
1001 | string[] RectPoint = ((e.Source as Image).DataContext as Customer).IMAGE_ANCHOR.Split(','); |
||
1002 | 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]))); |
||
1003 | ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Image).DataContext as Customer).PAGENUMBER); |
||
1004 | ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.Sync_ZoomTo(rect); |
||
1005 | (Application.Current.MainWindow as MainWindow).dzMainMenu.Sync_Event(_vpList); |
||
1006 | |||
1007 | 787a4489 | KangIngu | } |
1008 | |||
1009 | #endregion |
||
1010 | } |
||
1011 | } |