프로젝트

일반

사용자정보

개정판 43e1d368

ID43e1d3684849725d38b5c74b43d4bb593f546d7a
상위 d91efe5c
하위 42d49521

김태성이(가) 약 2년 전에 추가함

issue #0000 코드 정리

Change-Id: I7c8ba4ef6d78a7e4f51b72f226507cddac722939

차이점 보기:

KCOM/Events/Implementation/TopMenuEvent.cs
365 365
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
366 366
                        {
367 367
                            /// 저장 서비스 호출
368
                            this.ExecuteSaveCommand(mainMenu);
368
                            this.ExecuteSaveCommandAsync(mainMenu);
369 369

  
370 370
                            ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now;
371 371
                            if (!ViewerDataModel.Instance.IsConsolidate && (sender != null))
......
406 406

  
407 407
            return result;
408 408
        }
409

  
409 410
        public async Task<bool>  SaveEventAsync()
410 411
        {
411 412
            bool result = false;
......
430 431
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
431 432
                        {
432 433
                            /// 저장 서비스 호출
433
                            result = await this.ExecuteSaveCommand(mainMenu);
434
                            result = await this.ExecuteSaveCommandAsync(mainMenu);
435

  
436
                            ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now;
437
                        }
438
                    }
439
                }
440

  
441
                mainMenu.SetCommentPages(null);
442

  
443
                ViewerDataModel.Instance.UndoDataList.Clear();
444
                result = true;
445
            }
446
            catch (Exception ex)
447
            {
448
                System.Diagnostics.Debug.WriteLine("_SaveEvent Error : " + ex.ToString());
449
            }
450
            finally
451
            {
452
                /*
453
                /// delete markup information when 코멘트가 없을 경우
454
                if (ViewerDataModel.Instance.MyMarkupList.Count == 0)
455
                {
456
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
457
                    {
458
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
459
                        {
460
                            //this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
461
                        }
462
                    }
463
                }
464
                */
465
            }
466

  
467
            return result;
468
        }
469

  
470
        public bool SaveEvent()
471
        {
472
            bool result = false;
473

  
474
            var mainMenu = this.ParentOfType<MainWindow>().dzMainMenu;
475
            try
476
            {
477
                mainMenu.ConvertInkControlToPolygon();
478

  
479
                SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
480
                // update mylist and gridview
481
                mainMenu.UpdateMyMarkupList();
482

  
483
                if (mainMenu.gridViewMarkup.SelectedItems.Count == 0 && mainMenu.gridViewMarkup.Items.Count > 0)
484
                {
485
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
486
                }
487
                else
488
                {
489
                    foreach (var item in mainMenu.gridViewMarkup.SelectedItems)
490
                    {
491
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
492
                        {
493
                            /// 저장 서비스 호출
494
                            result = this.ExecuteSaveCommandAsync(mainMenu).GetAwaiter().GetResult();
434 495

  
435 496
                            ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now;
436 497
                        }
......
511 572
                System.Diagnostics.Debug.WriteLine("ExecuteSaveCommand Error - pageNavigator.CurrentPage null");
512 573
            }
513 574
        }
514

  
515
        public async Task<bool> ExecuteSaveCommand(MainMenu menu)
575
        public async Task<bool> ExecuteSaveCommandAsync(MainMenu menu)
516 576
        {
517 577
            bool result = false;
518 578

  
......
563 623
            return result;
564 624
        }
565 625

  
626
        public bool ExecuteSaveCommand(MainMenu menu)
627
        {
628
            bool result = false;
629

  
630
            if (menu.pageNavigator.CurrentPage != null)
631
            {
632
                SaveCommand.Instance.Project_No = App.ViewInfo.ProjectNO;
633
                SaveCommand.Instance.document_id = App.ViewInfo.DocumentItemID;
634
                SaveCommand.Instance.user_id = App.ViewInfo.UserID;
635
                SaveCommand.Instance.page_no = menu.pageNavigator.CurrentPage.PageNumber;
636

  
637
                try
638
                {
639
                    if (ViewerDataModel.Instance.UndoDataList.Count > 0 || ViewerDataModel.Instance.IsMarkupUpdate)
640
                    {
641
                        List<IKCOM.MarkupInfoItem> SelectedMarkupInfos = new List<IKCOM.MarkupInfoItem>();
642
                        foreach (var item in menu.gridViewMarkup.SelectedItems)
643
                        {
644
                            if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
645
                            {
646
                                SelectedMarkupInfos.Add(item as IKCOM.MarkupInfoItem);
647
                            }
648
                        }
649

  
650
                        result = SaveCommand.Instance.Execute(SelectedMarkupInfos).GetAwaiter().GetResult();
651
                        ViewerDataModel.Instance.IsMarkupUpdate = false;
652
                    }
653
                    else
654
                    {
655
                        result = true;
656
                    }
657

  
658
                    if (ViewerDataModel.Instance.RotationDocs.Count > 0)
659
                    {
660
                        SaveCommand.Instance.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs);
661
                    }
662
                }
663
                catch (Exception ex)
664
                {
665
                    this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(string.Format("세이브 실패:{0}", ex.Message), "Alert");
666
                    throw ex;
667
                }
668
            }
669
            else
670
            {
671
                System.Diagnostics.Debug.WriteLine("ExecuteSaveCommand Error - pageNavigator.CurrentPage null");
672
            }
673

  
674
            return result;
675
        }
676

  
566 677
        //강인구 추가
567 678
        public void Print_Start(string Type)
568 679
        {
......
3039 3150
                    if (dLen < 4)
3040 3151
                    {
3041 3152
                        System.IO.FileStream fStream = new System.IO.FileStream(fileInfo.FullName,
3042
                        System.IO.FileMode.Open, System.IO.FileAccess.Read);
3153
                        System.IO.FileMode.Open, System.IO.FileAccess.Read,FileShare.Read);
3043 3154
                        System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
3044 3155
                        byte[] data = br.ReadBytes((int)numByte);
3045 3156

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)