프로젝트

일반

사용자정보

개정판 78683624

ID78683624e478176eb22f87d87f662026e46835e7
상위 7b1db8cc
하위 5c9d08be

semi 이(가) 약 5년 전에 추가함

ConvertPath Icon추가 & Interface삭제

Change-Id: I9b142f056f876d6daa2e2d9f527cf03b93997078

차이점 보기:

ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseItemsModel.cs
13 13
using System.Windows;
14 14
using Telerik.Windows.Controls;
15 15
using Telerik.Windows.Data;
16
using ConvertItem = Markus.Service.Interface.ConvertItem;
17 16
using System.Net;
18 17
using System.Windows.Threading;
19 18
using System.Diagnostics;
......
23 22
using System.Windows.Controls;
24 23
using System.IO;
25 24
using Newtonsoft.Json;
26
using Markus.Service.Interface;
25
//using Markus.Service.Interface;
26
using static Markus.Service.StationController.Data.DataConvert;
27 27

  
28 28
namespace Markus.Service.StationController.ViewModel
29 29
{
......
46 46
            RemoveCreateTimeFilterCommand = new DelegateCommand(RemoveCreateTimeFilter);
47 47
            ResetCommand = new DelegateCommand(Reset);
48 48
            ConverAddCommand = new DelegateCommand(ConverAdd);
49
            ConvertPathFileSearchCommand = new DelegateCommand(ConvertPathFileSearch);
49 50
        }
50 51

  
51 52
        #endregion
52 53

  
53 54
        #region Properties
54 55

  
55
        private System.Collections.ObjectModel.ObservableCollection<ConvertItem> _FilterSearch;
56
        public System.Collections.ObjectModel.ObservableCollection<ConvertItem> FilterSearch
56
        private System.Collections.ObjectModel.ObservableCollection<DataConvert> _FilterSearch;
57
        public System.Collections.ObjectModel.ObservableCollection<DataConvert> FilterSearch
57 58
        {
58 59
            get
59 60
            {
60 61
                if (_FilterSearch == null)
61 62
                {
62
                    _FilterSearch = new System.Collections.ObjectModel.ObservableCollection<ConvertItem>
63
                    _FilterSearch = new System.Collections.ObjectModel.ObservableCollection<DataConvert>
63 64
                    {
64
                        new ConvertItem{ProjectNumber = "Filter Search"}
65
                        new DataConvert{ProjectNumber = "Filter Search"}
65 66
                    };
66 67
                }
67 68

  
......
69 70
            }
70 71
        }
71 72

  
72
        private System.Collections.ObjectModel.ObservableCollection<ConvertItem> _AliveItems;
73
        public System.Collections.ObjectModel.ObservableCollection<ConvertItem> AliveItems
73
        private System.Collections.ObjectModel.ObservableCollection<DataConvert> _AliveItems;
74
        public System.Collections.ObjectModel.ObservableCollection<DataConvert> AliveItems
74 75
        {
75 76
            get => _AliveItems;
76 77
            set
......
89 90
            }
90 91
        }
91 92

  
92
        private System.Collections.ObjectModel.ObservableCollection<ConvertItem> _FilterConvertSource;
93
        public System.Collections.ObjectModel.ObservableCollection<ConvertItem> FilterConvertSource
93
        private System.Collections.ObjectModel.ObservableCollection<DataConvert> _FilterConvertSource;
94
        public System.Collections.ObjectModel.ObservableCollection<DataConvert> FilterConvertSource
94 95
        {
95 96
            get
96 97
            {
97 98
                if (_FilterConvertSource == null)
98 99
                {
99
                    _FilterConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertItem>();
100
                    _FilterConvertSource = new System.Collections.ObjectModel.ObservableCollection<DataConvert>();
100 101
                }
101 102
                return _FilterConvertSource;
102 103
            }
......
108 109
        }
109 110

  
110 111

  
111
        private System.Collections.ObjectModel.ObservableCollection<ConvertItem> _RealConvertSource;
112
        public System.Collections.ObjectModel.ObservableCollection<ConvertItem> RealConvertSource
112
        private System.Collections.ObjectModel.ObservableCollection<DataConvert> _RealConvertSource;
113
        public System.Collections.ObjectModel.ObservableCollection<DataConvert> RealConvertSource
113 114
        {
114 115
            get => _RealConvertSource;
115 116
            set
......
178 179
            }
179 180
        }
180 181

  
181
        private ConvertItem _SelectFilterConvert;
182
        public ConvertItem SelectFilterConvert
182
        private DataConvert _SelectFilterConvert;
183
        public DataConvert SelectFilterConvert
183 184
        {
184 185
            get => _SelectFilterConvert;
185 186
            set
......
189 190
            }
190 191
        }
191 192

  
192
        private ConvertItem _SelectRealConvert;
193
        public ConvertItem SelectRealConvert
193
        private DataConvert _SelectRealConvert;
194
        public DataConvert SelectRealConvert
194 195
        {
195 196
            get => _SelectRealConvert;
196 197
            set
......
201 202
        }
202 203

  
203 204

  
204
        private ConvertItem _SelectAliveConvert;
205
        public ConvertItem SelectAliveConvert
205
        private DataConvert _SelectAliveConvert;
206
        public DataConvert SelectAliveConvert
206 207
        {
207 208
            get => _SelectAliveConvert;
208 209
            set
......
491 492
        public DelegateCommand DataFilterCommand { get; private set; }
492 493
        public DelegateCommand ResetCommand { get; private set; }
493 494
        public DelegateCommand ConverAddCommand { get; private set; }
495
        public DelegateCommand ConvertPathFileSearchCommand { get; private set; }
494 496

  
495 497
        #endregion
496 498

  
......
561 563

  
562 564
            if (FilterConvertSource == null)
563 565
            {
564
                FilterConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertItem>();
566
                FilterConvertSource = new System.Collections.ObjectModel.ObservableCollection<DataConvert>();
565 567
            }
566 568

  
567 569
            if (RealConvertSource == null)
568 570
            {
569
                RealConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertItem>();
571
                RealConvertSource = new System.Collections.ObjectModel.ObservableCollection<DataConvert>();
570 572
            }
571 573

  
572 574
            /// combobox 에서 선택된 items
......
580 582

  
581 583
        }
582 584

  
583
        private void RealDataSelect(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertItem> collection)
585
        private void RealDataSelect(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<DataConvert> collection)
584 586
        {
585 587
            try
586 588
            {
587 589
                using (markusEntities entities = new markusEntities(App.MarkusDataBaseConnecitonString))
588 590
                {
589
                    List<ConvertItem> Listitems = new List<ConvertItem>();
591
                    List<DataConvert> Listitems = new List<DataConvert>();
590 592

  
591 593
                    foreach (var coll in collection)
592 594
                    {
......
596 598
                        {
597 599
                            var MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech");
598 600

  
599
                            ConvertItem AddItem = new ConvertItem(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE,
601
                            DataConvert AddItem = new DataConvert(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE,
600 602
                                x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME, x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
601 603
                            Listitems.Add(AddItem);
602 604
 
......
617 619
            }
618 620
        }
619 621

  
620
        private void DataSelect(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertItem> collection)
622
        private void DataSelect(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<DataConvert> collection)
621 623
        {
622 624
            try
623 625
            {
......
633 635
                    var items = entities.SELECT_CONVERT_ITEM(null, null, null, _status, SelectedCount.ValueMember, null, null, null,
634 636
                        null, null, null, null, null, null, null, null, null, null).ToList();
635 637

  
636
                    List<ConvertItem> Listitems = new List<ConvertItem>();
638
                    List<DataConvert> Listitems = new List<DataConvert>();
637 639

  
638 640
                    foreach (var x in items)
639 641
                    {
640 642
                        var MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech");
641 643

  
642
                        ConvertItem AddItem = new ConvertItem(x.SERVICE_ID, x.ID, x.PROJECT_NO, _status, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE,
644
                        DataConvert AddItem = new DataConvert(x.SERVICE_ID, x.ID, x.PROJECT_NO, _status, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE,
643 645
                            x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME, x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
644 646
                        Listitems.Add(AddItem);
645 647

  
......
717 719
            }
718 720
        }
719 721

  
720
        private void DataSearch(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertItem> collection)
722
        private void DataSearch(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<DataConvert> collection)
721 723
        {
722 724
            try
723 725
            {
......
744 746
                    var items = entities.SELECT_CONVERT_ITEM(null, ProjectNumberFilter, UniqueKeyFilter, _status, SelectedCount.ValueMember, Start_CreateTime, Finish_CreateTime, null,
745 747
                        null, null, null, GroupNOFilter, Document_NameFilter, Docuemnt_NOFilter, RevisionFilter, Service_IDFilter, ReconverterFilter, DOCUMENT_URLFilter).ToList();
746 748

  
747
                    List<ConvertItem> Listitems = new List<ConvertItem>();
749
                    List<DataConvert> Listitems = new List<DataConvert>();
748 750

  
749 751
                    foreach (var x in items)
750 752
                    {
751 753
                        var MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech");
752 754

  
753
                        ConvertItem AddItem = new ConvertItem(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE,
755
                        DataConvert AddItem = new DataConvert(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE,
754 756
                            x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME, x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
755 757
                        Listitems.Add(AddItem);
756 758

  
......
839 841
        {
840 842
            try
841 843
            {
842
                List<ConvertItem> newitems = new List<ConvertItem>();
844
                List<DataConvert> newitems = new List<DataConvert>();
843 845
                foreach (var client in App.StationClientList)
844 846
                {
845 847
                    if (await SimplePingAsync(client.Endpoint.Address.ToString()))
846 848
                    {
847 849
                        try
848 850
                        {
849
                            List<ConvertItem> itemsToList = new List<ConvertItem>();
851
                            List<DataConvert> itemsToList = new List<DataConvert>();
850 852
                            var items = await client.AliveConvertListAsync();
851 853
                            string result = "";
852 854

  
853 855
                            foreach (var item in items)
854 856
                            {
855
                                ConvertItem itemsToEach = new ConvertItem();
857
                                DataConvert itemsToEach = new DataConvert();
856 858
                                itemsToEach.ServiceID = item.ServiceID;
857 859
                                itemsToEach.ConvertID = item.ConvertID;
858 860
                                itemsToEach.ProjectNumber = item.ProjectNumber;
......
881 883
                                itemsToEach.MarkusLink = MarkusLink;
882 884
                                itemsToEach.UniqueKey = item.UniqueKey;//DocumentNO 없음
883 885
                                itemsToEach.GroupNo = item.GroupNo;//없음 
884
                                itemsToEach.ProcessorAffinity = item.ProcessorAffinity;
886
                                //itemsToEach.ProcessorAffinity = item.ProcessorAffinity;
885 887
                                itemsToEach.DocumentName = item.DocumnetName;
886 888
                                itemsToEach.Revision = item.Revision; //없음 
887 889
                                itemsToEach.Exception = item.Exception;//없음
......
915 917
                }
916 918
                ItemsUpdate(newitems);
917 919
                await System.Windows.Application.Current.Dispatcher.InvokeAsync(() => ItemsUpdate(newitems));
918

  
919
                //List<ConvertItem> newitems = new List<ConvertItem>(); //효성 실시간 확인 후 삭제 할 예정
920
                //using (Markus.Service.DataBase.ConvertDatabase database = new Markus.Service.DataBase.ConvertDatabase(App.MarkusDataBaseConnecitonString))
921
                //{
922
                //    foreach (var client in App.StationClientList)
923
                //    {
924
                //        if (await SimplePingAsync(client.Endpoint.Address.ToString()))
925
                //        {
926
                //            try
927
                //            {
928
                //                List<ConvertItem> itemsToList = new List<ConvertItem>();
929
                //                var items = await client.AliveConvertListAsync();
930
                //                string result = "";
931

  
932
                //                foreach (var item in items)
933
                //                {
934
                //                    ConvertItem itemsToEach = new ConvertItem();
935
                //                    itemsToEach.ServiceID = item.ServiceID;
936
                //                    itemsToEach.ConvertID = item.ConvertID;
937
                //                    itemsToEach.ProjectNumber = item.ProjectNumber;
938

  
939
                //                    var convertpath = database.GetSearchConvertPathAndMarkus(item.ProjectNumber, item.UniqueKey);
940

  
941
                //                    if (item.ConvertState != null)
942
                //                    {
943
                //                        itemsToEach.ConvertState = (StatusCodeType)Enum.Parse(typeof(StatusCodeType), item.ConvertState);
944
                //                    }
945

  
946
                //                    if (item.OriginfilePath.Contains("/"))
947
                //                    {
948
                //                        result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("/") + 1);
949
                //                    }
950
                //                    else
951
                //                    {
952
                //                        result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("%") + 1);
953
                //                    }
954
                //                    itemsToEach.FileName = result;
955

  
956
                //                    itemsToEach.CurrentPageNo = item.CurrentPageNo;
957
                //                    itemsToEach.TotalPage = item.TotalPage;
958
                //                    itemsToEach.OriginfilePath = item.OriginfilePath;
959
                //                    itemsToEach.ConvertPath = item.ConvertPath;
960
                //                    itemsToEach.MarkusLink = convertpath[1];
961
                //                    itemsToEach.UniqueKey = item.UniqueKey;
962
                //                    itemsToEach.GroupNo = item.GroupNo;
963
                //                    itemsToEach.ProcessorAffinity = item.ProcessorAffinity;
964
                //                    itemsToEach.DocumnetName = item.DocumnetName;
965
                //                    itemsToEach.Revision = item.Revision;
966
                //                    itemsToEach.Exception = item.Exception;
967
                //                    itemsToEach.ConvertPath = convertpath[0];
968
                //                    itemsToEach.CreateTime = item.CreateTime;
969
                //                    itemsToEach.ReConverter = item.ReConverter;
970
                //                    itemsToEach.DocumentID = item.DocumentID;
971
                //                    itemsToEach.StartTime = item.StartTime;
972
                //                    itemsToEach.EndTime = item.EndTime;
973

  
974
                //                    itemsToList.Add(itemsToEach);
975
                //                }
976
                //                newitems.AddRange(itemsToList);
977
                //                System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} ping");
978

  
979
                //                if (items.Count() == 0)
980
                //                {
981
                //                    System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} Alive Items is zero.");
982
                //                }
983
                //            }
984
                //            catch (Exception ex)
985
                //            {
986
                //                System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} {ex.Message}");
987
                //            }
988
                //        }
989
                //        else
990
                //        {
991
                //            System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} ping Error");
992
                //        }
993
                //    }
994
                //}
995
                //ItemsUpdate(newitems);
996
                //await System.Windows.Application.Current.Dispatcher.InvokeAsync(() => ItemsUpdate(newitems));
997 920
            }
998 921
            catch (Exception ex)
999 922
            {
......
1005 928
        /// AliveDataSelect의 Data Update
1006 929
        /// </summary>
1007 930
        /// <param name="newitems"></param>
1008
        private void ItemsUpdate(List<ConvertItem> newitems)
931
        private void ItemsUpdate(List<DataConvert> newitems)
1009 932
        {
1010 933

  
1011 934
            foreach (var item in newitems)
......
1015 938

  
1016 939
            if (AliveItems == null)
1017 940
            {
1018
                AliveItems = new System.Collections.ObjectModel.ObservableCollection<ConvertItem>();
941
                AliveItems = new System.Collections.ObjectModel.ObservableCollection<DataConvert>();
1019 942

  
1020 943
                foreach (var item in newitems)
1021 944
                {
......
1129 1052
                    {
1130 1053
                        var MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech");
1131 1054

  
1132
                        ConvertItem AddItem = new ConvertItem(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE, x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME
1055
                        DataConvert AddItem = new DataConvert(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE, x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME
1133 1056
                             , x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
1134 1057

  
1135 1058
                        RealConvertSource.Add(AddItem);
......
1145 1068
        }
1146 1069

  
1147 1070

  
1148
        public int SetCleanUpItem(ConvertItem _ConvertItem)
1071
        public int SetCleanUpItem(DataConvert _ConvertItem)
1149 1072
        {
1150 1073
            using (markusEntities entities = new markusEntities(App.MarkusDataBaseConnecitonString))
1151 1074
            {
......
1247 1170

  
1248 1171
        private void MarkusLink(object obj)///여기서 부터 
1249 1172
        {
1250
            if (obj is ConvertItem)
1173
            if (obj is DataConvert)
1251 1174
            {
1252 1175
                if (obj != null)
1253 1176
                {
1254
                    var convertitem = obj as ConvertItem;
1177
                    var convertitem = obj as DataConvert;
1255 1178

  
1256 1179
                    SelectFilterConvert = convertitem;
1257 1180

  
......
1389 1312

  
1390 1313
        #endregion
1391 1314

  
1392

  
1393 1315
        #region ConvertAddDialog
1394 1316

  
1395 1317
        /// <summary>
......
1412 1334

  
1413 1335
        #endregion
1414 1336

  
1337

  
1338
        #region ConvertPathFileSearch
1339

  
1340
        /// <summary>
1341
        ///  ConvertPath 파일 탐색기로 열리는 아이콘
1342
        /// </summary>
1343

  
1344
        public void ConvertPathFileSearch(object obj)
1345
        {
1346
            if (obj is DataConvert)
1347
            {
1348
                if (obj != null)
1349
                {
1350
                    var convertitem = obj as DataConvert;
1351

  
1352
                    SaveFileDialog saveFileDialog = new SaveFileDialog();
1353

  
1354
                    saveFileDialog.FileName = "Document"; // Default file name
1355
                    saveFileDialog.DefaultExt = ".txt"; // Default file extension
1356
                    saveFileDialog.Filter = "Csv documents (.Csv)|*.csv|Excel(2017~2019)Worksheets|*.xlsx"; // Filter files by extension
1357

  
1358

  
1359
                    if (saveFileDialog.ShowDialog() == true)
1360
                    {
1361
                    }
1362
                }
1363
            }
1364
        }
1365

  
1366
        #endregion
1367

  
1415 1368
        #endregion
1416 1369
    }
1417 1370
}

내보내기 Unified diff

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