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