프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / ConvertService / ServiceBase / Markus.Service.StationController / ViewModel / DataBaseItemsModel.cs @ 31beca73

이력 | 보기 | 이력해설 | 다운로드 (51 KB)

1
using Markus.Service.Extensions;
2
using Markus.Service.StationController.Data;
3
using Markus.Service.StationController.Behaviors;
4
using Markus.Service.StationController.Extensions;
5
using Markus.Service.StationController.Controls;
6
using Microsoft.Win32;
7
using System;
8
using System.Collections.Generic;
9
using System.ComponentModel;
10
using System.Linq;
11
using System.Threading.Tasks;
12
using System.Web;
13
using System.Windows;
14
using Telerik.Windows.Controls;
15
using Telerik.Windows.Data;
16
using ConvertItem = Markus.Service.Interface.ConvertItem;
17
using System.Net;
18
using System.Windows.Threading;
19
using System.Diagnostics;
20
using System.Windows.Input;
21
using Markus.Mvvm.ToolKit;
22
using System.Windows.Data;
23
using System.Windows.Controls;
24
using System.IO;
25
using Newtonsoft.Json;
26
using Markus.Service.Interface;
27

    
28
namespace Markus.Service.StationController.ViewModel
29
{
30
    //세미
31
    public class DataBaseItemsModel : Mvvm.ToolKit.ViewModelBase
32
    {
33
        #region Constructor
34

    
35
        /// <summary>
36
        /// 실행하면 처음 들어가는 부분
37
        /// </summary>
38
        public DataBaseItemsModel()
39
        {
40
            DataFilterCommand = new DelegateCommand(DataFilter);
41
            DataSaveFileGemBoxCommand = new DelegateCommand(DataExportData);
42
            ConvertCommand = new DelegateCommand(DataConvert);
43
            DeleteCommand = new DelegateCommand(DataDelete);
44
            ValidateCommand = new DelegateCommand(DataValidate);
45
            MarkusLinkCommand = new DelegateCommand(MarkusLink);
46
            RemoveCreateTimeFilterCommand = new DelegateCommand(RemoveCreateTimeFilter);
47
            ResetCommand = new DelegateCommand(Reset);
48
            ConverAddCommand = new DelegateCommand(ConverAdd);
49
        }
50

    
51
        #endregion
52

    
53
        #region Properties
54

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

    
68
                return _FilterSearch;
69
            }
70
        }
71

    
72
        private System.Collections.ObjectModel.ObservableCollection<ConvertItem> _AliveItems;
73
        public System.Collections.ObjectModel.ObservableCollection<ConvertItem> AliveItems
74
        {
75
            get => _AliveItems;
76
            set
77
            {
78
                _AliveItems = value;
79
                OnPropertyChanged(() => AliveItems);
80
            }
81
        }
82

    
83
        public ICollectionView FilterConvertSourceView
84
        {
85
            get
86
            {
87
                var view = CollectionViewSource.GetDefaultView(FilterConvertSource);
88
                return view;
89
            }
90
        }
91

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

    
110

    
111
        private System.Collections.ObjectModel.ObservableCollection<ConvertItem> _RealConvertSource;
112
        public System.Collections.ObjectModel.ObservableCollection<ConvertItem> RealConvertSource
113
        {
114
            get => _RealConvertSource;
115
            set
116
            {
117
                _RealConvertSource = value;
118
                OnPropertyChanged(() => RealConvertSource);
119
            }
120
        }
121

    
122

    
123
        private System.Windows.Documents.FlowDocument connectionLog;
124
        public System.Windows.Documents.FlowDocument ConnectionLog
125
        {
126
            get => connectionLog;
127
            set
128
            {
129
                if (connectionLog != value)
130
                {
131
                    connectionLog = value;
132
                    OnPropertyChanged(() => ConnectionLog);
133
                }
134
            }
135
        }
136

    
137

    
138
        private Telerik.Windows.Data.EnumMemberViewModel _SelectedStatus;
139
        public Telerik.Windows.Data.EnumMemberViewModel SelectedStatus
140
        {
141
            get => _SelectedStatus;
142
            set
143
            {
144
                _SelectedStatus = value;
145
                OnPropertyChanged(() => SelectedStatus);
146
            }
147
        }
148

    
149

    
150
        private SelectedCountItem _SelectedCount;
151
        public SelectedCountItem SelectedCount
152
        {
153
            get => _SelectedCount;
154
            set
155
            {
156
                _SelectedCount = value;
157
                OnPropertyChanged(() => SelectedCount);
158
            }
159
        }
160

    
161
        List<SelectedCountItem> _SelectedCountList;
162
        public List<SelectedCountItem> SelectedCountList
163
        {
164
            get
165
            {
166
                if (_SelectedCountList == null)
167
                {
168
                    _SelectedCountList = new List<SelectedCountItem>
169
                    {
170
                        new SelectedCountItem{DisplayMember = "50",ValueMember = 50},
171
                        new SelectedCountItem{DisplayMember = "100",ValueMember = 100},
172
                        new SelectedCountItem{DisplayMember = "150",ValueMember = 150},
173
                        new SelectedCountItem{DisplayMember = "200",ValueMember = 200}
174
                    };
175
                }
176

    
177
                return _SelectedCountList;
178
            }
179
        }
180

    
181
        private ConvertItem _SelectFilterConvert;
182
        public ConvertItem SelectFilterConvert
183
        {
184
            get => _SelectFilterConvert;
185
            set
186
            {
187
                _SelectFilterConvert = value;
188
                OnPropertyChanged(() => SelectFilterConvert);
189
            }
190
        }
191

    
192
        private ConvertItem _SelectRealConvert;
193
        public ConvertItem SelectRealConvert
194
        {
195
            get => _SelectRealConvert;
196
            set
197
            {
198
                _SelectRealConvert = value;
199
                OnPropertyChanged(() => SelectRealConvert);
200
            }
201
        }
202

    
203

    
204
        private ConvertItem _SelectAliveConvert;
205
        public ConvertItem SelectAliveConvert
206
        {
207
            get => _SelectAliveConvert;
208
            set
209
            {
210
                _SelectAliveConvert = value;
211
                OnPropertyChanged(() => SelectAliveConvert);
212
            }
213
        }
214

    
215

    
216
        private StatusTypeList _StatusType;
217
        public StatusTypeList StatusType
218
        {
219
            get => _StatusType;
220
            set
221
            {
222
                _StatusType = value;
223
                OnPropertyChanged(() => StatusType);
224
            }
225
        }
226

    
227
        private bool _IsLoading;
228
        public bool IsLoading
229
        {
230
            get => _IsLoading;
231
            set
232
            {
233
                if (_IsLoading != value)
234
                {
235
                    _IsLoading = value;
236
                    OnPropertyChanged(() => IsLoading);
237
                }
238
            }
239
        }
240

    
241
        IEnumerable<Telerik.Windows.Data.EnumMemberViewModel> _StatusCodeList;
242
        public IEnumerable<Telerik.Windows.Data.EnumMemberViewModel> StatusCodeList
243
        {
244
            get
245
            {
246
                if (_StatusCodeList == null)
247
                {
248
                    _StatusCodeList = Telerik.Windows.Data.EnumDataSource.FromType<StatusCodeType>();
249
                }
250

    
251
                return _StatusCodeList;
252
            }
253
        }
254

    
255
        public string _ProjectNumberFilter;
256
        public string ProjectNumberFilter
257
        {
258
            get { return _ProjectNumberFilter; }
259
            set
260
            {
261
                if (_ProjectNumberFilter == "")
262
                {
263
                    _ProjectNumberFilter = null;
264
                }
265
                else if (_ProjectNumberFilter != value)
266
                {
267
                    _ProjectNumberFilter = value;
268
                    OnPropertyChanged(() => ProjectNumberFilter);
269
                }
270
            }
271
        }
272

    
273
        public string _UniqueKeyFilter;
274
        public string UniqueKeyFilter
275
        {
276
            get
277
            {
278
                return _UniqueKeyFilter;
279
            }
280
            set
281
            {
282
                if (_UniqueKeyFilter == "")
283
                {
284
                    _UniqueKeyFilter = null;
285
                }
286
                else if (_UniqueKeyFilter != value)
287
                {
288
                    _UniqueKeyFilter = value;
289
                    OnPropertyChanged(() => UniqueKeyFilter);
290
                }
291
            }
292
        }
293

    
294
        public StatusCodeType _ConvertStateFilter;
295
        public StatusCodeType ConvertStateFilter
296
        {
297
            get { return _ConvertStateFilter; }
298
            set
299
            {
300
                if (_ConvertStateFilter != value)
301
                {
302
                    _ConvertStateFilter = value;
303
                    OnPropertyChanged(() => ConvertStateFilter);
304
                }
305
            }
306
        }
307

    
308
        public string _Docuemnt_NOFilter;
309
        public string Docuemnt_NOFilter
310
        {
311
            get { return _Docuemnt_NOFilter; }
312
            set
313
            {
314
                if (_Docuemnt_NOFilter == "")
315
                {
316
                    _Docuemnt_NOFilter = null;
317
                }
318
                else if (_Docuemnt_NOFilter != value)
319
                {
320
                    _Docuemnt_NOFilter = value;
321
                    OnPropertyChanged(() => Docuemnt_NOFilter);
322
                }
323
            }
324
        }
325

    
326
        public string _Document_NameFilter;
327
        public string Document_NameFilter
328
        {
329
            get { return _Document_NameFilter; }
330
            set
331
            {
332
                if (_Document_NameFilter == "")
333
                {
334
                    _Document_NameFilter = null;
335
                }
336
                else if (_Document_NameFilter != value)
337
                {
338
                    _Document_NameFilter = value;
339
                    OnPropertyChanged(() => Document_NameFilter);
340
                }
341
            }
342
        }
343

    
344
        public int? _ReconverterFilter = 0;
345
        public int? ReconverterFilter
346
        {
347
            get { return _ReconverterFilter; }
348
            set
349
            {
350
                if (_ReconverterFilter == null)
351
                {
352
                    _ReconverterFilter = 0;
353
                }
354
                else if (_ReconverterFilter != value)
355
                {
356
                    _ReconverterFilter = value;
357
                    OnPropertyChanged(() => ReconverterFilter);
358

    
359
                }
360
            }
361
        }
362

    
363
        public string _Service_IDFilter;
364
        public string Service_IDFilter
365
        {
366
            get { return _Service_IDFilter; }
367
            set
368
            {
369
                if (_Service_IDFilter == "")
370
                {
371
                    _Service_IDFilter = null;
372
                }
373
                else if (_Service_IDFilter != value)
374
                {
375
                    _Service_IDFilter = value;
376
                    OnPropertyChanged(() => Service_IDFilter);
377
                }
378
            }
379
        }
380

    
381
        public string _RevisionFilter;
382
        public string RevisionFilter
383
        {
384
            get { return _RevisionFilter; }
385
            set
386
            {
387
                if (_RevisionFilter == "")
388
                {
389
                    _RevisionFilter = null;
390
                }
391
                else if (_RevisionFilter != value)
392
                {
393
                    _RevisionFilter = value;
394
                    OnPropertyChanged(() => RevisionFilter);
395
                }
396
            }
397
        }
398

    
399
        public string _GroupNOFilter;
400
        public string GroupNOFilter
401
        {
402
            get { return _GroupNOFilter; }
403
            set
404
            {
405
                if (_GroupNOFilter == "")
406
                {
407
                    _GroupNOFilter = null;
408
                }
409
                else if (_GroupNOFilter != value)
410
                {
411
                    _GroupNOFilter = value;
412
                    OnPropertyChanged(() => GroupNOFilter);
413
                }
414
            }
415
        }
416

    
417
        public string _DOCUMENT_URLFilter;
418
        public string DOCUMENT_URLFilter
419
        {
420
            get { return _DOCUMENT_URLFilter; }
421
            set
422
            {
423
                if (_DOCUMENT_URLFilter == "")
424
                {
425
                    _DOCUMENT_URLFilter = null;
426
                }
427
                else if (_DOCUMENT_URLFilter != value)
428
                {
429
                    _DOCUMENT_URLFilter = value;
430
                    OnPropertyChanged(() => DOCUMENT_URLFilter);
431
                }
432
            }
433
        }
434

    
435
        static DateTime DefaultCreateTime = DateTime.Now;
436
        private DateTime _SelectedCreateTimeBegin = DefaultCreateTime;
437
        public DateTime SelectedCreateTimeBegin
438
        {
439

    
440
            get { return _SelectedCreateTimeBegin; }
441
            set
442
            {
443
                if (_SelectedCreateTimeBegin == value)
444
                    return;
445
                _SelectedCreateTimeBegin = value;
446
                OnPropertyChanged(() => SelectedCreateTimeBegin);
447

    
448
            }
449
        }
450

    
451
        private DateTime _SelectedCreateTimeEnd = DefaultCreateTime;
452
        public DateTime SelectedCreateTimeEnd
453
        {
454

    
455
            get { return _SelectedCreateTimeEnd; }
456
            set
457
            {
458
                if (_SelectedCreateTimeEnd == value)
459
                    return;
460
                _SelectedCreateTimeEnd = value;
461
                OnPropertyChanged(() => SelectedCreateTimeEnd);
462
            }
463
        }
464

    
465
        public bool _ConvertShow;
466
        public bool ConvertShow
467
        {
468
            get => _ConvertShow;
469
            set
470
            {
471
                if (_ConvertShow = !value)
472
                {
473
                    _ConvertShow = false;
474
                }
475
                _ConvertShow = value;
476
                OnPropertyChanged(() => ConvertShow);
477
            }
478
        }
479

    
480
        #endregion
481

    
482
        #region Command
483

    
484
        public DelegateCommand ConvertCommand { get; private set; }
485
        public DelegateCommand DeleteCommand { get; private set; }
486
        public DelegateCommand ValidateCommand { get; private set; }
487
        public DelegateCommand DataSaveFileGemBoxCommand { get; private set; }
488
        public DelegateCommand MarkusLinkCommand { get; private set; }
489
        public DelegateCommand RemoveCreateTimeFilterCommand { get; private set; }
490

    
491
        public DelegateCommand DataFilterCommand { get; private set; }
492
        public DelegateCommand ResetCommand { get; private set; }
493
        public DelegateCommand ConverAddCommand { get; private set; }
494

    
495
        #endregion
496

    
497
        #region Main Logic
498

    
499
        /// <summary>
500
        /// 각각의 Grid row 객체들 업데이트
501
        /// </summary>
502

    
503
        private DispatcherTimer dispatcherTimer;
504
        public override void Loaded()
505
        {
506
            base.Loaded();
507

    
508
            if (!App.IsDesignMode)
509
            {
510
                dispatcherTimer = new DispatcherTimer();
511
                dispatcherTimer.Tick += new EventHandler(Timer_Tick);
512
                dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
513
                dispatcherTimer.Start();
514
            }
515
        }
516

    
517
        private async void Timer_Tick(object sender, EventArgs e)
518
        {
519
            dispatcherTimer.Stop();
520

    
521
            if (IsAcitve)
522
            {
523
                await App.Current.Dispatcher.InvokeAsync(() =>
524
                {
525
                    DataSelect();
526

    
527
                    AliveDataSelect();
528
                });
529
            }
530

    
531
            //await Task.Delay(5000);
532
            await Task.Delay(10000);
533

    
534
            //System.Threading.Thread.Sleep(new TimeSpan(0,0,0,0,100));
535

    
536
            dispatcherTimer.Start();
537
        }
538

    
539
        public override void Closed()
540
        {
541
            if (dispatcherTimer != null)
542
            {
543
                dispatcherTimer.Stop();
544
            }
545

    
546
            base.Closed();
547
        }
548

    
549

    
550
        #endregion
551

    
552
        #region Function
553

    
554
        #region Data Select
555

    
556
        /// <summary>
557
        /// 상단 그리드 중앙 그리드 출력 데이터
558
        /// </summary>
559
        private void DataSelect()
560
        {
561

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

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

    
572
            /// combobox 에서 선택된 items
573
            if (SelectedStatus != null)
574
            {
575
                DataSelect(new[] { (StatusCodeType)(SelectedStatus.Value) }, FilterConvertSource);
576
            }
577

    
578
            /// 컨버터중인 items
579
            RealDataSelect(new[] { StatusCodeType.None, StatusCodeType.Wait, StatusCodeType.PageLoading, StatusCodeType.Saving }, RealConvertSource);
580

    
581
        }
582

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

    
591
                    foreach (var coll in collection)
592
                    {
593
                        var items = entities.SELECT_CONVERT_ITEM(coll.ConvertID, coll.ProjectNumber, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null,null).ToList();
594

    
595
                        foreach (var x in items)
596
                        {
597
                            var MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech");
598

    
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,
600
                                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
                            Listitems.Add(AddItem);
602
 
603
                        }
604
                    }
605

    
606
                    Listitems.ForEach(newitem =>
607
                    {
608
                        collection.UpdateWhere(changeitem =>
609
                        ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ConvertID == newitem.ConvertID && x.ProjectNumber == newitem.ProjectNumber);
610
                    });
611

    
612
                }
613
            }
614
            catch (Exception ex)
615
            {
616
                MessageBox.Show(ex.ToString());
617
            }
618
        }
619

    
620
        private void DataSelect(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertItem> collection)
621
        {
622
            try
623
            {
624
                using (markusEntities entities = new markusEntities(App.MarkusDataBaseConnecitonString))
625
                {
626

    
627
                    int _status = 0;
628
                    if (SelectedStatus != null)
629
                    {
630
                        _status = (int)SelectedStatus.Value;
631
                    }
632

    
633
                    var items = entities.SELECT_CONVERT_ITEM(null, null, null, _status, SelectedCount.ValueMember, null, null, null,
634
                        null, null, null, null, null, null, null, null, null, null).ToList();
635

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

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

    
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,
643
                            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
                        Listitems.Add(AddItem);
645

    
646
                    }
647

    
648
                    if (collection.Count() == 0)
649
                    {
650
                        if (statusCodeTypeList.Count() == 1)
651
                        {
652
                            Listitems.ForEach(x => collection.Add(x));
653
                        }
654
                    }
655
                    else
656
                    {
657

    
658
                        ////세미 업데이트
659
                        Listitems.ForEach(newitem =>
660
                        {
661
                            collection.UpdateWhere(changeitem =>
662
                            ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID);
663
                        });
664

    
665
                        if (statusCodeTypeList.Count() == 1)
666
                        {
667
                            //삭제
668
                            for (int i = collection.Count() - 1; i >= 0; --i)
669
                            {
670
                                var item = collection[i];
671

    
672
                                if (Listitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)//디비에서 가져온 값과 마지막값부터 차례대로 비교
673
                                {//참=> 0제외한 모든 수
674
                                    collection.RemoveAt(i);
675
                                }
676
                            }
677
                        }
678

    
679
                        if (statusCodeTypeList.Count() == 1)
680
                        {
681
                            //추가 convert 후 추가됨
682
                            foreach (var item in Listitems)
683
                            {
684
                                if (collection.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)//그리드와 디비 변동 없으면 안들어감
685
                                {
686
                                    /*for (int i = 0; i < collection.Count()+1; i++)//위 그리드에서 카운드 개수 변함 없고 컨버터 끝난 후 추가할때 createtime 비교 하며 order by 순으로 추가*/
687
                                    for (int i = 0; i < 200; i++)
688
                                    {
689
                                        if (i < collection.Count() - 1)
690
                                        {
691
                                            if (DateTime.Compare(collection[i].CreateTime, item.CreateTime) < 0)
692
                                            {
693
                                                collection.Insert(i, item);
694
                                                break;
695
                                            }
696
                                        }
697
                                        else
698
                                        {
699
                                            collection.Add(item);
700
                                            break;
701
                                        }
702
                                    }
703

    
704
                                }
705

    
706
                            }
707
                        }
708

    
709
                    }
710
                }
711

    
712
            }
713
            catch (Exception ex)
714
            {
715
                MessageBox.Show(ex.ToString());
716
                //System.Diagnostics.Debug.WriteLine(ex.ToString());
717
            }
718
        }
719

    
720
        private void DataSearch(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertItem> collection)
721
        {
722
            try
723
            {
724
                using (markusEntities entities = new markusEntities(App.MarkusDataBaseConnecitonString))
725
                {
726
                    int _status = 0;
727
                    if (SelectedStatus != null)
728
                    {
729
                        _status = (int)SelectedStatus.Value;
730
                    }
731

    
732
                    //DocumentID = unikey
733
                    DateTime? Start_CreateTime = null;
734
                    DateTime? Finish_CreateTime = null;
735
                    if(SelectedCreateTimeBegin != DefaultCreateTime)
736
                    {
737
                        Start_CreateTime = SelectedCreateTimeBegin;
738
                    }
739
                    if(SelectedCreateTimeEnd != DefaultCreateTime)
740
                    {
741
                        Finish_CreateTime = SelectedCreateTimeEnd;
742
                    }
743

    
744
                    var items = entities.SELECT_CONVERT_ITEM(null, ProjectNumberFilter, UniqueKeyFilter, _status, SelectedCount.ValueMember, Start_CreateTime, Finish_CreateTime, null,
745
                        null, null, null, GroupNOFilter, Document_NameFilter, Docuemnt_NOFilter, RevisionFilter, Service_IDFilter, ReconverterFilter, DOCUMENT_URLFilter).ToList();
746

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

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

    
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,
754
                            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
                        Listitems.Add(AddItem);
756

    
757
                    }
758

    
759
                    if (collection.Count() == 0)
760
                    {
761
                        if (statusCodeTypeList.Count() == 1)
762
                        {
763
                            foreach (var x in Listitems)
764
                            {
765
                                collection.Add(x);
766
                            }
767
                        }
768
                    }
769
                    else
770
                    {
771

    
772
                        ////세미 업데이트
773
                        foreach (var newitem in Listitems)
774
                        {
775
                            collection.UpdateWhere(changeitem =>
776
                            ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID);
777
                        }
778

    
779

    
780
                        if (statusCodeTypeList.Count() == 1)
781
                        {
782

    
783
                            //삭제
784
                            for (int i = collection.Count() - 1; i >= 0; --i)
785
                            {
786
                                var item = collection[i];
787

    
788
                                if (Listitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
789
                                {
790
                                    collection.RemoveAt(i);
791
                                }
792
                            }
793
                        }
794

    
795
                        if (statusCodeTypeList.Count() == 1)
796
                        {
797
                            //추가 convert 후 추가됨
798
                            foreach (var item in Listitems)
799
                            {
800
                                if (collection.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
801
                                {
802
                                    for (int i = 0; i < 200; i++)
803
                                    {
804
                                        if (i < collection.Count() - 1)
805
                                        {
806
                                            if (DateTime.Compare(collection[i].CreateTime, item.CreateTime) < 0)
807
                                            {
808
                                                collection.Insert(i, item);
809
                                                break;
810
                                            }
811
                                        }
812
                                        else
813
                                        {
814
                                            collection.Add(item);
815
                                            break;
816
                                        }
817
                                    }
818

    
819
                                }
820

    
821
                            }
822
                        }
823

    
824
                    }
825

    
826
                }
827

    
828
            }
829
            catch (Exception ex)
830
            {
831
                MessageBox.Show(ex.ToString());
832
                //System.Diagnostics.Debug.WriteLine(ex.ToString());
833
            }
834
        }
835
        /// <summary>
836
        /// 서비스의 실시간 컨버터 Item
837
        /// </summary>
838
        private async void AliveDataSelect()
839
        {
840
            try
841
            {
842
                List<ConvertItem> newitems = new List<ConvertItem>();
843
                foreach (var client in App.StationClientList)
844
                {
845
                    if (await SimplePingAsync(client.Endpoint.Address.ToString()))
846
                    {
847
                        try
848
                        {
849
                            List<ConvertItem> itemsToList = new List<ConvertItem>();
850
                            var items = await client.AliveConvertListAsync();
851
                            string result = "";
852

    
853
                            foreach (var item in items)
854
                            {
855
                                ConvertItem itemsToEach = new ConvertItem();
856
                                itemsToEach.ServiceID = item.ServiceID;
857
                                itemsToEach.ConvertID = item.ConvertID;
858
                                itemsToEach.ProjectNumber = item.ProjectNumber;
859

    
860
                                var MarkusLink = "kcom://" + CreateMarkusParam(item.ProjectNumber, item.DocumentID, "doftech");
861

    
862
                                if (item.ConvertState != null)
863
                                {
864
                                    itemsToEach.ConvertState = (StatusCodeType)Enum.Parse(typeof(StatusCodeType), item.ConvertState);
865
                                }
866

    
867
                                if (item.OriginfilePath.Contains("/"))
868
                                {
869
                                    result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("/") + 1);
870
                                }
871
                                else
872
                                {
873
                                    result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("%") + 1);
874
                                }
875
                                itemsToEach.FileName = result;
876

    
877
                                itemsToEach.CurrentPageNo = item.CurrentPageNo;
878
                                itemsToEach.TotalPage = item.TotalPage;
879
                                itemsToEach.OriginfilePath = item.OriginfilePath;
880
                                itemsToEach.ConvertPath = item.ConvertPath;
881
                                itemsToEach.MarkusLink = MarkusLink;
882
                                itemsToEach.UniqueKey = item.UniqueKey;//DocumentNO 없음
883
                                itemsToEach.GroupNo = item.GroupNo;//없음 
884
                                itemsToEach.ProcessorAffinity = item.ProcessorAffinity;
885
                                itemsToEach.DocumentName = item.DocumnetName;
886
                                itemsToEach.Revision = item.Revision; //없음 
887
                                itemsToEach.Exception = item.Exception;//없음
888
                                itemsToEach.ConvertPath = item.ConvertPath;
889
                                itemsToEach.CreateTime = item.CreateTime;
890
                                itemsToEach.ReConverter = item.ReConverter;
891
                                itemsToEach.DocumentID = item.DocumentID;
892
                                itemsToEach.StartTime = item.StartTime;
893
                                itemsToEach.EndTime = item.EndTime;
894

    
895
                                itemsToList.Add(itemsToEach);
896
                            }
897
                            newitems.AddRange(itemsToList);
898
                            System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} ping");
899

    
900
                            if (items.Count() == 0)
901
                            {
902
                                System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} Alive Items is zero.");
903
                            }
904
                        }
905
                        catch (Exception ex)
906
                        {
907
                            System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} {ex.Message}");
908
                        }
909
                    }
910
                    else
911
                    {
912
                        System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} ping Error");
913
                    }
914

    
915
                }
916
                ItemsUpdate(newitems);
917
                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
            }
998
            catch (Exception ex)
999
            {
1000
                System.Diagnostics.Debug.WriteLine(ex.ToString());
1001
            }
1002
        }
1003

    
1004
        /// <summary>
1005
        /// AliveDataSelect의 Data Update
1006
        /// </summary>
1007
        /// <param name="newitems"></param>
1008
        private void ItemsUpdate(List<ConvertItem> newitems)
1009
        {
1010

    
1011
            foreach (var item in newitems)
1012
            {
1013
                item.OriginfilePath = HttpUtility.UrlDecode(item.OriginfilePath);
1014
            }
1015

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

    
1020
                foreach (var item in newitems)
1021
                {
1022
                    AliveItems.Add(item);
1023
                }
1024
            }
1025
            else
1026
            {
1027
                /// 데이터 업데이트
1028
                newitems.ForEach(newitem =>
1029
                {
1030
                    AliveItems.UpdateWhere(changeitem => ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID);
1031
                });
1032

    
1033
                // 추가
1034
                foreach (var item in newitems)
1035
                {
1036
                    if (AliveItems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
1037
                    {
1038
                        AliveItems.Add(item);
1039
                    }
1040
                }
1041

    
1042
                /// 삭제
1043

    
1044
                for (int i = AliveItems.Count() - 1; i > -1; --i)
1045
                {
1046
                    var item = AliveItems[i];
1047

    
1048
                    if (newitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
1049
                    {
1050
                        try
1051
                        {
1052
                            AliveItems.RemoveAt(i);
1053
                        }
1054
                        catch (Exception ex)
1055
                        {
1056
                            System.Diagnostics.Debug.WriteLine(ex.ToString());
1057
                        }
1058
                    }
1059
                }
1060
            }
1061
        }
1062

    
1063

    
1064
        public static async Task<bool> SimplePingAsync(string uri)
1065
        {
1066
            bool result = false;
1067

    
1068
            try
1069
            {
1070
                using (System.Net.Http.HttpClient Client = new System.Net.Http.HttpClient())
1071
                {
1072
                    Client.Timeout = new TimeSpan(0, 0, 60);
1073

    
1074
                    var message = await Client.GetAsync(uri);
1075

    
1076
                    System.Net.HttpStatusCode StatusCode = message.StatusCode;
1077

    
1078
                    switch (StatusCode)
1079
                    {
1080

    
1081
                        case System.Net.HttpStatusCode.Accepted:
1082
                        case System.Net.HttpStatusCode.OK:
1083
                            result = true;
1084
                            break;
1085
                    }
1086
                }
1087
            }
1088
            catch (Exception ex)
1089
            {
1090
                result = false;
1091
                System.Diagnostics.Debug.WriteLine(ex.ToString());
1092
            }
1093

    
1094
            return result;
1095
        }
1096

    
1097
        #endregion
1098

    
1099
        #region Data Convert
1100

    
1101
        private void DataConvert(object obj)
1102
        {
1103
            if (SelectFilterConvert == null && SelectRealConvert == null)
1104
            {
1105
                MessageBox.Show("왼쪽 버튼 클릭 후 Converter 해주세요!");
1106
            }
1107
            else
1108
            {
1109
                var resultRealConvert = 0;
1110
                var resultFiltertConvert = 0;
1111

    
1112
                if (SelectRealConvert != null)
1113
                {
1114
                    resultRealConvert = SetCleanUpItem(SelectRealConvert);//ConvertDataBase
1115
                }
1116
                else if (SelectFilterConvert != null)
1117
                {
1118
                    resultFiltertConvert = SetCleanUpItem(SelectFilterConvert);
1119
                }
1120
                System.Diagnostics.Debug.WriteLine(resultRealConvert + "  " + resultFiltertConvert);
1121

    
1122
                using (markusEntities entities = new markusEntities(App.MarkusDataBaseConnecitonString))
1123
                {
1124

    
1125
                    var items = entities.SELECT_CONVERT_ITEM(SelectFilterConvert.ConvertID, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null); //프로시저 이용
1126

    
1127

    
1128
                    foreach (var x in items)
1129
                    {
1130
                        var MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech");
1131

    
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
1133
                             , x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
1134

    
1135
                        RealConvertSource.Add(AddItem);
1136

    
1137
                        if (RealConvertSource.Count() == 1)
1138
                        {
1139
                            ConvertShow = true;
1140
                        }
1141
                    }
1142

    
1143
                }
1144
            }
1145
        }
1146

    
1147

    
1148
        public int SetCleanUpItem(ConvertItem _ConvertItem)
1149
        {
1150
            using (markusEntities entities = new markusEntities(App.MarkusDataBaseConnecitonString))
1151
            {
1152
                int result = 0;
1153

    
1154
                var items = entities.SELECT_CONVERT_ITEM(_ConvertItem.ConvertID, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null).ToList();
1155

    
1156
                if (items.Count() > 0)
1157
                {
1158
                    var item = items.First();
1159

    
1160
                    var _RECONVERTER = item.RECONVERTER - _ConvertItem.ReConverter;
1161
                    var _CREATE_DATETIME = DateTime.Now;
1162
                    var _STATUS = (int)StatusCodeType.None;
1163

    
1164
                  entities.SELECT_RERECONVERT_ITEM(_ConvertItem.ConvertID, _RECONVERTER, _CREATE_DATETIME, _STATUS, null);//_END_DATETIME = null 에러
1165

    
1166
                }
1167

    
1168
                return result;
1169
            }
1170
        }
1171

    
1172

    
1173
        public static string CreateMarkusParam(string projectNo, string documentID, string userID)
1174
        {
1175
            ViewInfo viewInfo = new ViewInfo();
1176

    
1177
            viewInfo.DocumentItemID = documentID;
1178
            viewInfo.ProjectNO = projectNo;
1179
            viewInfo.UserID = userID;
1180

    
1181
            return ParamEncoding(JsonConvert.SerializeObject(viewInfo));
1182

    
1183
        }
1184

    
1185
        public static string ParamEncoding(string EncodingText, System.Text.Encoding oEncoding = null)
1186
        {
1187

    
1188
            if (oEncoding == null)
1189
                oEncoding = System.Text.Encoding.UTF8;
1190

    
1191
            return Convert.ToBase64String(oEncoding.GetBytes(EncodingText));
1192

    
1193
        }
1194

    
1195

    
1196
        #endregion
1197

    
1198
        #region Validation
1199

    
1200
        private void DataValidate(object obj)
1201
        {
1202

    
1203
            bool result = false;
1204

    
1205
            WebRequest webRequest = WebRequest.Create(SelectFilterConvert.OriginfilePath);
1206
            webRequest.Timeout = 1200; // miliseconds
1207
            webRequest.Method = "HEAD";
1208

    
1209
            HttpWebResponse response = null;
1210

    
1211
            try
1212
            {
1213
                response = (HttpWebResponse)webRequest.GetResponse();
1214
                result = true;
1215
            }
1216
            catch (WebException webException)
1217
            {
1218
                MessageBox.Show(SelectFilterConvert.FileName + " doesn't exist: " + webException.Message);
1219
                result = true;
1220
            }
1221
            finally
1222
            {
1223
                if (response != null)
1224
                {
1225
                    response.Close();
1226
                }
1227
            }
1228
            if (result == true)
1229
            {
1230
                MessageBox.Show("File exists");
1231
            }
1232
        }
1233

    
1234
        #endregion
1235

    
1236
        #region DataFilter
1237

    
1238
        public void DataFilter(object obj)
1239
        {
1240
            dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1241
            DataSearch(new[] { (StatusCodeType)(SelectedStatus.Value) }, FilterConvertSource);
1242
        }
1243

    
1244
        #endregion
1245

    
1246
        #region MarkusLink
1247

    
1248
        private void MarkusLink(object obj)///여기서 부터 
1249
        {
1250
            if (obj is ConvertItem)
1251
            {
1252
                if (obj != null)
1253
                {
1254
                    var convertitem = obj as ConvertItem;
1255

    
1256
                    SelectFilterConvert = convertitem;
1257

    
1258
                    SelectRealConvert = convertitem;
1259

    
1260
                    ProcessStartInfo startInfo = null;
1261

    
1262
                    startInfo = new ProcessStartInfo("iexplore.exe", convertitem.MarkusLink);
1263

    
1264
                    Process.Start(startInfo);
1265
                }
1266
            }
1267
        }
1268

    
1269
        #endregion
1270

    
1271
        #region Data Delete
1272

    
1273
        private void DataDelete(object obj)
1274
        {
1275
            RadWindow.Alert("do you want to delete it??", this.OnClosed);
1276
        }
1277

    
1278
        private void OnClosed(object sender, WindowClosedEventArgs e)
1279
        {
1280
            using (markusEntities entities = new markusEntities(App.MarkusDataBaseConnecitonString))
1281
            {
1282
                var result = e.DialogResult;
1283
                if (result == true)
1284
                {
1285
                    if (SelectRealConvert != null)
1286
                    {
1287
                        entities.SELECT_CONVERT_DELETE(SelectRealConvert.ConvertID);
1288
                    }
1289
                    if (SelectFilterConvert != null)
1290
                    {
1291
                        entities.SELECT_CONVERT_DELETE(SelectFilterConvert.ConvertID);
1292
                    }
1293
                }
1294
            }
1295
        }
1296

    
1297

    
1298
        #endregion
1299

    
1300
        #region Data Export
1301

    
1302

    
1303
        /// <summary>
1304
        /// 필터된 상단 그리드 엑셀로 출력
1305
        /// </summary>
1306

    
1307
        public void DataExportData(object obj)
1308
        {
1309
            SaveFileDialog saveFileDialog = new SaveFileDialog();
1310

    
1311
            saveFileDialog.FileName = "Document"; // Default file name
1312
            saveFileDialog.DefaultExt = ".txt"; // Default file extension
1313
            saveFileDialog.Filter = "Csv documents (.Csv)|*.csv|Excel(2017~2019)Worksheets|*.xlsx"; // Filter files by extension
1314

    
1315

    
1316
            if (saveFileDialog.ShowDialog() == true)
1317
            {
1318

    
1319

    
1320
                if (!string.IsNullOrWhiteSpace(saveFileDialog.FileName))
1321
                {
1322

    
1323
                    var extension = new System.IO.FileInfo(saveFileDialog.FileName).Extension;
1324

    
1325
                    if (extension == ".xlsx" || extension == ".csv")
1326
                    {
1327

    
1328
                        var headers = new List<HeaderMember>
1329
                        {
1330
                            new HeaderMember{HeaderName = "ServiceID", Property = "ServiceID" },
1331
                            new HeaderMember{HeaderName = "ConvertID", Property = "ConvertID" },
1332
                            new HeaderMember{HeaderName = "ProjectNumber", Property = "ProjectNumber" },
1333
                            new HeaderMember{HeaderName = "ConvertState", Property = "ConvertState" },
1334
                            new HeaderMember{HeaderName = "CurrentPageNo", Property = "CurrentPageNo" },
1335
                            new HeaderMember{HeaderName = "TotalPage", Property = "TotalPage" },
1336
                            new HeaderMember{HeaderName = "OriginfilePath", Property = "OriginfilePath" },
1337
                            new HeaderMember{HeaderName = "ConvertPath", Property = "ConvertPath" },
1338
                            new HeaderMember{HeaderName = "CreateTime", Property = "CreateTime" },
1339
                            new HeaderMember{HeaderName = "Exception", Property = "Exception" },
1340
                            new HeaderMember{HeaderName = "ProcessorAffinity", Property = "ProcessorAffinity" },
1341
                            new HeaderMember{HeaderName = "ReConverter", Property = "ReConverter" },
1342
                            new HeaderMember{HeaderName = "UniqueKey", Property = "UniqueKey" }
1343
                        };
1344

    
1345

    
1346
                        DataExport dataExport = new DataExport();
1347
                        dataExport.DataExportExcel(saveFileDialog.FileName, "Hello world", FilterConvertSource, headers);
1348
                    }
1349
                }
1350
            }
1351
        }
1352

    
1353
        #endregion
1354

    
1355
        #region Data Search
1356

    
1357
        public void RemoveCreateTimeFilter(object obj)
1358
        {
1359
            DefaultCreateTime = DateTime.Now;
1360
            SelectedCreateTimeBegin = DefaultCreateTime;
1361
            SelectedCreateTimeEnd = DefaultCreateTime;
1362
        }
1363

    
1364
        #endregion
1365

    
1366
        #region Reset
1367

    
1368
        /// <summary>
1369
        /// 그리드 상단 원상복귀 버튼
1370
        /// 필터를 끝낸 후 다시 복귀
1371
        /// </summary>
1372

    
1373
        public void Reset(object obj)
1374
        {
1375
            ProjectNumberFilter = null;
1376
            UniqueKeyFilter = null;
1377
            Service_IDFilter = null;
1378
            Document_NameFilter = null;
1379
            Docuemnt_NOFilter = null;
1380
            ReconverterFilter = null;
1381
            RevisionFilter = null;
1382
            GroupNOFilter = null;
1383
            DOCUMENT_URLFilter = null;
1384
            DefaultCreateTime = DateTime.Now;
1385
            SelectedCreateTimeBegin = DefaultCreateTime;
1386
            SelectedCreateTimeEnd = DefaultCreateTime;
1387
            dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1388
        }
1389

    
1390
        #endregion
1391

    
1392

    
1393
        #region ConvertAddDialog
1394

    
1395
        /// <summary>
1396
        /// 그리드 상단 Conver 추가 버튼
1397
        /// ProjectNo, DocumentURL, DocumentID, 입력해서 저장 프로시저에서 추가 
1398
        /// </summary>
1399

    
1400
        public void ConverAdd(object obj)
1401
        {
1402
            dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1403

    
1404
            Views.ConvertAddDialog convertAddDialog = new Views.ConvertAddDialog();
1405

    
1406
            convertAddDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
1407

    
1408
            convertAddDialog.ShowDialog();
1409

    
1410
            dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1411
        }
1412

    
1413
        #endregion
1414

    
1415
        #endregion
1416
    }
1417
}
1418

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