markus / KCOM / Controls / CheckList.xaml.cs.bak @ 122914ba
이력 | 보기 | 이력해설 | 다운로드 (26.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 | |||
25 | namespace KCOM.Controls |
||
26 | { |
||
27 | public class Customer |
||
28 | { |
||
29 | public string ID |
||
30 | { |
||
31 | get; |
||
32 | set; |
||
33 | } |
||
34 | public string DOCUMENT_ID |
||
35 | { |
||
36 | get; |
||
37 | set; |
||
38 | } |
||
39 | public string USER_ID |
||
40 | { |
||
41 | get; |
||
42 | set; |
||
43 | } |
||
44 | public string REVISION |
||
45 | { |
||
46 | get; |
||
47 | set; |
||
48 | } |
||
49 | public int PAGENUMBER |
||
50 | { |
||
51 | get; |
||
52 | set; |
||
53 | } |
||
54 | public string TODOLIST |
||
55 | { |
||
56 | get; |
||
57 | set; |
||
58 | } |
||
59 | public string IMAGE_URL |
||
60 | { |
||
61 | get; |
||
62 | set; |
||
63 | } |
||
64 | public string STATUS |
||
65 | { |
||
66 | get; |
||
67 | set; |
||
68 | } |
||
69 | public string STATUS_ |
||
70 | { |
||
71 | get; |
||
72 | set; |
||
73 | } |
||
74 | public string VENDOR |
||
75 | { |
||
76 | get; |
||
77 | set; |
||
78 | } |
||
79 | public string REMARK |
||
80 | { |
||
81 | get; |
||
82 | set; |
||
83 | } |
||
84 | public string PROJECT_NO |
||
85 | { |
||
86 | get; |
||
87 | set; |
||
88 | } |
||
89 | public string REV_4 |
||
90 | { |
||
91 | get; |
||
92 | set; |
||
93 | } |
||
94 | public string REV_3 |
||
95 | { |
||
96 | get; |
||
97 | set; |
||
98 | } |
||
99 | public string REV_2 |
||
100 | { |
||
101 | get; |
||
102 | set; |
||
103 | } |
||
104 | public string REV_1 |
||
105 | { |
||
106 | get; |
||
107 | set; |
||
108 | } |
||
109 | public string REV_0 |
||
110 | { |
||
111 | get; |
||
112 | set; |
||
113 | } |
||
114 | public string IMAGE_ANCHOR |
||
115 | { |
||
116 | get; |
||
117 | set; |
||
118 | } |
||
119 | public byte[] IMAGE_PATH |
||
120 | { |
||
121 | get; |
||
122 | set; |
||
123 | } |
||
124 | public string STATUS_DESC |
||
125 | { |
||
126 | get; |
||
127 | set; |
||
128 | } |
||
129 | public string REPLY |
||
130 | { |
||
131 | get; |
||
132 | set; |
||
133 | } |
||
134 | } |
||
135 | |||
136 | /// <summary> |
||
137 | /// Interaction logic for CheckList.xaml |
||
138 | /// </summary> |
||
139 | public partial class CheckList : UserControl |
||
140 | { |
||
141 | #region 프로퍼티 |
||
142 | List<CHECK_LIST> items = new List<CHECK_LIST>(); |
||
143 | List<Customer> Lists = new List<Customer>(); |
||
144 | string old_Revision = ""; |
||
145 | string old_DocID = ""; |
||
146 | string Current_Revision = ""; |
||
147 | string Current_DocNo = ""; |
||
148 | int Current_Slip = 0; |
||
149 | double back_value = 0; |
||
150 | #endregion |
||
151 | |||
152 | #region 생성자 |
||
153 | public CheckList() |
||
154 | { |
||
155 | Common.ViewerDataModel.Instance.ViewVisible = Visibility.Visible; |
||
156 | InitializeComponent(); |
||
157 | this.Loaded += CheckList_Loaded; |
||
158 | this.KeyDown += new KeyEventHandler(KeyEventDownAction); |
||
159 | this.AddHandler(Image.MouseLeftButtonDownEvent, new MouseButtonEventHandler(mousedownOnImage), true); |
||
160 | } |
||
161 | #endregion |
||
162 | |||
163 | public void DataBind() |
||
164 | { |
||
165 | Lists = new List<Customer>(); |
||
166 | string doc_no = (Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.DOCUMENT_NO; |
||
167 | using (CIEntities Entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString())) |
||
168 | { |
||
169 | items = Entity.CHECK_LIST.Where(i => i.PROJECT_NO == App.ViewInfo.ProjectNO && i.DOCUMENT_NO == doc_no && i.USER_ID == App.ViewInfo.UserID).OrderBy(p => p.CREATE_TIME).ToList(); |
||
170 | |||
171 | if (items.Where(i => i.REV_1 != null).FirstOrDefault() == null) |
||
172 | { |
||
173 | REV_1.IsVisible = false; |
||
174 | } |
||
175 | if (items.Where(i => i.REV_2 != null).FirstOrDefault() == null) |
||
176 | { |
||
177 | REV_2.IsVisible = false; |
||
178 | } |
||
179 | if (items.Where(i => i.REV_3 != null).FirstOrDefault() == null) |
||
180 | { |
||
181 | REV_3.IsVisible = false; |
||
182 | } |
||
183 | if (items.Where(i => i.REV_4 != null).FirstOrDefault() == null) |
||
184 | { |
||
185 | REV_4.IsVisible = false; |
||
186 | } |
||
187 | |||
188 | |||
189 | if (Lists.Count == 0) |
||
190 | { |
||
191 | foreach (var item in items) |
||
192 | { |
||
193 | Customer customer = new Customer(); |
||
194 | customer.ID = item.ID; |
||
195 | customer.IMAGE_ANCHOR = item.IMAGE_ANCHOR; |
||
196 | if (item.IMAGE_URL != null && item.IMAGE_URL != "") |
||
197 | customer.IMAGE_PATH = Convert.FromBase64String(item.IMAGE_URL); |
||
198 | customer.PAGENUMBER = item.PAGENUMBER; |
||
199 | customer.PROJECT_NO = item.PROJECT_NO; |
||
200 | customer.REMARK = item.REMARK; |
||
201 | customer.REVISION = item.REVISION; |
||
202 | customer.REV_0 = item.REV_0; |
||
203 | customer.REV_1 = item.REV_1; |
||
204 | customer.REV_2 = item.REV_2; |
||
205 | customer.REV_3 = item.REV_3; |
||
206 | customer.REV_4 = item.REV_4; |
||
207 | customer.STATUS = item.STATUS; |
||
208 | //customer.STATUS_DESC = item.st |
||
209 | customer.REPLY = item.REPLY; |
||
210 | customer.TODOLIST = item.TODOLIST; |
||
211 | customer.USER_ID = item.USER_ID; |
||
212 | customer.VENDOR = item.VENDOR; |
||
213 | customer.DOCUMENT_ID = item.DOCUMENT_ID; |
||
214 | |||
215 | if (item.STATUS == "True") |
||
216 | { |
||
217 | customer.STATUS_ = "False"; |
||
218 | customer.STATUS_DESC = item.STATUS_DESC_CLOSE; |
||
219 | } |
||
220 | else |
||
221 | { |
||
222 | customer.STATUS_ = "True"; |
||
223 | customer.STATUS_DESC = item.STATUS_DESC_OPEN; |
||
224 | } |
||
225 | |||
226 | |||
227 | Lists.Add(customer); |
||
228 | } |
||
229 | } |
||
230 | } |
||
231 | } |
||
232 | |||
233 | public void ListBind() |
||
234 | { |
||
235 | |||
236 | } |
||
237 | |||
238 | private void ChangeSize(double width, double height) |
||
239 | { |
||
240 | this.Width = width; |
||
241 | this.Height = height; |
||
242 | } |
||
243 | |||
244 | private void SyncInit() |
||
245 | { |
||
246 | if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden) |
||
247 | { |
||
248 | ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden = true; |
||
249 | ViewerDataModel.Instance.PageBalanceMode = false; |
||
250 | ViewerDataModel.Instance.PageBalanceNumber = 0; |
||
251 | ViewerDataModel.Instance.PageNumber = 0; |
||
252 | ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
||
253 | ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewRevMarkup.Visibility = Visibility.Collapsed; |
||
254 | ViewerDataModel.Instance.SystemMain.dzMainMenu.UserList.IsChecked = false; |
||
255 | ViewerDataModel.Instance.SystemMain.dzMainMenu.BalanceMode.IsChecked = false; |
||
256 | } |
||
257 | } |
||
258 | |||
259 | #region 이벤트 |
||
260 | |||
261 | void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e) |
||
262 | { |
||
263 | ChangeSize(e.NewSize.Width, e.NewSize.Height); |
||
264 | } |
||
265 | |||
266 | private void CheckList_Loaded(object sender, RoutedEventArgs e) |
||
267 | { |
||
268 | Current_DocNo = (Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.DOCUMENT_NO; |
||
269 | Current_Revision = (Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.REVISION; |
||
270 | Current_Slip = int.Parse((Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.GROUP_NO); |
||
271 | |||
272 | col2.Width = new GridLength(0); |
||
273 | var scrollViewer = this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault(); |
||
274 | |||
275 | if (scrollViewer != null) |
||
276 | { |
||
277 | scrollViewer.ScrollChanged += this.Tb1_ScrollEvent; |
||
278 | } |
||
279 | |||
280 | var scrollViewer_1 = this.tb1.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault(); |
||
281 | if (scrollViewer_1 != null) |
||
282 | { |
||
283 | scrollViewer_1.ScrollChanged += this.Tb2_ScrollEvent; |
||
284 | } |
||
285 | |||
286 | using (CIEntities Entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString())) |
||
287 | { |
||
288 | var Gaby = Entity.DOCUMENT_ITEM.Where(i => i.PROJECT_NO == App.ViewInfo.ProjectNO |
||
289 | && i.DOCUMENT_NO == Current_DocNo |
||
290 | && i.REVISION != Current_Revision).OrderByDescending(i => i.GROUP_NO); |
||
291 | |||
292 | foreach (var I in Gaby) |
||
293 | { |
||
294 | if (int.Parse(I.GROUP_NO) < Current_Slip) |
||
295 | { |
||
296 | old_Revision = I.REVISION; |
||
297 | old_DocID = I.DOCUMENT_ID; |
||
298 | return; |
||
299 | } |
||
300 | } |
||
301 | } |
||
302 | } |
||
303 | |||
304 | private void Tb1_ScrollEvent(object sender, ScrollChangedEventArgs e) |
||
305 | { |
||
306 | if ((e.Source as GridViewScrollViewer) == null) |
||
307 | return; |
||
308 | |||
309 | this.tb1.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset((e.Source as GridViewScrollViewer).VerticalOffset); |
||
310 | } |
||
311 | |||
312 | private void Tb2_ScrollEvent(object sender, ScrollChangedEventArgs e) |
||
313 | { |
||
314 | if ((e.Source as GridViewScrollViewer) == null) |
||
315 | return; |
||
316 | |||
317 | this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset((e.Source as GridViewScrollViewer).VerticalOffset); |
||
318 | } |
||
319 | |||
320 | private void RadGridView_Loaded(object sender, RoutedEventArgs e) |
||
321 | { |
||
322 | DataBind(); |
||
323 | (sender as Telerik.Windows.Controls.RadGridView).ItemsSource = null; |
||
324 | (sender as Telerik.Windows.Controls.RadGridView).ItemsSource = Lists; |
||
325 | |||
326 | ChangeSize(this.ActualWidth, this.ActualHeight); |
||
327 | this.SizeChanged += new SizeChangedEventHandler(MainWindow_SizeChanged); |
||
328 | } |
||
329 | |||
330 | private void RadGridView1_Loaded(object sender, RoutedEventArgs e) |
||
331 | { |
||
332 | (sender as Telerik.Windows.Controls.RadGridView).ItemsSource = Lists; |
||
333 | } |
||
334 | |||
335 | private void ExportEvent(object sender, RoutedEventArgs e) |
||
336 | { |
||
337 | string extension = "xlsx"; |
||
338 | Uri url = new Uri("http://cloud.devdoftech.co.kr:5977/TileSource/Check_Test/CheckList.xlsx"); |
||
339 | |||
340 | System.Windows.Forms.SaveFileDialog dialog = new System.Windows.Forms.SaveFileDialog() |
||
341 | { |
||
342 | DefaultExt = extension, |
||
343 | Filter = String.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", extension, "Excel"), |
||
344 | FilterIndex = 1 |
||
345 | }; |
||
346 | |||
347 | if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) |
||
348 | { |
||
349 | using (var client = new System.Net.WebClient()) |
||
350 | { |
||
351 | client.DownloadFile(url, dialog.FileName); |
||
352 | } |
||
353 | System.Windows.MessageBox.Show("Success"); |
||
354 | } |
||
355 | |||
356 | } |
||
357 | |||
358 | private void AddEvent(object sender, RoutedEventArgs e) |
||
359 | { |
||
360 | //tb.Items.AddNewItem(DefaultItem); |
||
361 | //tb1.Items.AddNewItem(DefaultItem); |
||
362 | //this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset(this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ExtentHeight); |
||
363 | //this.tb1.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset(this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ExtentHeight); |
||
364 | |||
365 | |||
366 | |||
367 | //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).PAGENUMBER); |
||
368 | //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.PN_Navi.IsEnabled = false; |
||
369 | Application.Current.MainWindow.Focus(); |
||
370 | |||
371 | Common.ViewerDataModel.Instance.CheckList_ID = KCOM.Events.Save.shortGuid(); |
||
372 | Common.ViewerDataModel.Instance.Capture_Opacity = 0.5; |
||
373 | (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture; |
||
374 | |||
375 | } |
||
376 | |||
377 | private void SaveEvent(object sender, RoutedEventArgs e) |
||
378 | { |
||
379 | CHECK_LIST Check_value = new CHECK_LIST(); |
||
380 | |||
381 | using (CIEntities Entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString())) |
||
382 | { |
||
383 | foreach (var item in tb.Items) |
||
384 | { |
||
385 | string Check_ID = (item as Customer).ID.ToString(); |
||
386 | string state = ""; |
||
387 | //Check_value = (from info in Entity.CHECK_LIST |
||
388 | // where info.ID == Check_ID |
||
389 | // select info).FirstOrDefault(); |
||
390 | |||
391 | Check_value = Entity.CHECK_LIST.Where(info => info.ID == Check_ID).FirstOrDefault(); |
||
392 | |||
393 | if (Check_value != null) |
||
394 | { |
||
395 | if ((item as Customer).STATUS.ToUpper() == "TRUE") |
||
396 | { |
||
397 | state = "Closed"; |
||
398 | Check_value.STATUS_DESC_CLOSE = (item as Customer).STATUS_DESC; |
||
399 | } |
||
400 | else |
||
401 | { |
||
402 | state = "Open"; |
||
403 | Check_value.STATUS_DESC_OPEN = (item as Customer).STATUS_DESC; |
||
404 | } |
||
405 | |||
406 | string Rev = state + "" + DateTime.Now.ToString("yyyy.MM.dd"); |
||
407 | |||
408 | switch (Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision) |
||
409 | { |
||
410 | case ("A"): |
||
411 | { |
||
412 | if (Check_value.REV_0 == null || !Check_value.REV_0.Contains(state)) |
||
413 | { |
||
414 | Check_value.REV_0 = Rev; |
||
415 | (item as Customer).REV_0 = Rev; |
||
416 | } |
||
417 | } |
||
418 | break; |
||
419 | case ("B"): |
||
420 | { |
||
421 | if (Check_value.REV_1 == null || !Check_value.REV_1.Contains(state)) |
||
422 | { |
||
423 | Check_value.REV_1 = Rev; |
||
424 | (item as Customer).REV_1 = Rev; |
||
425 | } |
||
426 | } |
||
427 | break; |
||
428 | case ("C"): |
||
429 | { |
||
430 | if (Check_value.REV_2 == null || !Check_value.REV_2.Contains(state)) |
||
431 | { |
||
432 | Check_value.REV_2 = Rev; |
||
433 | (item as Customer).REV_2 = Rev; |
||
434 | } |
||
435 | } |
||
436 | break; |
||
437 | case ("D"): |
||
438 | { |
||
439 | if (Check_value.REV_3 == null || !Check_value.REV_3.Contains(state)) |
||
440 | { |
||
441 | Check_value.REV_3 = Rev; |
||
442 | (item as Customer).REV_3 = Rev; |
||
443 | } |
||
444 | } |
||
445 | break; |
||
446 | case ("E"): |
||
447 | { |
||
448 | if (Check_value.REV_4 == null || !Check_value.REV_4.Contains(state)) |
||
449 | { |
||
450 | Check_value.REV_4 = Rev; |
||
451 | (item as Customer).REV_4 = Rev; |
||
452 | } |
||
453 | } |
||
454 | break; |
||
455 | } |
||
456 | |||
457 | Check_value.REMARK = (item as Customer).REMARK; |
||
458 | Check_value.STATUS = (item as Customer).STATUS; |
||
459 | Check_value.TODOLIST = (item as Customer).TODOLIST; |
||
460 | Check_value.VENDOR = (item as Customer).VENDOR; |
||
461 | Check_value.REPLY = (item as Customer).REPLY; |
||
462 | |||
463 | tb1.ItemsSource = null; |
||
464 | tb1.ItemsSource = tb.ItemsSource; |
||
465 | |||
466 | |||
467 | } |
||
468 | |||
469 | Entity.SaveChanges(); |
||
470 | } |
||
471 | MessageBox.Show("Success"); |
||
472 | } |
||
473 | } |
||
474 | |||
475 | private void CheckListEvent(object sender, RoutedEventArgs e) |
||
476 | { |
||
477 | if (col2.Width == new GridLength(0)) |
||
478 | { |
||
479 | this.Width += 600; |
||
480 | col2.Width = new GridLength(600); |
||
481 | } |
||
482 | else |
||
483 | { |
||
484 | this.Width -= 600; |
||
485 | col2.Width = new GridLength(0); |
||
486 | } |
||
487 | } |
||
488 | |||
489 | private void CommentMoveEvent(object sender, MouseButtonEventArgs e) |
||
490 | { |
||
491 | SyncInit(); |
||
492 | |||
493 | Rect rect = new Rect(); |
||
494 | string[] RectPoint = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).IMAGE_ANCHOR.Split(','); |
||
495 | |||
496 | 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]))); |
||
497 | |||
498 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).PAGENUMBER); |
||
499 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.ZoomTo(rect); |
||
500 | Application.Current.MainWindow.Focus(); |
||
501 | } |
||
502 | |||
503 | private void CaptureEvent(object sender, MouseButtonEventArgs e) |
||
504 | { |
||
505 | SyncInit(); |
||
506 | |||
507 | //캡쳐 하기 전에 코멘트 저장 |
||
508 | if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (Application.Current.MainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0) |
||
509 | { |
||
510 | var menu = (Application.Current.MainWindow as MainWindow).dzMainMenu; |
||
511 | menu.ReleaseAdorner(); |
||
512 | if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
||
513 | { |
||
514 | (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
||
515 | } |
||
516 | else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID) |
||
517 | { |
||
518 | |||
519 | } |
||
520 | else |
||
521 | { |
||
522 | (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
||
523 | } |
||
524 | } |
||
525 | |||
526 | Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).ID; |
||
527 | Application.Current.MainWindow.Focus(); |
||
528 | Common.ViewerDataModel.Instance.Capture_Opacity = 0.5; |
||
529 | (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture; |
||
530 | } |
||
531 | |||
532 | public void KeyEventDownAction(object sender, KeyEventArgs e) |
||
533 | { |
||
534 | switch (e.Key) |
||
535 | { |
||
536 | case Key.Escape: |
||
537 | { |
||
538 | (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
539 | Common.ViewerDataModel.Instance.Capture_Opacity = 0; |
||
540 | } |
||
541 | break; |
||
542 | } |
||
543 | } |
||
544 | |||
545 | private void tb_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) |
||
546 | { |
||
547 | DataBind(); |
||
548 | tb.ItemsSource = Lists; |
||
549 | tb1.ItemsSource = Lists; |
||
550 | |||
551 | var scrollViewer = this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault(); |
||
552 | if (scrollViewer != null) |
||
553 | { |
||
554 | this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset(this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ExtentHeight); |
||
555 | this.tb1.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset(this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ExtentHeight); |
||
556 | |||
557 | tb.CurrentCellInfo = new GridViewCellInfo(tb.Items[tb.Items.Count - 1], tb.Columns["TODOLIST"]); |
||
558 | tb.Focus(); |
||
559 | |||
560 | } |
||
561 | //gridView.CurrentCellInfo = new GridViewCellInfo(gridView.Items[5], gridView.Columns["Text"]); |
||
562 | //gridView.Focus(); |
||
563 | |||
564 | //(sender as Telerik.Windows.Controls.RadGridView).ItemsSource = null; |
||
565 | //(sender as Telerik.Windows.Controls.RadGridView).ItemsSource = Lists; |
||
566 | } |
||
567 | |||
568 | private void Radio_Open_Checked(object sender, RoutedEventArgs e) |
||
569 | { |
||
570 | (e.Source as RadioButton).Foreground = Brushes.Red; |
||
571 | (e.Source as RadioButton).FontWeight = FontWeights.Bold; |
||
572 | |||
573 | //if ((e.Source as RadioButton).DataContext != null) |
||
574 | //{ |
||
575 | // if(((e.Source as RadioButton).DataContext as Customer).STATUS_DESC != "Vendor 반영 필요") |
||
576 | // { |
||
577 | // ((e.Source as RadioButton).DataContext as Customer).STATUS_DESC = "Vendor 반영 필요"; |
||
578 | // tb.ItemsSource = null; |
||
579 | // tb.ItemsSource = Lists; |
||
580 | |||
581 | // //back_value = this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().VerticalOffset; |
||
582 | // //this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ScrollToVerticalOffset(this.tb.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault().ExtentHeight); |
||
583 | // } |
||
584 | //} |
||
585 | } |
||
586 | |||
587 | private void Radio_Unchecked(object sender, RoutedEventArgs e) |
||
588 | { |
||
589 | (e.Source as RadioButton).Foreground = Brushes.Black; |
||
590 | (e.Source as RadioButton).FontWeight = FontWeights.Normal; |
||
591 | } |
||
592 | |||
593 | private void Radio_Close_Checked(object sender, RoutedEventArgs e) |
||
594 | { |
||
595 | //(e.Source as RadioButton).FontWeight = FontWeights.Bold; |
||
596 | //if ((e.Source as RadioButton).DataContext != null) |
||
597 | //{ |
||
598 | // if (((e.Source as RadioButton).DataContext as Customer).STATUS_DESC != "Vendor 반영 확인") |
||
599 | // { |
||
600 | // var test = Lists.Where(i => i.ID == ((e.Source as RadioButton).DataContext as Customer).ID).First(); |
||
601 | // test.STATUS_DESC = "Vendor 반영 확인"; |
||
602 | // //((e.Source as RadioButton).DataContext as Customer).STATUS_DESC = "Vendor 반영 확인"; |
||
603 | // tb.ItemsSource = null; |
||
604 | // tb.ItemsSource = Lists; |
||
605 | // } |
||
606 | //} |
||
607 | } |
||
608 | |||
609 | private void mousedownOnImage(object sender, MouseButtonEventArgs args) |
||
610 | { |
||
611 | if (args.OriginalSource is Image) |
||
612 | { |
||
613 | Image img = (args.OriginalSource as Image); |
||
614 | |||
615 | RadWindow CheckPop = new RadWindow(); |
||
616 | |||
617 | CommantImage check = new CommantImage(img); |
||
618 | |||
619 | CheckPop = new RadWindow |
||
620 | { |
||
621 | MinWidth = 500, |
||
622 | MinHeight = 500, |
||
623 | Header = "Image", |
||
624 | Content = check, |
||
625 | //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
||
626 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
627 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
628 | IsTopmost = true, |
||
629 | }; |
||
630 | |||
631 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
632 | //CheckPop.ShowDialog(); |
||
633 | CheckPop.Show(); |
||
634 | |||
635 | |||
636 | //MessageBox.Show(((Image)args.OriginalSource).ParentOfType<GridViewCell>().Value.ToString()); |
||
637 | } |
||
638 | } |
||
639 | |||
640 | private void SyncEvent(object sender, MouseButtonEventArgs e) |
||
641 | { |
||
642 | |||
643 | using (CIEntities entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(App.ViewInfo.ProjectNO).ToString())) |
||
644 | { |
||
645 | var _vpList = (from docitem in entity.DOCUMENT_ITEM |
||
646 | where docitem.DOCUMENT_ID == old_DocID |
||
647 | select new VPRevision |
||
648 | { |
||
649 | RevNo = docitem.REVISION, |
||
650 | GroupNo = docitem.GROUP_NO, |
||
651 | FROM_VENDOR = docitem.ORIGINAL_FILE, |
||
652 | DOCUMENT_ID = docitem.DOCUMENT_ID, |
||
653 | TO_VENDOR = docitem.RESULT_FILE, |
||
654 | RESULT = docitem.RESULT, |
||
655 | //IsSyncPossible = docitem.DOCUMENT_ID == DocumentId ? false : true |
||
656 | }).FirstOrDefault(); |
||
657 | |||
658 | |||
659 | if (old_DocID == "") |
||
660 | { |
||
661 | MessageBox.Show("이 전 리비전이 없습니다."); |
||
662 | return; |
||
663 | } |
||
664 | |||
665 | SyncInit(); |
||
666 | Rect rect = new Rect(); |
||
667 | string[] RectPoint = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).IMAGE_ANCHOR.Split(','); |
||
668 | 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]))); |
||
669 | ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).PAGENUMBER); |
||
670 | ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.Sync_ZoomTo(rect); |
||
671 | (Application.Current.MainWindow as MainWindow).dzMainMenu.Sync_Event(_vpList); |
||
672 | } |
||
673 | } |
||
674 | |||
675 | #endregion |
||
676 | |||
677 | |||
678 | } |
||
679 | } |