프로젝트

일반

사용자정보

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

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

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