프로젝트

일반

사용자정보

개정판 b42dd24d

IDb42dd24ddb89ae3b28024ec36780f58abfd055db
상위 a1e2ba68
하위 bae83c92

김태성이(가) 3년 이상 전에 추가함

finalPDF 수정

Change-Id: Ic1c091379dcc59c6c7a0f42f275a4d57a9239229

차이점 보기:

KCOM/Views/MainMenu.xaml.cs
3676 3676
                                    string extension = System.IO.Path.GetExtension(filename).ToUpper();
3677 3677
                                    if (extension == ".PNG" || extension == ".JPEG" || extension == ".GIF" || extension == ".BMP" || extension == ".JPG" || extension == ".SVG")
3678 3678
                                    {
3679
                                        UriBuilder downloadUri = new UriBuilder(App.BaseAddress);
3680
                                        UriBuilder uri = new UriBuilder(filename);
3681
                                        uri.Host = downloadUri.Host;
3682
                                        uri.Port = downloadUri.Port;
3683

  
3679 3684
                                        Image img = new Image();
3680 3685
                                        if (filename.Contains(".svg"))
3681 3686
                                        {
......
3683 3688
                                            DrawingImage image = null;
3684 3689
                                            using (System.Net.WebClient web = new System.Net.WebClient())
3685 3690
                                            {
3686
                                                imageData = web.DownloadData(new Uri(filename));
3691
                                                imageData = web.DownloadData(uri.Uri);
3687 3692
                                                System.IO.Stream stream = new System.IO.MemoryStream(imageData);
3688 3693
                                                image = SvgReader.Load(stream);
3689 3694
                                            }
......
3691 3696
                                        }
3692 3697
                                        else
3693 3698
                                        {
3694
                                            img.Source = new BitmapImage(new Uri(filename));
3699
                                            img.Source = new BitmapImage(uri.Uri);
3695 3700
                                        }
3696 3701

  
3697 3702
                                        currentControl = new ImgControl
3698 3703
                                        {
3699 3704
                                            Background = new SolidColorBrush(Colors.Black),
3700 3705
                                            PointSet = new List<Point>(),
3701
                                            FilePath = filename,
3706
                                            FilePath = uri.Uri.ToString(),
3702 3707
                                            ImageData = img.Source,
3703 3708
                                            StartPoint = CanvasDrawingMouseDownPoint,
3704 3709
                                            EndPoint = new Point(CanvasDrawingMouseDownPoint.X + 100, CanvasDrawingMouseDownPoint.Y + 100),
......
4516 4521
            inkBoard.Strokes.Add(stroke);
4517 4522
        }
4518 4523

  
4519
        private void btnConsolidate_Click(object sender, RoutedEventArgs e)
4524
        private  void btnConsolidate_Click(object sender, RoutedEventArgs e)
4520 4525
        {
4521
            ConsolidationMethod();
4526
            //SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
4527
            //// update mylist and gridview
4528
            //this.UpdateMyMarkupList();
4529

  
4530
            //bool result = await this.ParentOfType<MainWindow>().dzTopMenu.ExecuteSaveCommand(this);
4531

  
4532
            //if (result)
4533
            //{
4534
                ConsolidationMethod();
4535
            //}
4536
            //else
4537
            //{
4538
            //    MessageBox.Show("오류");
4539
            //}
4522 4540
        }
4523 4541

  
4524 4542
        /// <summary>
......
4553 4571
            }
4554 4572
        }
4555 4573

  
4556
        public void ConsolidationMethod()
4574
        public async Task<bool> ConsolidationMethod()
4557 4575
        {
4576
            bool result = false;
4577

  
4558 4578
            if (this.gridViewMarkup.SelectedItems.Count == 0)
4559 4579
            {
4560 4580
                this.ParentOfType<MainWindow>().DialogMessage_Alert("Please select at least one user", "Alert");
......
4568 4588
                }
4569 4589
                int iPageNo = Convert.ToInt32(this.ParentOfType<MainWindow>().dzTopMenu.tlcurrentPage.Text);
4570 4590

  
4571
                ConsolidateCommand.Instance.Execute(MySelectItem, iPageNo);
4591
                result = await ConsolidateCommand.Instance.Execute(MySelectItem, iPageNo);
4572 4592
            }
4593

  
4594
            return result;
4573 4595
        }
4574 4596

  
4575 4597
        private void btnConsolidate_Loaded(object sender, RoutedEventArgs e)
......
4615 4637

  
4616 4638
        private void FinalPDFEvent(object sender, RoutedEventArgs e)
4617 4639
        {
4618
			Common.ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null);
4640
            SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
4641
            // update mylist and gridview
4642
            this.UpdateMyMarkupList();
4619 4643

  
4620
			var item = gridViewMarkup.Items.Cast<MarkupInfoItem>().Where(d => d.Consolidate == 1 && d.AvoidConsolidate == 0).FirstOrDefault();
4644
            this.ParentOfType<MainWindow>().dzTopMenu.ExecuteSaveCommand(this);
4645

  
4646
            var item = gridViewMarkup.Items.Cast<MarkupInfoItem>().Where(d => d.Consolidate == 1 && d.AvoidConsolidate == 0).FirstOrDefault();
4621 4647

  
4622 4648
			if (item != null)
4623 4649
            {
......
4644 4670
            btnFinalPDF = sender as RadRibbonButton;
4645 4671
            if (App.ViewInfo != null)
4646 4672
            {
4673
                //btnFinalPDF.IsEnabled = false;
4674

  
4647 4675
                if (!App.ViewInfo.CreateFinalPDFPermission) //파이널이 True가 아니면
4648 4676
                {
4649 4677
                    btnFinalPDF.Visibility = System.Windows.Visibility.Collapsed;
......
4655 4683
            }
4656 4684
        }
4657 4685

  
4658
        private void ConsolidateFinalPDFEvent(object sender, RoutedEventArgs e)
4686
        private async void ConsolidateFinalPDFEvent(object sender, RoutedEventArgs e)
4659 4687
        {
4660
            UpdateMyMarkupList();
4688
            //UpdateMyMarkupList();
4661 4689

  
4662 4690
            if (this.gridViewMarkup.SelectedItems.Count == 0)
4663 4691
            {
......
4665 4693
            }
4666 4694
            else
4667 4695
            {
4668
                ViewerDataModel.Instance.IsConsolidate = true;
4669
                this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null);
4670
                List<KCOMDataModel.DataModel.MARKUP_DATA> instanceDataSet = new List<KCOMDataModel.DataModel.MARKUP_DATA>();
4696
                //if ((App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission))
4697
                //{
4698
                //컨트롤을 그리는 도중일 경우 컨트롤 삭제
4699
                //ViewerDataModel.Instance.MarkupControls_USER.Remove(ViewerDataModel.Instance.SystemMain.dzMainMenu.currentControl);
4700
                //ViewerDataModel.Instance.SystemMain.dzMainMenu.currentControl = null;
4671 4701

  
4672
                string project_no = App.ViewInfo.ProjectNO;
4673
                string doc_id = _DocInfo.ID;
4674
                string user_id = App.ViewInfo.UserID;
4675
                List<MarkupInfoItem> markupInfoItems = new List<MarkupInfoItem>();
4676
                foreach (MarkupInfoItem item in this.gridViewMarkup.SelectedItems)
4677
                {
4678
                    markupInfoItems.Add(item);
4679
                }
4680
                //Logger.sendReqLog("Consolidate", project_no + "," + user_id + "," + doc_id + "," + markupInfoItems, 1);
4681
                //Logger.sendResLog("Consolidate", this.BaseClient.Consolidate(project_no, user_id, doc_id, markupInfoItems).ToString(), 1);
4682
                //Logger.sendReqLog("GetMarkupInfoItemsAsync", App.ViewInfo.ProjectNO + "," + _DocInfo.ID, 1);
4702
                //SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
4703
                //// update mylist and gridview
4704
                //this.UpdateMyMarkupList();
4705

  
4706
                //var result = await this.ParentOfType<MainWindow>().dzTopMenu.ExecuteSaveCommand(this);
4683 4707

  
4684
                this.BaseClient.Consolidate(project_no, user_id, doc_id, markupInfoItems);
4708
                bool result = await ConsolidationMethod();
4685 4709

  
4686 4710
                var items = this.BaseClient.GetMarkupInfoItems(App.ViewInfo.ProjectNO, _DocInfo.ID);
4687 4711

  
......
4706 4730
#if Hyosung
4707 4731
            btnConsolidateFinalPDF.Visibility = System.Windows.Visibility.Collapsed;
4708 4732
#else
4733

  
4734
            //btnConsolidateFinalPDF.IsEnabled = false;
4735

  
4709 4736
            if (App.ViewInfo != null)
4710 4737
            {
4711 4738
                if (!App.ViewInfo.NewCommentPermission || !App.ViewInfo.CreateFinalPDFPermission)

내보내기 Unified diff

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