프로젝트

일반

사용자정보

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

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

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

1 31beca73 semi
using Markus.Service.Extensions;
2 e6281033 alzkakdixm
using Markus.Service.StationController.Data;
3 a6e5055d alzkakdixm
using Markus.Service.StationController.Behaviors;
4
using Markus.Service.StationController.Extensions;
5 b63dcfbb semi
using Markus.Service.StationController.Controls;
6 a6e5055d alzkakdixm
using Microsoft.Win32;
7
using System;
8
using System.Collections.Generic;
9
using System.ComponentModel;
10
using System.Linq;
11 2decfbdf alzkakdixm
using System.Threading.Tasks;
12
using System.Web;
13 a6e5055d alzkakdixm
using System.Windows;
14
using Telerik.Windows.Controls;
15
using Telerik.Windows.Data;
16 e6281033 alzkakdixm
using System.Net;
17
using System.Windows.Threading;
18 e78f0871 alzkakdixm
using System.Diagnostics;
19
using System.Windows.Input;
20
using Markus.Mvvm.ToolKit;
21 902f397c semi
using System.Windows.Data;
22 85f68fef semi
using System.Windows.Controls;
23 3bde451b semi
using System.IO;
24 2c634aed semi
using Newtonsoft.Json;
25 2f07b70a semi
using static Markus.Service.StationController.Data.ConvertPDF;
26 80391351 semi
using System.Collections.ObjectModel;
27 f5ec88b8 semi
using Markus.Service;
28 a6e5055d alzkakdixm
29
namespace Markus.Service.StationController.ViewModel
30
{
31
    //세미
32 dfc86b71 taeseongkim
    public class DataBaseItemsModel : Mvvm.ToolKit.ViewModelBase
33 a6e5055d alzkakdixm
    {
34 e6281033 alzkakdixm
        #region Constructor
35
36
        /// <summary>
37
        /// 실행하면 처음 들어가는 부분
38
        /// </summary>
39
        public DataBaseItemsModel()
40
        {
41 b63dcfbb semi
            DataFilterCommand = new DelegateCommand(DataFilter);
42 e6281033 alzkakdixm
            DataSaveFileGemBoxCommand = new DelegateCommand(DataExportData);
43
            ConvertCommand = new DelegateCommand(DataConvert);
44
            DeleteCommand = new DelegateCommand(DataDelete);
45
            ValidateCommand = new DelegateCommand(DataValidate);
46 e78f0871 alzkakdixm
            MarkusLinkCommand = new DelegateCommand(MarkusLink);
47 5a954acc semi
            RemoveCreateTimeFilterCommand = new DelegateCommand(RemoveCreateTimeFilter);
48 b63dcfbb semi
            ResetCommand = new DelegateCommand(Reset);
49 037ab674 semi
            ConvertAddCommand = new DelegateCommand(ConvertAdd);
50 78683624 semi
            ConvertPathFileSearchCommand = new DelegateCommand(ConvertPathFileSearch);
51 f5ec88b8 semi
            Stop_ProcessCommand = new DelegateCommand(Stop_Process);
52 aaed7be2 semi
            EnterCommand = new DelegateCommand(Enter);
53 f047c8bf semi
            DocumentFilterCommand = new DelegateCommand(DocumentFilter);
54 e6281033 alzkakdixm
        }
55
56
        #endregion
57
58
        #region Properties
59
60 037ab674 semi
        DataService.DataServiceClient WcfClient = new DataService.DataServiceClient();
61
62 e139272d semi
        public ObservableCollection<ProjectName> _ProjectNames;
63
        public ObservableCollection<ProjectName> ProjectNames
64
        {
65
            get
66
            {
67
                if (_ProjectNames == null)
68
                {
69
                    _ProjectNames = new System.Collections.ObjectModel.ObservableCollection<ProjectName>();
70
                }
71
72
                return _ProjectNames;
73
            }
74
            set
75
            {
76
                _ProjectNames = value;
77
                OnPropertyChanged(() => ProjectNames);
78
            }
79
        }
80
81 037ab674 semi
        private bool _ExcptionCheck = false;
82
        public bool ExcptionCheck
83
        {
84
            get
85
            {
86
                return _ExcptionCheck;
87
            }
88
            set
89
            {
90
                _ExcptionCheck = value;
91
                OnPropertyChanged(() => ExcptionCheck);
92
            }
93
        }
94
95 2f07b70a semi
        private System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _FilterSearch;
96
        public System.Collections.ObjectModel.ObservableCollection<ConvertPDF> FilterSearch
97 b63dcfbb semi
        {
98
            get
99
            {
100
                if (_FilterSearch == null)
101
                {
102 2f07b70a semi
                    _FilterSearch = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>
103 b63dcfbb semi
                    {
104 2f07b70a semi
                        new ConvertPDF{ProjectNumber = "Filter Search"}
105 b63dcfbb semi
                    };
106
                }
107
108
                return _FilterSearch;
109
            }
110
        }
111
112 2f07b70a semi
        private System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _AliveItems;
113
        public System.Collections.ObjectModel.ObservableCollection<ConvertPDF> AliveItems
114 2decfbdf alzkakdixm
        {
115 e6281033 alzkakdixm
            get => _AliveItems;
116
            set
117 2decfbdf alzkakdixm
            {
118 0cb12397 alzkakdixm
                _AliveItems = value;
119 2decfbdf alzkakdixm
                OnPropertyChanged(() => AliveItems);
120
            }
121
        }
122
123 5a954acc semi
        public ICollectionView FilterConvertSourceView
124
        {
125 b63dcfbb semi
            get
126
            {
127
                var view = CollectionViewSource.GetDefaultView(FilterConvertSource);
128
                return view;
129
            }
130 5a954acc semi
        }
131
132 037ab674 semi
        private static System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _ConvertSource;
133
        public static System.Collections.ObjectModel.ObservableCollection<ConvertPDF> ConvertSource
134
        {
135
            get
136
            {
137
                if (_ConvertSource == null)
138
                {
139
                    _ConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
140
                }
141
                return _ConvertSource;
142
            }
143
            set
144
            {
145
                _ConvertSource = value;
146
            }
147
        }
148
149 2f07b70a semi
        private System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _FilterConvertSource;
150
        public System.Collections.ObjectModel.ObservableCollection<ConvertPDF> FilterConvertSource
151 dfc86b71 taeseongkim
        {
152 902f397c semi
            get
153
            {
154 5a954acc semi
                if (_FilterConvertSource == null)
155
                {
156 2f07b70a semi
                    _FilterConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
157 5a954acc semi
                }
158 902f397c semi
                return _FilterConvertSource;
159
            }
160 dfc86b71 taeseongkim
            set
161
            {
162
                _FilterConvertSource = value;
163 f0ad40d3 semi
                OnPropertyChanged(() => FilterConvertSource);
164 dfc86b71 taeseongkim
            }
165
        }
166
167 2f07b70a semi
        private System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _RealConvertSource;
168
        public System.Collections.ObjectModel.ObservableCollection<ConvertPDF> RealConvertSource
169 dfc86b71 taeseongkim
        {
170
            get => _RealConvertSource;
171
            set
172
            {
173
                _RealConvertSource = value;
174
                OnPropertyChanged(() => RealConvertSource);
175
            }
176
        }
177
178 2decfbdf alzkakdixm
179 0cb12397 alzkakdixm
        private System.Windows.Documents.FlowDocument connectionLog;
180 2decfbdf alzkakdixm
        public System.Windows.Documents.FlowDocument ConnectionLog
181
        {
182
            get => connectionLog;
183
            set
184
            {
185
                if (connectionLog != value)
186
                {
187
                    connectionLog = value;
188
                    OnPropertyChanged(() => ConnectionLog);
189
                }
190
            }
191
        }
192
193 a6e5055d alzkakdixm
194 037ab674 semi
        private int _SelectedInt = 4;
195
        public int SelectedInt
196
        {
197
            get => _SelectedInt;
198
            set
199
            {
200
                _SelectedInt = value;
201
                OnPropertyChanged(() => SelectedInt);
202
            }
203
        }
204
205 a6e5055d alzkakdixm
        private Telerik.Windows.Data.EnumMemberViewModel _SelectedStatus;
206
        public Telerik.Windows.Data.EnumMemberViewModel SelectedStatus
207
        {
208
            get => _SelectedStatus;
209
            set
210
            {
211
                _SelectedStatus = value;
212 0cb12397 alzkakdixm
                OnPropertyChanged(() => SelectedStatus);
213 a6e5055d alzkakdixm
            }
214
        }
215
216
217
        private SelectedCountItem _SelectedCount;
218
        public SelectedCountItem SelectedCount
219
        {
220
            get => _SelectedCount;
221
            set
222
            {
223
                _SelectedCount = value;
224 dfc86b71 taeseongkim
                OnPropertyChanged(() => SelectedCount);
225 a6e5055d alzkakdixm
            }
226
        }
227
228 e6281033 alzkakdixm
        List<SelectedCountItem> _SelectedCountList;
229
        public List<SelectedCountItem> SelectedCountList
230 a6e5055d alzkakdixm
        {
231 e6281033 alzkakdixm
            get
232 2decfbdf alzkakdixm
            {
233 e6281033 alzkakdixm
                if (_SelectedCountList == null)
234 2decfbdf alzkakdixm
                {
235 e6281033 alzkakdixm
                    _SelectedCountList = new List<SelectedCountItem>
236 2decfbdf alzkakdixm
                    {
237 e6281033 alzkakdixm
                        new SelectedCountItem{DisplayMember = "50",ValueMember = 50},
238
                        new SelectedCountItem{DisplayMember = "100",ValueMember = 100},
239
                        new SelectedCountItem{DisplayMember = "150",ValueMember = 150},
240
                        new SelectedCountItem{DisplayMember = "200",ValueMember = 200}
241
                    };
242 2decfbdf alzkakdixm
                }
243 a6e5055d alzkakdixm
244 e6281033 alzkakdixm
                return _SelectedCountList;
245 2decfbdf alzkakdixm
            }
246
        }
247 a6e5055d alzkakdixm
248 2f07b70a semi
        private ConvertPDF _SelectFilterConvert;
249
        public ConvertPDF SelectFilterConvert
250 a6e5055d alzkakdixm
        {
251 80391351 semi
            get
252
            {
253
                return _SelectFilterConvert;
254
            }
255 a6e5055d alzkakdixm
            set
256
            {
257
                _SelectFilterConvert = value;
258 dfc86b71 taeseongkim
                OnPropertyChanged(() => SelectFilterConvert);
259 a6e5055d alzkakdixm
            }
260
        }
261 0cb12397 alzkakdixm
262 80391351 semi
263
        private ObservableCollection<ConvertPDF> _SelectFilterConvertList;
264
        public ObservableCollection<ConvertPDF> SelectFilterConvertList
265
        {
266
            get
267
            {
268
                if (_SelectFilterConvertList == null)
269
                {
270
                    _SelectFilterConvertList = new ObservableCollection<ConvertPDF>();
271 944a39ed semi
272
                    _SelectFilterConvertList.CollectionChanged += (snd, ect) =>
273
                      {
274
                          System.Diagnostics.Debug.WriteLine($"_SelectFilterConvertList : {_SelectFilterConvertList.Count()}");
275
                      };
276 80391351 semi
                }
277
                return _SelectFilterConvertList;
278
            }
279
            set
280
            {
281
                _SelectFilterConvertList = value;
282
                OnPropertyChanged(() => SelectFilterConvertList);
283
            }
284
        }
285
286
287
288 2f07b70a semi
        private ConvertPDF _SelectRealConvert;
289
        public ConvertPDF SelectRealConvert
290 a6e5055d alzkakdixm
        {
291
            get => _SelectRealConvert;
292
            set
293
            {
294
                _SelectRealConvert = value;
295 dfc86b71 taeseongkim
                OnPropertyChanged(() => SelectRealConvert);
296 a6e5055d alzkakdixm
            }
297
        }
298
299 0cb12397 alzkakdixm
300 2f07b70a semi
        private ConvertPDF _SelectAliveConvert;
301
        public ConvertPDF SelectAliveConvert
302 8c128693 semi
        {
303
            get => _SelectAliveConvert;
304
            set
305
            {
306
                _SelectAliveConvert = value;
307
                OnPropertyChanged(() => SelectAliveConvert);
308
            }
309
        }
310
311
312 0cb12397 alzkakdixm
        private StatusTypeList _StatusType;
313 a6e5055d alzkakdixm
        public StatusTypeList StatusType
314
        {
315
            get => _StatusType;
316
            set
317
            {
318
                _StatusType = value;
319 dfc86b71 taeseongkim
                OnPropertyChanged(() => StatusType);
320 a6e5055d alzkakdixm
            }
321
        }
322
323 0cb12397 alzkakdixm
        private bool _IsLoading;
324 a6e5055d alzkakdixm
        public bool IsLoading
325
        {
326
            get => _IsLoading;
327
            set
328
            {
329
                if (_IsLoading != value)
330
                {
331
                    _IsLoading = value;
332 dfc86b71 taeseongkim
                    OnPropertyChanged(() => IsLoading);
333 a6e5055d alzkakdixm
                }
334
            }
335
        }
336
337 e6281033 alzkakdixm
        IEnumerable<Telerik.Windows.Data.EnumMemberViewModel> _StatusCodeList;
338
        public IEnumerable<Telerik.Windows.Data.EnumMemberViewModel> StatusCodeList
339 a6e5055d alzkakdixm
        {
340
            get
341
            {
342 e6281033 alzkakdixm
                if (_StatusCodeList == null)
343 a6e5055d alzkakdixm
                {
344 e6281033 alzkakdixm
                    _StatusCodeList = Telerik.Windows.Data.EnumDataSource.FromType<StatusCodeType>();
345 a6e5055d alzkakdixm
                }
346
347 e6281033 alzkakdixm
                return _StatusCodeList;
348 a6e5055d alzkakdixm
            }
349
        }
350 8c7d1ea1 alzkakdixm
351 e139272d semi
        public ProjectName _ProjectNumberFilter;
352
        public ProjectName ProjectNumberFilter
353 902f397c semi
        {
354 e139272d semi
            get
355 902f397c semi
            {
356 e139272d semi
                if (_ProjectNumberFilter == null)
357 902f397c semi
                {
358 e139272d semi
                    _ProjectNumberFilter = new ProjectName();
359 902f397c semi
                }
360 e139272d semi
                return _ProjectNumberFilter;
361
            }
362
            set
363
            {
364
                _ProjectNumberFilter = value;
365
                OnPropertyChanged(() => ProjectNumberFilter);
366 902f397c semi
            }
367
        }
368
369
        public string _UniqueKeyFilter;
370
        public string UniqueKeyFilter
371
        {
372 b63dcfbb semi
            get
373
            {
374
                return _UniqueKeyFilter;
375
            }
376 902f397c semi
            set
377
            {
378 b63dcfbb semi
                if (_UniqueKeyFilter == "")
379
                {
380
                    _UniqueKeyFilter = null;
381
                }
382
                else if (_UniqueKeyFilter != value)
383 902f397c semi
                {
384
                    _UniqueKeyFilter = value;
385
                    OnPropertyChanged(() => UniqueKeyFilter);
386
                }
387
            }
388
        }
389
390 5a954acc semi
        public StatusCodeType _ConvertStateFilter;
391
        public StatusCodeType ConvertStateFilter
392 902f397c semi
        {
393
            get { return _ConvertStateFilter; }
394
            set
395
            {
396
                if (_ConvertStateFilter != value)
397
                {
398
                    _ConvertStateFilter = value;
399
                    OnPropertyChanged(() => ConvertStateFilter);
400
                }
401
            }
402
        }
403
404
        public string _Docuemnt_NOFilter;
405
        public string Docuemnt_NOFilter
406
        {
407
            get { return _Docuemnt_NOFilter; }
408
            set
409
            {
410 b63dcfbb semi
                if (_Docuemnt_NOFilter == "")
411
                {
412
                    _Docuemnt_NOFilter = null;
413
                }
414
                else if (_Docuemnt_NOFilter != value)
415 902f397c semi
                {
416
                    _Docuemnt_NOFilter = value;
417
                    OnPropertyChanged(() => Docuemnt_NOFilter);
418
                }
419
            }
420
        }
421
422 3bde451b semi
        public string _Document_NameFilter;
423
        public string Document_NameFilter
424 902f397c semi
        {
425 3bde451b semi
            get { return _Document_NameFilter; }
426 902f397c semi
            set
427
            {
428 3bde451b semi
                if (_Document_NameFilter == "")
429 b63dcfbb semi
                {
430 3bde451b semi
                    _Document_NameFilter = null;
431 b63dcfbb semi
                }
432 3bde451b semi
                else if (_Document_NameFilter != value)
433 902f397c semi
                {
434 3bde451b semi
                    _Document_NameFilter = value;
435
                    OnPropertyChanged(() => Document_NameFilter);
436 902f397c semi
                }
437
            }
438
        }
439
440 b63dcfbb semi
        public int? _ReconverterFilter = 0;
441 5a954acc semi
        public int? ReconverterFilter
442 902f397c semi
        {
443
            get { return _ReconverterFilter; }
444
            set
445
            {
446 85f68fef semi
                if (_ReconverterFilter == null)
447 b63dcfbb semi
                {
448
                    _ReconverterFilter = 0;
449
                }
450
                else if (_ReconverterFilter != value)
451 902f397c semi
                {
452
                    _ReconverterFilter = value;
453
                    OnPropertyChanged(() => ReconverterFilter);
454 5a954acc semi
455 902f397c semi
                }
456
            }
457
        }
458
459
        public string _Service_IDFilter;
460
        public string Service_IDFilter
461
        {
462
            get { return _Service_IDFilter; }
463
            set
464
            {
465 b63dcfbb semi
                if (_Service_IDFilter == "")
466
                {
467
                    _Service_IDFilter = null;
468
                }
469 85f68fef semi
                else if (_Service_IDFilter != value)
470 902f397c semi
                {
471
                    _Service_IDFilter = value;
472
                    OnPropertyChanged(() => Service_IDFilter);
473
                }
474
            }
475
        }
476
477
        public string _RevisionFilter;
478
        public string RevisionFilter
479
        {
480
            get { return _RevisionFilter; }
481
            set
482
            {
483 b63dcfbb semi
                if (_RevisionFilter == "")
484
                {
485 85f68fef semi
                    _RevisionFilter = null;
486 b63dcfbb semi
                }
487
                else if (_RevisionFilter != value)
488 902f397c semi
                {
489
                    _RevisionFilter = value;
490
                    OnPropertyChanged(() => RevisionFilter);
491 218e5002 semi
                }
492
            }
493
        }
494
495
        public string _GroupNOFilter;
496
        public string GroupNOFilter
497
        {
498
            get { return _GroupNOFilter; }
499
            set
500
            {
501
                if (_GroupNOFilter == "")
502
                {
503
                    _GroupNOFilter = null;
504
                }
505
                else if (_GroupNOFilter != value)
506
                {
507
                    _GroupNOFilter = value;
508
                    OnPropertyChanged(() => GroupNOFilter);
509 902f397c semi
                }
510
            }
511
        }
512 5a954acc semi
513 30680747 semi
        public string _DOCUMENT_URLFilter;
514
        public string DOCUMENT_URLFilter
515
        {
516
            get { return _DOCUMENT_URLFilter; }
517
            set
518
            {
519
                if (_DOCUMENT_URLFilter == "")
520
                {
521
                    _DOCUMENT_URLFilter = null;
522
                }
523
                else if (_DOCUMENT_URLFilter != value)
524
                {
525
                    _DOCUMENT_URLFilter = value;
526
                    OnPropertyChanged(() => DOCUMENT_URLFilter);
527
                }
528
            }
529
        }
530
531 95e7bd84 semi
        static DateTime DefaultCreateTime = DateTime.Now.AddHours(-1);
532 b63dcfbb semi
        private DateTime _SelectedCreateTimeBegin = DefaultCreateTime;
533 5a954acc semi
        public DateTime SelectedCreateTimeBegin
534
        {
535
536
            get { return _SelectedCreateTimeBegin; }
537
            set
538
            {
539
                if (_SelectedCreateTimeBegin == value)
540
                    return;
541
                _SelectedCreateTimeBegin = value;
542
                OnPropertyChanged(() => SelectedCreateTimeBegin);
543
544
            }
545
        }
546
547 b63dcfbb semi
        private DateTime _SelectedCreateTimeEnd = DefaultCreateTime;
548 5a954acc semi
        public DateTime SelectedCreateTimeEnd
549
        {
550
551
            get { return _SelectedCreateTimeEnd; }
552
            set
553
            {
554
                if (_SelectedCreateTimeEnd == value)
555
                    return;
556
                _SelectedCreateTimeEnd = value;
557
                OnPropertyChanged(() => SelectedCreateTimeEnd);
558
            }
559
        }
560
561 8c128693 semi
        public bool _ConvertShow;
562
        public bool ConvertShow
563
        {
564
            get => _ConvertShow;
565
            set
566
            {
567
                if (_ConvertShow = !value)
568
                {
569
                    _ConvertShow = false;
570
                }
571
                _ConvertShow = value;
572
                OnPropertyChanged(() => ConvertShow);
573
            }
574 b63dcfbb semi
        }
575 8c128693 semi
576 c68259ac semi
        public bool _AliveShow = false;
577 cb806a91 semi
        public bool AliveShow
578
        {
579
            get => _AliveShow;
580
            set
581
            {
582
                _AliveShow = value;
583
                OnPropertyChanged(() => AliveShow);
584
            }
585
        }
586
587 50b63148 semi
        public bool _SearchTimerOn = false;
588
        public bool SearchTimerOn
589
        {
590
            get => _SearchTimerOn;
591
            set
592
            {
593
                if (_SearchTimerOn = !value)
594
                {
595
                    _SearchTimerOn = false;
596
                }
597
                _SearchTimerOn = value;
598
                OnPropertyChanged(() => SearchTimerOn);
599
            }
600
        }
601
602 e6281033 alzkakdixm
        #endregion
603
604
        #region Command
605 a6e5055d alzkakdixm
606 0cb12397 alzkakdixm
        public DelegateCommand ConvertCommand { get; private set; }
607
        public DelegateCommand DeleteCommand { get; private set; }
608
        public DelegateCommand ValidateCommand { get; private set; }
609 e6281033 alzkakdixm
        public DelegateCommand DataSaveFileGemBoxCommand { get; private set; }
610 e78f0871 alzkakdixm
        public DelegateCommand MarkusLinkCommand { get; private set; }
611 b63dcfbb semi
        public DelegateCommand RemoveCreateTimeFilterCommand { get; private set; }
612
613
        public DelegateCommand DataFilterCommand { get; private set; }
614
        public DelegateCommand ResetCommand { get; private set; }
615 037ab674 semi
        public DelegateCommand ConvertAddCommand { get; private set; }
616 78683624 semi
        public DelegateCommand ConvertPathFileSearchCommand { get; private set; }
617 f5ec88b8 semi
        public DelegateCommand Stop_ProcessCommand { get; private set; }
618 aaed7be2 semi
        public DelegateCommand EnterCommand { get; private set; }
619 f047c8bf semi
        public DelegateCommand DocumentFilterCommand { get; private set; }
620 5a954acc semi
621 e6281033 alzkakdixm
        #endregion
622 a6e5055d alzkakdixm
623 e6281033 alzkakdixm
        #region Main Logic
624 a6e5055d alzkakdixm
625 e6281033 alzkakdixm
        /// <summary>
626
        /// 각각의 Grid row 객체들 업데이트
627
        /// </summary>
628
629
        private DispatcherTimer dispatcherTimer;
630 8c128693 semi
        public override void Loaded()
631
        {
632
            base.Loaded();
633
634
            if (!App.IsDesignMode)
635
            {
636
                dispatcherTimer = new DispatcherTimer();
637
                dispatcherTimer.Tick += new EventHandler(Timer_Tick);
638
                dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
639
                dispatcherTimer.Start();
640
            }
641
        }
642 a6e5055d alzkakdixm
643 b119eeaa taeseongkim
        private async void Timer_Tick(object sender, EventArgs e)
644 a6e5055d alzkakdixm
        {
645 e6281033 alzkakdixm
            dispatcherTimer.Stop();
646
647
            if (IsAcitve)
648 a6e5055d alzkakdixm
            {
649 b119eeaa taeseongkim
                await App.Current.Dispatcher.InvokeAsync(() =>
650 a6e5055d alzkakdixm
                {
651 e6281033 alzkakdixm
                    DataSelect();
652
653
                    AliveDataSelect();
654
                });
655
            }
656
657 e139272d semi
            await Task.Delay(5000);
658 b119eeaa taeseongkim
659 037ab674 semi
            System.Threading.Thread.Sleep(new TimeSpan(0, 0, 0, 0, 100));
660 e6281033 alzkakdixm
661
            dispatcherTimer.Start();
662
        }
663 a6e5055d alzkakdixm
664 c7955b40 semi
        private async void SearchTimer_Tick(object sender, EventArgs e)
665
        {
666
            dispatcherTimer.Stop();
667
668
            if (IsAcitve)
669
            {
670
                await App.Current.Dispatcher.InvokeAsync(() =>
671
                {
672
                    DataSearch(new[] { (StatusCodeType)(SelectedStatus.Value) }, FilterConvertSource);
673
674
                    RealDataSelect(new[] { StatusCodeType.None, StatusCodeType.Wait, StatusCodeType.PageLoading, StatusCodeType.Saving }, RealConvertSource);
675
676
                    AliveDataSelect();
677
                });
678
            }
679
680 e139272d semi
            await Task.Delay(5000);
681 c7955b40 semi
682 72862ad1 semi
            System.Threading.Thread.Sleep(new TimeSpan(0, 0, 0, 0, 100));
683 c7955b40 semi
684
            dispatcherTimer.Start();
685
        }
686
687 e6281033 alzkakdixm
        public override void Closed()
688
        {
689
            if (dispatcherTimer != null)
690
            {
691
                dispatcherTimer.Stop();
692 a6e5055d alzkakdixm
            }
693 e6281033 alzkakdixm
694
            base.Closed();
695 a6e5055d alzkakdixm
        }
696 0cb12397 alzkakdixm
697 2decfbdf alzkakdixm
698 e6281033 alzkakdixm
        #endregion
699 a6e5055d alzkakdixm
700 e6281033 alzkakdixm
        #region Function
701 a6e5055d alzkakdixm
702 037ab674 semi
        #region Return_FilterConvertSource
703
704
        public static void Return_FilterConvertSource(ObservableCollection<ConvertPDF> convertPDFs)
705
        {
706
            ConvertSource = new ObservableCollection<ConvertPDF>();
707
            ConvertSource = convertPDFs;
708
        }
709
710
        public static ObservableCollection<ConvertPDF> Return_FilterConvertSource()
711
        {
712
            return ConvertSource;
713
        }
714
715
        #endregion
716
717 e6281033 alzkakdixm
        #region Data Select
718
719
        /// <summary>
720
        /// 상단 그리드 중앙 그리드 출력 데이터
721
        /// </summary>
722
        private void DataSelect()
723
        {
724 a6e5055d alzkakdixm
725 e6281033 alzkakdixm
            if (FilterConvertSource == null)
726
            {
727 2f07b70a semi
                FilterConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
728 e6281033 alzkakdixm
            }
729
730
            if (RealConvertSource == null)
731
            {
732 2f07b70a semi
                RealConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
733 e6281033 alzkakdixm
            }
734
735
            /// combobox 에서 선택된 items
736
            if (SelectedStatus != null)
737
            {
738
                DataSelect(new[] { (StatusCodeType)(SelectedStatus.Value) }, FilterConvertSource);
739 a6e5055d alzkakdixm
            }
740
741 e139272d semi
742 e6281033 alzkakdixm
            /// 컨버터중인 items
743
            RealDataSelect(new[] { StatusCodeType.None, StatusCodeType.Wait, StatusCodeType.PageLoading, StatusCodeType.Saving }, RealConvertSource);
744 2decfbdf alzkakdixm
745 e6281033 alzkakdixm
        }
746 2decfbdf alzkakdixm
747 037ab674 semi
        private async void RealDataSelect(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertPDF> collection)
748 2decfbdf alzkakdixm
        {
749
            try
750
            {
751 59a29a3b semi
                List<ConvertPDF> Listitems = new List<ConvertPDF>();
752 2decfbdf alzkakdixm
753 037ab674 semi
                foreach (var coll in collection)
754
                {
755 b6bc5408 semi
                    var collectionItems = from num in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(coll.ConvertID, coll.ProjectNumber, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
756
                                          let MarkusLink = "kcom://" + CreateMarkusParam(num.PROJECT_NO, num.DOCUMENT_ID, "doftech")
757
                                          select new ConvertPDF(num.SERVICE_ID, num.ID, num.PROJECT_NO, num.STATUS, num.DOCUMENT_ID, num.DOCUMENT_NAME, num.DOCUMENT_NO, num.DOCUMENT_URL, num.REVISION, num.CURRENT_PAGE,
758
                                      num.TOTAL_PAGE, num.EXCEPTION, num.GROUP_NO, num.CREATE_DATETIME, num.START_DATETIME, num.END_DATETIME, num.DOCUMENT_URL, num.CONVERT_PATH, MarkusLink, num.RECONVERTER);
759 59a29a3b semi
760
                    var collectionItem = collectionItems.Cast<ConvertPDF>().ToList();
761
762
                    Listitems.AddRange(collectionItem);
763 037ab674 semi
                }
764 8c128693 semi
765 037ab674 semi
                foreach (var Listitem in Listitems)
766
                {
767
                    collection.UpdateWhere(changeitem =>
768
                    ConvertItemEx.ChangeValues(changeitem, Listitem), x => x.ProjectNumber == Listitem.ProjectNumber && x.ConvertID == Listitem.ConvertID);
769 2decfbdf alzkakdixm
                }
770
            }
771
            catch (Exception ex)
772
            {
773
                MessageBox.Show(ex.ToString());
774
            }
775
        }
776
777 037ab674 semi
        private async void DataSelect(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertPDF> collection)
778 a6e5055d alzkakdixm
        {
779
            try
780
            {
781 037ab674 semi
                int _status = 0;
782
                if (SelectedStatus != null)
783 a6e5055d alzkakdixm
                {
784 037ab674 semi
                    _status = (int)SelectedStatus.Value;
785
                }
786 a6e5055d alzkakdixm
787 037ab674 semi
                if (ProjectNames.Count() == 0)
788
                {
789 aaed7be2 semi
                    ProjectName Clear = new ProjectName("Selected All", "Selected All");
790 037ab674 semi
                    ProjectNames.Add(Clear);
791 93f5e32a semi
792 037ab674 semi
                    foreach (var x in await WcfClient.GET_SELECT_RUN_PROJECTSAsync(0))
793 2decfbdf alzkakdixm
                    {
794 037ab674 semi
                        ProjectName projectName = new ProjectName(x.PROJECT_NO, x.PROJECT_NAME);
795
                        ProjectNames.Add(projectName);
796 2decfbdf alzkakdixm
                    }
797 037ab674 semi
                }
798
799
                var Listitems = from num in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(null, null, null, _status, SelectedCount.ValueMember, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
800
                                let MarkusLink = "kcom://" + CreateMarkusParam(num.PROJECT_NO, num.DOCUMENT_ID, "doftech")
801
                                select new ConvertPDF(num.SERVICE_ID, num.ID, num.PROJECT_NO, num.STATUS, num.DOCUMENT_ID, num.DOCUMENT_NAME, num.DOCUMENT_NO, num.DOCUMENT_URL, num.REVISION, num.CURRENT_PAGE,
802 59a29a3b semi
                                                        num.TOTAL_PAGE, num.EXCEPTION, num.GROUP_NO, num.CREATE_DATETIME, num.START_DATETIME, num.END_DATETIME, num.DOCUMENT_URL, num.CONVERT_PATH, MarkusLink, num.RECONVERTER);
803 2decfbdf alzkakdixm
804 037ab674 semi
                if (collection.Count() == 0)
805
                {
806
                    if (statusCodeTypeList.Count() == 1)
807 3bde451b semi
                    {
808 037ab674 semi
                        foreach (var Listitem in Listitems.ToList())
809 e139272d semi
                        {
810 037ab674 semi
                            collection.Add(Listitem);
811 e139272d semi
                        }
812 3bde451b semi
                    }
813 037ab674 semi
                }
814
                else
815
                {
816
                    foreach (var Listitem in Listitems)
817 a6e5055d alzkakdixm
                    {
818 037ab674 semi
                        collection.UpdateWhere(changeitem =>
819
                        ConvertItemEx.ChangeValues(changeitem, Listitem), x => x.ProjectNumber == Listitem.ProjectNumber && x.ConvertID == Listitem.ConvertID);
820 a6e5055d alzkakdixm
                    }
821 037ab674 semi
                    if (statusCodeTypeList.Count() == 1)
822 a6e5055d alzkakdixm
                    {
823 037ab674 semi
                        for (int i = collection.Count() - 1; i >= 0; --i)
824 a6e5055d alzkakdixm
                        {
825 037ab674 semi
                            var item = collection[i];
826 a6e5055d alzkakdixm
827 037ab674 semi
                            if (Listitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
828
                            {
829
                                collection.RemoveAt(i);
830 2decfbdf alzkakdixm
                            }
831 a6e5055d alzkakdixm
                        }
832 037ab674 semi
                    }
833 a6e5055d alzkakdixm
834 037ab674 semi
                    if (statusCodeTypeList.Count() == 1)
835
                    {
836
                        foreach (var item in Listitems)
837 a6e5055d alzkakdixm
                        {
838 037ab674 semi
                            if (collection.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
839 2decfbdf alzkakdixm
                            {
840 037ab674 semi
                                for (int i = 0; i < 200; i++)
841 2decfbdf alzkakdixm
                                {
842 037ab674 semi
                                    if (i < collection.Count() - 1)
843 2decfbdf alzkakdixm
                                    {
844 037ab674 semi
                                        if (DateTime.Compare(collection[i].CreateTime, item.CreateTime) < 0)
845 2decfbdf alzkakdixm
                                        {
846 037ab674 semi
                                            collection.Insert(i, item);
847 2decfbdf alzkakdixm
                                            break;
848
                                        }
849
                                    }
850 037ab674 semi
                                    else
851
                                    {
852
                                        collection.Add(item);
853
                                        break;
854
                                    }
855 2decfbdf alzkakdixm
                                }
856 a6e5055d alzkakdixm
857
                            }
858 2decfbdf alzkakdixm
859 037ab674 semi
                        }
860 a6e5055d alzkakdixm
                    }
861
                }
862
            }
863
            catch (Exception ex)
864
            {
865 31beca73 semi
                MessageBox.Show(ex.ToString());
866 a6e5055d alzkakdixm
            }
867
        }
868
869 037ab674 semi
        private async void DataSearch(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertPDF> collection)
870 b63dcfbb semi
        {
871
            try
872
            {
873 037ab674 semi
                int _status = 0;
874
                if (SelectedStatus != null)
875 b63dcfbb semi
                {
876 037ab674 semi
                    _status = (int)SelectedStatus.Value;
877
                }
878
                DateTime? Start_CreateTime = null;
879
                DateTime? Finish_CreateTime = null;
880
                if (SelectedCreateTimeBegin != DefaultCreateTime)
881
                {
882
                    Start_CreateTime = SelectedCreateTimeBegin;
883
                }
884
                if (SelectedCreateTimeEnd != DefaultCreateTime)
885
                {
886
                    Finish_CreateTime = SelectedCreateTimeEnd;
887
                }
888 b63dcfbb semi
889 037ab674 semi
                if (ProjectNames.Count() == 0)
890
                {
891 aaed7be2 semi
                    ProjectName Clear = new ProjectName("Selected All", "Selected All");
892
                    ProjectNames.Add(Clear);
893
894 037ab674 semi
                    foreach (var x in await WcfClient.GET_SELECT_RUN_PROJECTSAsync(0))
895 3bde451b semi
                    {
896 037ab674 semi
                        ProjectName projectName = new ProjectName(x.PROJECT_NO, x.PROJECT_NAME);
897
                        ProjectNames.Add(projectName);
898 3bde451b semi
                    }
899 037ab674 semi
                }
900 218e5002 semi
901 037ab674 semi
                var Listitems = from num in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(null, ProjectNumberFilter.Project_NO, UniqueKeyFilter, _status, SelectedCount.ValueMember, Start_CreateTime, Finish_CreateTime, null,
902
            null, null, null, GroupNOFilter, Document_NameFilter, Docuemnt_NOFilter, RevisionFilter, Service_IDFilter, ReconverterFilter, DOCUMENT_URLFilter, ExcptionCheck)
903
                                let MarkusLink = "kcom://" + CreateMarkusParam(num.PROJECT_NO, num.DOCUMENT_ID, "doftech")
904
                                select new ConvertPDF(num.SERVICE_ID, num.ID, num.PROJECT_NO, num.STATUS, num.DOCUMENT_ID, num.DOCUMENT_NAME, num.DOCUMENT_NO, num.DOCUMENT_URL, num.REVISION, num.CURRENT_PAGE,
905
           num.TOTAL_PAGE, num.EXCEPTION, num.GROUP_NO, num.CREATE_DATETIME, num.START_DATETIME, num.END_DATETIME, num.DOCUMENT_URL, num.CONVERT_PATH, MarkusLink, num.RECONVERTER);
906 e139272d semi
907 037ab674 semi
                if (collection.Count() == 0)
908
                {
909
                    if (statusCodeTypeList.Count() == 1)
910 3bde451b semi
                    {
911 037ab674 semi
                        foreach (var x in Listitems)
912 b63dcfbb semi
                        {
913 037ab674 semi
                            collection.Add(x);
914 b63dcfbb semi
                        }
915 3bde451b semi
                    }
916 037ab674 semi
                }
917
                else
918
                {
919
                    foreach (var newitem in Listitems)
920 3bde451b semi
                    {
921 037ab674 semi
                        collection.UpdateWhere(changeitem =>
922
                        ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID);
923
                    }
924 3bde451b semi
925 b63dcfbb semi
926 037ab674 semi
                    if (statusCodeTypeList.Count() == 1)
927
                    {
928
                        for (int i = collection.Count() - 1; i >= 0; --i)
929 3bde451b semi
                        {
930 037ab674 semi
                            var item = collection[i];
931 b63dcfbb semi
932 037ab674 semi
                            if (Listitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
933 b63dcfbb semi
                            {
934 037ab674 semi
                                collection.RemoveAt(i);
935 b63dcfbb semi
                            }
936 3bde451b semi
                        }
937 037ab674 semi
                    }
938 b63dcfbb semi
939 037ab674 semi
                    if (statusCodeTypeList.Count() == 1)
940
                    {
941
                        foreach (var item in Listitems)
942 3bde451b semi
                        {
943 037ab674 semi
                            if (collection.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
944 b63dcfbb semi
                            {
945 037ab674 semi
                                for (int i = 0; i < 200; i++)
946 b63dcfbb semi
                                {
947 037ab674 semi
                                    if (i < collection.Count() - 1)
948 b63dcfbb semi
                                    {
949 037ab674 semi
                                        if (DateTime.Compare(collection[i].CreateTime, item.CreateTime) < 0)
950 3bde451b semi
                                        {
951 037ab674 semi
                                            collection.Insert(i, item);
952 3bde451b semi
                                            break;
953
                                        }
954 b63dcfbb semi
                                    }
955 037ab674 semi
                                    else
956
                                    {
957
                                        collection.Add(item);
958
                                        break;
959
                                    }
960 b63dcfbb semi
                                }
961 3bde451b semi
                            }
962 218e5002 semi
                        }
963 b63dcfbb semi
                    }
964
                }
965
            }
966
            catch (Exception ex)
967
            {
968 31beca73 semi
                MessageBox.Show(ex.ToString());
969 b63dcfbb semi
            }
970
        }
971 e6281033 alzkakdixm
        /// <summary>
972
        /// 서비스의 실시간 컨버터 Item
973
        /// </summary>
974
        private async void AliveDataSelect()
975 a6e5055d alzkakdixm
        {
976 e6281033 alzkakdixm
            try
977 a6e5055d alzkakdixm
            {
978 2f07b70a semi
                List<ConvertPDF> newitems = new List<ConvertPDF>();
979 3bde451b semi
                foreach (var client in App.StationClientList)
980 e6281033 alzkakdixm
                {
981 3bde451b semi
                    if (await SimplePingAsync(client.Endpoint.Address.ToString()))
982 e6281033 alzkakdixm
                    {
983 3bde451b semi
                        try
984 e6281033 alzkakdixm
                        {
985 2f07b70a semi
                            List<ConvertPDF> itemsToList = new List<ConvertPDF>();
986 3bde451b semi
                            var items = await client.AliveConvertListAsync();
987
                            string result = "";
988 8c128693 semi
989 b6bc5408 semi
                            if (items.Count() > 0)
990
                            {
991
                                AliveShow = true;
992
                            }
993
994 3bde451b semi
                            foreach (var item in items)
995
                            {
996 2f07b70a semi
                                ConvertPDF itemsToEach = new ConvertPDF();
997 3bde451b semi
                                itemsToEach.ServiceID = item.ServiceID;
998
                                itemsToEach.ConvertID = item.ConvertID;
999
                                itemsToEach.ProjectNumber = item.ProjectNumber;
1000 8c128693 semi
1001 ee910e7f semi
                                var MarkusLink = "kcom://" + CreateMarkusParam(item.ProjectNumber, item.DocumentID, "doftech");
1002 8c128693 semi
1003 3bde451b semi
                                if (item.ConvertState != null)
1004
                                {
1005
                                    itemsToEach.ConvertState = (StatusCodeType)Enum.Parse(typeof(StatusCodeType), item.ConvertState);
1006 e6281033 alzkakdixm
                                }
1007
1008 3bde451b semi
                                if (item.OriginfilePath.Contains("/"))
1009
                                {
1010
                                    result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("/") + 1);
1011
                                }
1012
                                else
1013 8c128693 semi
                                {
1014 3bde451b semi
                                    result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("%") + 1);
1015 8c128693 semi
                                }
1016 3bde451b semi
                                itemsToEach.FileName = result;
1017
1018
                                itemsToEach.CurrentPageNo = item.CurrentPageNo;
1019
                                itemsToEach.TotalPage = item.TotalPage;
1020
                                itemsToEach.OriginfilePath = item.OriginfilePath;
1021
                                itemsToEach.ConvertPath = item.ConvertPath;
1022 ee910e7f semi
                                itemsToEach.MarkusLink = MarkusLink;
1023 cb806a91 semi
                                itemsToEach.UniqueKey = item.UniqueKey;
1024
                                itemsToEach.GroupNo = item.GroupNo;
1025 5feff9f0 semi
                                itemsToEach.DocumentName = item.DocumnetName;
1026 f0ad40d3 semi
                                itemsToEach.Revision = item.Revision;
1027 cb806a91 semi
                                itemsToEach.Exception = item.Exception;
1028 ee910e7f semi
                                itemsToEach.ConvertPath = item.ConvertPath;
1029 3bde451b semi
                                itemsToEach.CreateTime = item.CreateTime;
1030
                                itemsToEach.ReConverter = item.ReConverter;
1031
                                itemsToEach.DocumentID = item.DocumentID;
1032
                                itemsToEach.StartTime = item.StartTime;
1033
                                itemsToEach.EndTime = item.EndTime;
1034
1035
                                itemsToList.Add(itemsToEach);
1036 e6281033 alzkakdixm
                            }
1037 3bde451b semi
                            newitems.AddRange(itemsToList);
1038
                            System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} ping");
1039
1040
                            if (items.Count() == 0)
1041 e6281033 alzkakdixm
                            {
1042 3bde451b semi
                                System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} Alive Items is zero.");
1043 e6281033 alzkakdixm
                            }
1044
                        }
1045 3bde451b semi
                        catch (Exception ex)
1046 e6281033 alzkakdixm
                        {
1047 3bde451b semi
                            System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} {ex.Message}");
1048 e6281033 alzkakdixm
                        }
1049
                    }
1050 3bde451b semi
                    else
1051
                    {
1052
                        System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} ping Error");
1053
                    }
1054
1055 e6281033 alzkakdixm
                }
1056
                ItemsUpdate(newitems);
1057
                await System.Windows.Application.Current.Dispatcher.InvokeAsync(() => ItemsUpdate(newitems));
1058
            }
1059
            catch (Exception ex)
1060
            {
1061
                System.Diagnostics.Debug.WriteLine(ex.ToString());
1062 a6e5055d alzkakdixm
            }
1063
        }
1064
1065 e6281033 alzkakdixm
        /// <summary>
1066
        /// AliveDataSelect의 Data Update
1067
        /// </summary>
1068
        /// <param name="newitems"></param>
1069 2f07b70a semi
        private void ItemsUpdate(List<ConvertPDF> newitems)
1070 a6e5055d alzkakdixm
        {
1071
1072 e6281033 alzkakdixm
            foreach (var item in newitems)
1073
            {
1074
                item.OriginfilePath = HttpUtility.UrlDecode(item.OriginfilePath);
1075
            }
1076
1077
            if (AliveItems == null)
1078
            {
1079 2f07b70a semi
                AliveItems = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
1080 e6281033 alzkakdixm
1081
                foreach (var item in newitems)
1082
                {
1083
                    AliveItems.Add(item);
1084
                }
1085
            }
1086
            else
1087 a6e5055d alzkakdixm
            {
1088 e6281033 alzkakdixm
                newitems.ForEach(newitem =>
1089
                {
1090
                    AliveItems.UpdateWhere(changeitem => ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID);
1091
                });
1092
1093
                foreach (var item in newitems)
1094
                {
1095
                    if (AliveItems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
1096
                    {
1097
                        AliveItems.Add(item);
1098
                    }
1099
                }
1100 a6e5055d alzkakdixm
1101 e6281033 alzkakdixm
                for (int i = AliveItems.Count() - 1; i > -1; --i)
1102
                {
1103
                    var item = AliveItems[i];
1104 a6e5055d alzkakdixm
1105 e6281033 alzkakdixm
                    if (newitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
1106
                    {
1107
                        try
1108
                        {
1109
                            AliveItems.RemoveAt(i);
1110
                        }
1111
                        catch (Exception ex)
1112
                        {
1113
                            System.Diagnostics.Debug.WriteLine(ex.ToString());
1114
                        }
1115
                    }
1116
                }
1117 2decfbdf alzkakdixm
            }
1118 a6e5055d alzkakdixm
        }
1119
1120
1121 e6281033 alzkakdixm
        public static async Task<bool> SimplePingAsync(string uri)
1122 a6e5055d alzkakdixm
        {
1123 e6281033 alzkakdixm
            bool result = false;
1124
1125
            try
1126
            {
1127
                using (System.Net.Http.HttpClient Client = new System.Net.Http.HttpClient())
1128
                {
1129
                    Client.Timeout = new TimeSpan(0, 0, 60);
1130
1131
                    var message = await Client.GetAsync(uri);
1132
1133
                    System.Net.HttpStatusCode StatusCode = message.StatusCode;
1134
1135
                    switch (StatusCode)
1136
                    {
1137
1138
                        case System.Net.HttpStatusCode.Accepted:
1139
                        case System.Net.HttpStatusCode.OK:
1140
                            result = true;
1141
                            break;
1142
                    }
1143
                }
1144
            }
1145
            catch (Exception ex)
1146
            {
1147
                result = false;
1148
                System.Diagnostics.Debug.WriteLine(ex.ToString());
1149
            }
1150
1151
            return result;
1152 a6e5055d alzkakdixm
        }
1153
1154 e6281033 alzkakdixm
        #endregion
1155
1156
        #region Data Convert
1157 a6e5055d alzkakdixm
1158 037ab674 semi
        private async void DataConvert(object obj)
1159 e6281033 alzkakdixm
        {
1160 472d507b semi
            if (obj is ConvertPDF)
1161
            {
1162
1163
                if (obj != null)
1164
                {
1165
                    var convertitem = obj as ConvertPDF;
1166
1167
                    SelectRealConvert = convertitem;
1168
                    SetCleanUpItem(SelectRealConvert);
1169
1170
1171
                    var items = from x in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(SelectRealConvert.ConvertID, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
1172
                                let MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech")
1173
                                select new ConvertPDF(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
1174
                             , x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
1175
1176
                    foreach (var item in items)
1177
                    {
1178
                        if (RealConvertSource.Count(x => x.ConvertID == item.ConvertID) < 1)
1179
                        {
1180
                            RealConvertSource.Add(item);
1181
                        }
1182
                        if (RealConvertSource.Count() == 1)
1183
                        {
1184
                            ConvertShow = true;
1185
                        }
1186
                    }
1187
                }
1188
            }
1189
            else if (SelectFilterConvertList == null)
1190 e6281033 alzkakdixm
            {
1191
                MessageBox.Show("왼쪽 버튼 클릭 후 Converter 해주세요!");
1192
            }
1193
            else
1194 a6e5055d alzkakdixm
            {
1195 80391351 semi
                if (SelectFilterConvertList != null)
1196 a6e5055d alzkakdixm
                {
1197 80391351 semi
                    foreach (var SelectFilterConvert in SelectFilterConvertList)
1198
                    {
1199 59a29a3b semi
                        SetCleanUpItem(SelectFilterConvert);
1200 80391351 semi
                    }
1201 e6281033 alzkakdixm
                }
1202 3bde451b semi
1203 037ab674 semi
                foreach (var SelectFilterConvert in SelectFilterConvertList)
1204
                {
1205 3bde451b semi
1206 037ab674 semi
                    var items = from x in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(SelectFilterConvert.ConvertID, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
1207
                                let MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech")
1208
                                select new ConvertPDF(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
1209
                             , x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
1210 3bde451b semi
1211 037ab674 semi
                    foreach (var item in items)
1212
                    {
1213 b6bc5408 semi
                        if (RealConvertSource.Count(x => x.ConvertID == item.ConvertID) < 1)
1214
                        {
1215
                            RealConvertSource.Add(item);
1216
                        }
1217 037ab674 semi
                        if (RealConvertSource.Count() == 1)
1218
                        {
1219
                            ConvertShow = true;
1220 3bde451b semi
                        }
1221 8c7d1ea1 alzkakdixm
                    }
1222 a6e5055d alzkakdixm
                }
1223 3bde451b semi
            }
1224
        }
1225
1226
1227 59a29a3b semi
        public async void SetCleanUpItem(ConvertPDF _ConvertItem)
1228 3bde451b semi
        {
1229 f0ad40d3 semi
1230 59a29a3b semi
            var items = await WcfClient.GET_SELECT_CONVERT_ITEMAsync(_ConvertItem.ConvertID, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
1231 f0ad40d3 semi
1232 037ab674 semi
            if (items.Count() > 0)
1233
            {
1234
                var item = items.First();
1235 3bde451b semi
1236 037ab674 semi
                var _RECONVERTER = item.RECONVERTER - _ConvertItem.ReConverter;
1237
                var _CREATE_DATETIME = DateTime.Now;
1238
                var _STATUS = (int)StatusCodeType.None;
1239 3bde451b semi
1240 cb806a91 semi
                await WcfClient.GET_SELECT_RERECONVERT_ITEMAsync(_ConvertItem.ConvertID, _RECONVERTER, _CREATE_DATETIME, _STATUS, null);
1241 3bde451b semi
            }
1242
        }
1243
1244 e6281033 alzkakdixm
1245 2c634aed semi
        public static string CreateMarkusParam(string projectNo, string documentID, string userID)
1246
        {
1247
            ViewInfo viewInfo = new ViewInfo();
1248
1249
            viewInfo.DocumentItemID = documentID;
1250
            viewInfo.ProjectNO = projectNo;
1251
            viewInfo.UserID = userID;
1252
1253
            return ParamEncoding(JsonConvert.SerializeObject(viewInfo));
1254
1255
        }
1256
1257
        public static string ParamEncoding(string EncodingText, System.Text.Encoding oEncoding = null)
1258
        {
1259
1260
            if (oEncoding == null)
1261
                oEncoding = System.Text.Encoding.UTF8;
1262
1263
            return Convert.ToBase64String(oEncoding.GetBytes(EncodingText));
1264
1265
        }
1266
1267 e6281033 alzkakdixm
1268 3bde451b semi
        #endregion
1269
1270 e6281033 alzkakdixm
        #region Validation
1271 a6e5055d alzkakdixm
1272 e6281033 alzkakdixm
        private void DataValidate(object obj)
1273
        {
1274 472d507b semi
            if (obj is ConvertPDF)
1275
            {
1276
1277
                if (obj != null)
1278
                {
1279
                    var convertitem = obj as ConvertPDF;
1280
1281
                    SelectRealConvert = convertitem;
1282
1283
                    bool result = false;
1284
                    WebRequest webRequest = WebRequest.Create(SelectRealConvert.OriginfilePath);
1285
                    webRequest.Timeout = 1200; // miliseconds
1286
                    webRequest.Method = "HEAD";
1287
1288
                    HttpWebResponse response = null;
1289
1290
                    try
1291
                    {
1292
                        response = (HttpWebResponse)webRequest.GetResponse();
1293
                        result = true;
1294
                    }
1295
                    catch (WebException webException)
1296
                    {
1297
                        MessageBox.Show(SelectRealConvert.FileName + " doesn't exist: " + webException.Message);
1298
                        result = true;
1299
                    }
1300
                    finally
1301
                    {
1302
                        if (response != null)
1303
                        {
1304
                            response.Close();
1305
                        }
1306
                    }
1307
                    if (result == true)
1308
                    {
1309
                        MessageBox.Show("File exists");
1310
                    }
1311
                }
1312
            }
1313
            else if (SelectFilterConvertList.Count() > 1)
1314 e6281033 alzkakdixm
            {
1315 80391351 semi
                MessageBox.Show("하나만 클릭해 주세요");
1316 e6281033 alzkakdixm
            }
1317 472d507b semi
            else if (SelectFilterConvertList.Count() == 0)
1318
            {
1319
                MessageBox.Show("왼쪽 버튼 클릭 후 Validate 해주세요!");
1320
            }
1321 80391351 semi
            else
1322 a6e5055d alzkakdixm
            {
1323 80391351 semi
                bool result = false;
1324
                WebRequest webRequest = WebRequest.Create(SelectFilterConvertList[0].OriginfilePath);
1325
                webRequest.Timeout = 1200; // miliseconds
1326
                webRequest.Method = "HEAD";
1327
1328
                HttpWebResponse response = null;
1329
1330
                try
1331 a6e5055d alzkakdixm
                {
1332 80391351 semi
                    response = (HttpWebResponse)webRequest.GetResponse();
1333
                    result = true;
1334
                }
1335
                catch (WebException webException)
1336
                {
1337 944a39ed semi
                    MessageBox.Show(SelectFilterConvertList[0].FileName + " doesn't exist: " + webException.Message);
1338
                    result = false;
1339 80391351 semi
                }
1340
                finally
1341
                {
1342
                    if (response != null)
1343
                    {
1344
                        response.Close();
1345
                    }
1346
                }
1347
                if (result == true)
1348
                {
1349
                    MessageBox.Show("File exists");
1350 a6e5055d alzkakdixm
                }
1351 2decfbdf alzkakdixm
            }
1352 80391351 semi
1353 e6281033 alzkakdixm
        }
1354
1355
        #endregion
1356
1357 f5ec88b8 semi
        #region Data Delete
1358
1359
        private void DataDelete(object obj)
1360
        {
1361 e6c570d5 semi
            EventHandler<WindowClosedEventArgs> handler = (snd, evt) =>
1362
            {
1363
                var result = evt.DialogResult;
1364
1365
                if (result == true)
1366
                {
1367
                    OnClosed(obj);
1368
                }
1369
            };
1370
1371 aaed7be2 semi
            RadWindow.Confirm("Do you want to delete it??", handler);
1372 f5ec88b8 semi
        }
1373
1374 e6c570d5 semi
        private async void OnClosed(object obj)
1375 f5ec88b8 semi
        {
1376 e6c570d5 semi
            if (obj is ConvertPDF)
1377 f5ec88b8 semi
            {
1378 e6c570d5 semi
                if (obj != null)
1379 f5ec88b8 semi
                {
1380 e6c570d5 semi
                    var convertitem = obj as ConvertPDF;
1381 472d507b semi
1382 e6c570d5 semi
                    SelectRealConvert = convertitem;
1383
                    await WcfClient.GET_SELECT_CONVERT_DELETEAsync(SelectRealConvert.ConvertID);
1384 472d507b semi
1385 e6c570d5 semi
                }
1386
            }
1387
            else if (SelectFilterConvertList.Count() > 1)
1388
            {
1389
                MessageBox.Show("하나만 클릭해 주세요!");
1390
            }
1391
            else if (SelectFilterConvertList.Count() == 0)
1392
            {
1393
                MessageBox.Show("왼쪽 버튼 클릭 후 Delete 해주세요!");
1394
            }
1395
            else
1396
            {
1397
                if (SelectFilterConvertList != null)
1398
                {
1399
                    await WcfClient.GET_SELECT_CONVERT_DELETEAsync(SelectFilterConvertList[0].ConvertID);
1400 f5ec88b8 semi
                }
1401
            }
1402
        }
1403
        #endregion
1404
1405
        #region Stop Process
1406
1407
        private void Stop_Process(object obj)
1408
        {
1409 f0ad40d3 semi
1410 b6bc5408 semi
            string convertid = "";
1411
1412 472d507b semi
            if (obj is ConvertPDF)
1413 f5ec88b8 semi
            {
1414 472d507b semi
1415
                if (obj != null)
1416 f0ad40d3 semi
                {
1417 472d507b semi
                    var convertitem = obj as ConvertPDF;
1418
1419
                    SelectRealConvert = convertitem;
1420
1421
                    SelectAliveConvert = convertitem;
1422
1423
                    convertid = convertitem.ConvertID;
1424 b6bc5408 semi
                }
1425 f5ec88b8 semi
            }
1426 472d507b semi
1427
1428
#if DEBUG
1429
            convertid = "TEST";
1430
#endif
1431 b6bc5408 semi
1432
            EventHandler<WindowClosedEventArgs> handler = (snd, evt) =>
1433 f5ec88b8 semi
            {
1434 b6bc5408 semi
                var result = evt.DialogResult;
1435 f5ec88b8 semi
1436 b6bc5408 semi
                if (result == true)
1437
                {
1438
                    Stop_Process(convertid);
1439
                }
1440
            };
1441 f5ec88b8 semi
1442 b6bc5408 semi
            RadWindow.Confirm("프로세스 종료 할까요??", handler);
1443 f5ec88b8 semi
        }
1444
1445 fa6a4690 semi
        private async void Stop_Process(string convertId)
1446 f5ec88b8 semi
        {
1447 e6c570d5 semi
            System.Threading.Thread.Sleep(new TimeSpan(0, 0, 0, 10));
1448 f5ec88b8 semi
1449 b6bc5408 semi
            var process = Process.GetProcessesByName("Markus.Service.ConvertProcess");
1450
1451
            for (int i = process.Count() - 1; i >= 0; i--)
1452
            {
1453
                try
1454 c68259ac semi
                {
1455 b6bc5408 semi
                    var commandLines = process[i].Arguments().CommandLine;
1456 e6c570d5 semi
1457 b6bc5408 semi
                    if (commandLines.Count() > 0)
1458
                    {
1459
                        if (commandLines[0] == convertId)
1460 c68259ac semi
                        {
1461 472d507b semi
1462 fa6a4690 semi
                            var _CREATE_DATETIME = DateTime.Now;
1463
1464
                            await WcfClient.GET_SELECT_RERECONVERT_ITEMAsync(convertId, 2, _CREATE_DATETIME, 3, null);
1465 472d507b semi
                            process[i].WaitForExit(5000);
1466
                            await WcfClient.GET_SELECT_RERECONVERT_ITEMAsync(convertId, 2, _CREATE_DATETIME, 99, null);
1467
                            process[i].Kill();
1468 f5ec88b8 semi
                        }
1469 c68259ac semi
                    }
1470 b6bc5408 semi
                }
1471
                catch (Exception ex)
1472
                {
1473
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
1474 f5ec88b8 semi
                }
1475
            }
1476
        }
1477 aaed7be2 semi
        #endregion
1478 f5ec88b8 semi
1479 aaed7be2 semi
        #region DataFilter
1480 b63dcfbb semi
1481
        public void DataFilter(object obj)
1482
        {
1483 aaed7be2 semi
            SearchTimerOn = true;
1484 b63dcfbb semi
            dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1485 c7955b40 semi
            dispatcherTimer.Tick += new EventHandler(SearchTimer_Tick);
1486 944a39ed semi
1487
            FilterConvertSource.Clear();
1488
            
1489
            SearchTimer_Tick(null,new EventArgs());
1490 b63dcfbb semi
        }
1491
1492 aaed7be2 semi
        #endregion
1493
1494
        #region Filter Enter
1495
1496 b63dcfbb semi
1497 aaed7be2 semi
        /// <summary>
1498
        /// 필터된 상단 그리드 엑셀로 출력
1499
        /// </summary>
1500
1501
        public void Enter(object sender)
1502
        {
1503
            SearchTimerOn = true;
1504
            dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1505
            dispatcherTimer.Tick += new EventHandler(SearchTimer_Tick);
1506 944a39ed semi
1507
            FilterConvertSource.Clear();
1508
1509
            SearchTimer_Tick(null, new EventArgs());
1510 aaed7be2 semi
        }
1511
1512
        #endregion
1513
1514
        #region MarkusLink
1515 e78f0871 alzkakdixm
1516 80391351 semi
        private void MarkusLink(object obj)
1517 e78f0871 alzkakdixm
        {
1518 2f07b70a semi
            if (obj is ConvertPDF)
1519 e78f0871 alzkakdixm
            {
1520 80391351 semi
1521 e78f0871 alzkakdixm
                if (obj != null)
1522
                {
1523 2f07b70a semi
                    var convertitem = obj as ConvertPDF;
1524 e78f0871 alzkakdixm
1525 9b2f01e1 semi
                    SelectFilterConvertList.Add(convertitem);
1526 e78f0871 alzkakdixm
1527
                    SelectRealConvert = convertitem;
1528
1529 6466bd2d semi
                    SelectAliveConvert = convertitem;
1530
1531 e78f0871 alzkakdixm
                    ProcessStartInfo startInfo = null;
1532
1533
                    startInfo = new ProcessStartInfo("iexplore.exe", convertitem.MarkusLink);
1534
1535
                    Process.Start(startInfo);
1536
                }
1537 80391351 semi
1538 e78f0871 alzkakdixm
            }
1539
        }
1540
1541 aaed7be2 semi
        #endregion
1542 e78f0871 alzkakdixm
1543 aaed7be2 semi
        #region Data Export
1544 e6281033 alzkakdixm
1545
1546
        /// <summary>
1547
        /// 필터된 상단 그리드 엑셀로 출력
1548
        /// </summary>
1549
1550
        public void DataExportData(object obj)
1551
        {
1552 aaed7be2 semi
            if (SearchTimerOn == true)
1553 50b63148 semi
            {
1554
                dispatcherTimer.Tick -= new EventHandler(SearchTimer_Tick);
1555
            }
1556
            else
1557
            {
1558
                dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1559
            }
1560 e6281033 alzkakdixm
1561 037ab674 semi
            Return_FilterConvertSource(FilterConvertSource);
1562 e6281033 alzkakdixm
1563 037ab674 semi
            Views.ConvertExcelDialog convertExcelDialog = new Views.ConvertExcelDialog();
1564 e6281033 alzkakdixm
1565 19d6b221 semi
            convertExcelDialog.Owner = Application.Current.MainWindow;
1566 037ab674 semi
            convertExcelDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
1567 e6281033 alzkakdixm
1568 037ab674 semi
            convertExcelDialog.ShowDialog();
1569 e6281033 alzkakdixm
1570 50b63148 semi
            if (SearchTimerOn == true)
1571
            {
1572
                dispatcherTimer.Tick += new EventHandler(SearchTimer_Tick);
1573
            }
1574
            else
1575
            {
1576
                dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1577
            }
1578 2decfbdf alzkakdixm
        }
1579 e6281033 alzkakdixm
1580 aaed7be2 semi
        #endregion
1581 e6281033 alzkakdixm
1582 aaed7be2 semi
        #region Data Search
1583 902f397c semi
1584 b63dcfbb semi
        public void RemoveCreateTimeFilter(object obj)
1585
        {
1586 95e7bd84 semi
            DefaultCreateTime = DateTime.Now.AddHours(-1);
1587 b63dcfbb semi
            SelectedCreateTimeBegin = DefaultCreateTime;
1588
            SelectedCreateTimeEnd = DefaultCreateTime;
1589
        }
1590
1591 aaed7be2 semi
        #endregion
1592 b63dcfbb semi
1593 aaed7be2 semi
        #region Reset
1594 b63dcfbb semi
1595
        /// <summary>
1596
        /// 그리드 상단 원상복귀 버튼
1597
        /// 필터를 끝낸 후 다시 복귀
1598
        /// </summary>
1599
1600
        public void Reset(object obj)
1601 5a954acc semi
        {
1602 50b63148 semi
            SearchTimerOn = false;
1603 93f5e32a semi
            ExcptionCheck = false;
1604 037ab674 semi
            SelectedInt = 10;
1605
            ProjectNumberFilter = ProjectNames[0];
1606 3bde451b semi
            UniqueKeyFilter = null;
1607
            Service_IDFilter = null;
1608
            Document_NameFilter = null;
1609
            Docuemnt_NOFilter = null;
1610
            ReconverterFilter = null;
1611
            RevisionFilter = null;
1612
            GroupNOFilter = null;
1613 30680747 semi
            DOCUMENT_URLFilter = null;
1614 95e7bd84 semi
            DefaultCreateTime = DateTime.Now.AddHours(-1);
1615 3bde451b semi
            SelectedCreateTimeBegin = DefaultCreateTime;
1616
            SelectedCreateTimeEnd = DefaultCreateTime;
1617 c7955b40 semi
            dispatcherTimer.Tick -= new EventHandler(SearchTimer_Tick);
1618 b63dcfbb semi
            dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1619 d6526b0c semi
1620
            FilterConvertSource.Clear();
1621
1622
            Timer_Tick(null, new EventArgs());
1623 5a954acc semi
        }
1624
1625 aaed7be2 semi
        #endregion
1626 902f397c semi
1627 aaed7be2 semi
        #region ConvertAddDialog
1628 218e5002 semi
1629
        /// <summary>
1630
        /// 그리드 상단 Conver 추가 버튼
1631
        /// ProjectNo, DocumentURL, DocumentID, 입력해서 저장 프로시저에서 추가 
1632
        /// </summary>
1633
1634 037ab674 semi
        public void ConvertAdd(object obj)
1635 218e5002 semi
        {
1636 95e7bd84 semi
            try
1637 50b63148 semi
            {
1638 95e7bd84 semi
                if (SearchTimerOn == true)
1639
                {
1640
                    dispatcherTimer.Tick -= new EventHandler(SearchTimer_Tick);
1641
                }
1642
                else
1643
                {
1644
                    dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1645
                }
1646 43b2e236 semi
1647 95e7bd84 semi
                Views.ConvertAddDialog convertAddDialog = new Views.ConvertAddDialog();
1648 8c128693 semi
1649 95e7bd84 semi
                convertAddDialog.Owner = Application.Current.MainWindow;
1650
                convertAddDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
1651 3bde451b semi
1652 95e7bd84 semi
                convertAddDialog.ShowDialog();
1653 218e5002 semi
1654 95e7bd84 semi
                if (SearchTimerOn == true)
1655
                {
1656
                    dispatcherTimer.Tick += new EventHandler(SearchTimer_Tick);
1657 f047c8bf semi
                }
1658
                else
1659
                {
1660
                    dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1661
                }
1662
            }
1663
            catch (Exception ex)
1664
            {
1665
                MessageBox.Show(ex.ToString());
1666
            }
1667
        }
1668
1669
        #endregion
1670
1671
        #region DocumentFilter
1672
1673
        /// <summary>
1674
        /// 그리드 상단 Conver 추가 버튼
1675
        /// ProjectNo, DocumentURL, DocumentID, 입력해서 저장 프로시저에서 추가 
1676
        /// </summary>
1677
1678
        public void DocumentFilter(object obj)
1679
        {
1680
            try
1681
            {
1682
                if (SearchTimerOn == true)
1683
                {
1684
                    dispatcherTimer.Tick -= new EventHandler(SearchTimer_Tick);
1685
                }
1686
                else
1687
                {
1688
                    dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1689
                }
1690
1691
1692
                Views.ConvertDocumentDialog convertDocumentDialog = new Views.ConvertDocumentDialog(SelectedCount.ValueMember, RevisionFilter, Docuemnt_NOFilter, Document_NameFilter, GroupNOFilter, DOCUMENT_URLFilter, UniqueKeyFilter, ProjectNumberFilter.Project_NO);
1693
1694
                convertDocumentDialog.Owner = Application.Current.MainWindow;
1695
                convertDocumentDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
1696 944a39ed semi
                convertDocumentDialog.Width = 1000;
1697
                convertDocumentDialog.Height = 600;
1698 f047c8bf semi
1699
                convertDocumentDialog.ShowDialog();
1700
1701
                if (SearchTimerOn == true)
1702
                {
1703
                    dispatcherTimer.Tick += new EventHandler(SearchTimer_Tick);
1704 95e7bd84 semi
                }
1705
                else
1706
                {
1707
                    dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1708
                }
1709 50b63148 semi
            }
1710 aaed7be2 semi
            catch (Exception ex)
1711 50b63148 semi
            {
1712 95e7bd84 semi
                MessageBox.Show(ex.ToString());
1713 50b63148 semi
            }
1714 218e5002 semi
        }
1715
1716 aaed7be2 semi
        #endregion
1717 218e5002 semi
1718 aaed7be2 semi
        #region ConvertPathFileSearch
1719 78683624 semi
1720
        /// <summary>
1721
        ///  ConvertPath 파일 탐색기로 열리는 아이콘
1722
        /// </summary>
1723
1724
        public void ConvertPathFileSearch(object obj)
1725
        {
1726 2f07b70a semi
            if (obj is ConvertPDF)
1727 78683624 semi
            {
1728
                if (obj != null)
1729
                {
1730 2f07b70a semi
                    var convertitem = obj as ConvertPDF;
1731 78683624 semi
1732 cab4a0e1 semi
                    if (!string.IsNullOrEmpty(convertitem.ConvertPath))
1733
                    {
1734
                        System.Diagnostics.Process.Start("explorer.exe", convertitem.ConvertPath);
1735
                    }
1736 78683624 semi
                }
1737
            }
1738
        }
1739
1740 aaed7be2 semi
        #endregion
1741 78683624 semi
1742 aaed7be2 semi
        #endregion
1743 a6e5055d alzkakdixm
    }
1744
}
클립보드 이미지 추가 (최대 크기: 500 MB)