프로젝트

일반

사용자정보

개정판 19d6b221

ID19d6b22109371bf47f839172429713ac7c3854a7
상위 037ab674
하위 59a29a3b

semi 이(가) 4년 이상 전에 추가함

Exception is not null 콤보박스 & Excel Export수정

Change-Id: I72953fb153aca7869b88110667986238f5c8b431

차이점 보기:

ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/FinalPDFViewModel.cs
56 56

  
57 57
        DataService.DataServiceClient WcfClient = new DataService.DataServiceClient();
58 58

  
59

  
60
        private static System.Collections.ObjectModel.ObservableCollection<FinalPDF> _ConvertSource;
61
        public static System.Collections.ObjectModel.ObservableCollection<FinalPDF> ConvertSource
62
        {
63
            get
64
            {
65
                if (_ConvertSource == null)
66
                {
67
                    _ConvertSource = new System.Collections.ObjectModel.ObservableCollection<FinalPDF>();
68
                }
69
                return _ConvertSource;
70
            }
71
            set
72
            {
73
                _ConvertSource = value;
74
            }
75
        }
76

  
59 77
        public ObservableCollection<ProjectName> _ProjectNames;
60 78
        public ObservableCollection<ProjectName> ProjectNames
61 79
        {
......
606 624
                OnPropertyChanged(() => ExcptionCheck);
607 625
            }
608 626
        }
627

  
609 628
        #endregion
610 629

  
611 630
        #region Command
......
705 724

  
706 725
        #region Function
707 726

  
727
        #region Return_FilterConvertSource
728

  
729
        public static void Return_FilterConvertSource(ObservableCollection<FinalPDF> convertPDFs)
730
        {
731
            ConvertSource = new ObservableCollection<FinalPDF>();
732
            ConvertSource = convertPDFs;
733
        }
734

  
735
        public static ObservableCollection<FinalPDF> Return_FilterConvertSource()
736
        {
737
            return ConvertSource;
738
        }
739

  
740

  
741
        #endregion
742

  
743

  
708 744
        #region Data Select
709 745

  
710 746
        /// <summary>
......
738 774
        {
739 775
            try
740 776
            {
741
                IEnumerable<FinalPDF> Listitems = null;
777
                IEnumerable<FinalPDF> Listitems = Enumerable.Empty<FinalPDF>();
742 778

  
743 779
                foreach (var coll in collection)
744 780
                {
745
                    Listitems = from x in await WcfClient.GET_SELECT_FINAL_PDF_ITEMAsync(coll.ConvertID, coll.ProjectNumber, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
781
                   Listitems = from x in await WcfClient.GET_SELECT_FINAL_PDF_ITEMAsync(coll.ConvertID, coll.ProjectNumber, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
746 782
                                let MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech")
747 783
                                select new FinalPDF(x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.MARKUPINFO_ID, x.DOCINFO_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.CREATE_USER_ID, x.REVISION, x.CURRENT_PAGE,
748 784
                            x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME, x.ORIGINAL_FILE, x.CONVERT_PATH, MarkusLink);
785

  
749 786
                }
750 787

  
751 788
                foreach (var Listitem in Listitems)
......
1379 1416

  
1380 1417
        public void DataExportData(object obj)
1381 1418
        {
1382
            SaveFileDialog saveFileDialog = new SaveFileDialog();
1383

  
1384
            saveFileDialog.FileName = "Document"; // Default file name
1385
            saveFileDialog.DefaultExt = ".txt"; // Default file extension
1386
            saveFileDialog.Filter = "Csv documents (.Csv)|*.csv|Excel(2017~2019)Worksheets|*.xlsx"; // Filter files by extension
1387

  
1419
            dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1388 1420

  
1389
            if (saveFileDialog.ShowDialog() == true)
1390
            {
1421
            Return_FilterConvertSource(FilterConvertSource);
1391 1422

  
1423
            Views.FinalPDFExcelDialog finalPDFExcelDialog = new Views.FinalPDFExcelDialog();
1392 1424

  
1393
                if (!string.IsNullOrWhiteSpace(saveFileDialog.FileName))
1394
                {
1425
            finalPDFExcelDialog.Owner = Application.Current.MainWindow;
1426
            finalPDFExcelDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
1395 1427

  
1396
                    var extension = new System.IO.FileInfo(saveFileDialog.FileName).Extension;
1428
            finalPDFExcelDialog.ShowDialog();
1397 1429

  
1398
                    if (extension == ".xlsx" || extension == ".csv")
1399
                    {
1400 1430

  
1401
                        var headers = new List<HeaderMember>
1402
                                {
1403
                                    new HeaderMember{HeaderName = "ServiceID", Property = "ServiceID" },
1404
                                    new HeaderMember{HeaderName = "ConvertID", Property = "ConvertID" },
1405
                                    new HeaderMember{HeaderName = "ProjectNumber", Property = "ProjectNumber" },
1406
                                    new HeaderMember{HeaderName = "ConvertState", Property = "ConvertState" },
1407
                                    new HeaderMember{HeaderName = "CurrentPageNo", Property = "CurrentPageNo" },
1408
                                    new HeaderMember{HeaderName = "TotalPage", Property = "TotalPage" },
1409
                                    new HeaderMember{HeaderName = "OriginfilePath", Property = "OriginfilePath" },
1410
                                    new HeaderMember{HeaderName = "ConvertPath", Property = "ConvertPath" },
1411
                                    new HeaderMember{HeaderName = "CreateTime", Property = "CreateTime" },
1412
                                    new HeaderMember{HeaderName = "Exception", Property = "Exception" },
1413
                                    new HeaderMember{HeaderName = "ProcessorAffinity", Property = "ProcessorAffinity" },
1414
                                    new HeaderMember{HeaderName = "ReConverter", Property = "ReConverter" },
1415
                                    new HeaderMember{HeaderName = "UniqueKey", Property = "UniqueKey" }
1416
                                };
1417

  
1418

  
1419
                        DataExport dataExport = new DataExport();
1420
                        dataExport.DataExportExcel(saveFileDialog.FileName, "Hello world", FilterConvertSource, headers);
1421
                        //_dataExport.DataExportExcel(saveFileDialog.FileName, saveFileDialog.FileName.ToString(), Projectsource, headers);
1422
                        //GemBoxFileSave(obj);
1423
                    }
1424
                }
1425
            }
1431
            dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1426 1432
        }
1427 1433

  
1428 1434
        #endregion

내보내기 Unified diff

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