프로젝트

일반

사용자정보

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

markus / ConvertService / ServiceBase / IServiceBase / ConvertItem.cs @ 31beca73

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

1
using System;
2
using System.ComponentModel;
3
using System.Runtime.Serialization;
4
using System.Linq.Expressions;
5
using System.IO;
6

    
7
namespace Markus.Service.Interface
8
{
9
    [DataContract]
10
    public class ConvertItem :IEquatable<ConvertItem> ,INotifyPropertyChanged
11
    {
12
        public bool Equals(ConvertItem other)
13
        {
14
            if (other is null)
15
                return false;
16

    
17
            return this.ConvertID == other.ConvertID && this.ProjectNumber == other.ProjectNumber;
18
        }
19

    
20
        public override bool Equals(object obj) => Equals(obj as ConvertItem);
21
        public override int GetHashCode()
22
        {
23
            var id = (ConvertID != null) ? ConvertID : "";
24
            var project = (ProjectNumber != null) ? ProjectNumber : ""; 
25

    
26
            return (id + project).GetHashCode();
27
        }
28

    
29
        public ConvertItem()
30
        {
31

    
32
        }
33

    
34
        public ConvertItem(string ProjectNo, string ID)
35
        {
36
            this._projectNumber = ProjectNo;
37
            this._convertID = ID;
38
        }
39

    
40

    
41
        public ConvertItem(string key, string ProjectNo, string ID, string originfilePath)
42
        {
43
            this._uniqueKey = key;
44
            this._projectNumber = ProjectNo;
45
            this._convertID = ID;
46
            this._originfilePath = originfilePath;
47

    
48
            string result = "";
49
            if (originfilePath.Contains("/"))
50
            {
51
                result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1);
52
            }
53
            else
54
            {
55
                result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1);
56
            }
57
            this._FileName = result;
58
        }
59

    
60
        public ConvertItem(string key, string ProjectNo, string ID,string originfilePath,string convertPath)
61
        {
62
            this._uniqueKey = key;
63
            this._projectNumber = ProjectNo;
64
            this._convertID = ID;
65
            this._originfilePath = originfilePath;
66
            this._convertPath = convertPath;
67

    
68
            string result = "";
69
            if (originfilePath.Contains("/"))
70
            {
71
                result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1);
72
            }
73
            else
74
            {
75
                result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1);
76
            }
77
            this._FileName = result;
78
        }
79

    
80
        public ConvertItem(string key, string ProjectNo, string ID, string originfilePath, string convertPath, StatusCodeType Status,int currentPageNo,int totalPage,string exception)
81
        {
82
            this._uniqueKey = key;
83
            this._projectNumber = ProjectNo;
84
            this._convertID = ID;
85
            this._originfilePath = originfilePath;
86
            this._convertPath = convertPath;
87
            this._convertState = (StatusCodeType)Status;
88
            this._currentPageNo = currentPageNo;
89
            this._totalPage = totalPage;
90
            this._exception = exception;
91

    
92
            string result = "";
93
            if (originfilePath.Contains("/"))
94
            {
95
                result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1);
96
            }
97
            else
98
            {
99
                result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1);
100
            }
101
            this._FileName = result;
102
        }
103

    
104
        //DataSearch 상단 그리드 Search  DataConvert
105
        public ConvertItem(string serviceID, string convertId ,string projectNo, int Status, string documentID, string documentName, string documentNo, string document_URL, string revision, int currentPageNo, int totalPage, string exception, string groupNo,
106
            DateTime create_datetime, DateTime? start_datetime, DateTime? end_datetime , string originfilePath, string convertPath, string markusLink, int? reconverter)//20
107
        {//세미
108
            ServiceID = serviceID;
109
            DocumentID = documentID;
110
            ConvertID = convertId;
111
            ProjectNumber = projectNo;
112
            ConvertState = (StatusCodeType)Status;
113
            UniqueKey = documentID;
114
            DocumentName = documentName;
115
            DocumentNo = documentNo;
116
            DocumnetURL = document_URL;
117
            Revision = revision;
118
            CurrentPageNo = currentPageNo;
119
            TotalPage = totalPage;
120
            Exception = exception;
121
            GroupNo = groupNo;
122
            CreateTime = create_datetime;
123
            StartTime = start_datetime;
124
            EndTime = end_datetime;
125
            ConvertPath = convertPath;
126
            MarkusLink = markusLink;
127
            OriginfilePath = originfilePath;
128
            ReConverter = reconverter;
129

    
130
            string result = "";
131
            if (originfilePath.Contains("/"))
132
            {
133
                result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1);
134
            }
135
            else
136
            {
137
                result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1);
138
            }
139
            this._FileName = result;
140
        }
141

    
142
        public ConvertItem(string convertId, string projectNo, int Status, string documentID, string markupInfoID, string docInfoID ,string documentName, string documentNo, string createUserID,//20
143
            string revision, int currentPageNo, int totalPage, string exception, string groupNo, DateTime create_datetime, DateTime? start_datetime, DateTime? end_datetime, string originfilePath,
144
            string convertPath, string markusLink, int Final)
145
        {//FinalPDF
146
            ConvertID = convertId;
147
            ProjectNumber = projectNo;
148
            DocumentID = documentID;
149
            ConvertID = convertId;
150
            ProjectNumber = projectNo;
151
            MarkupInfo_ID = markupInfoID;
152
            Create_User_ID = createUserID;
153
            ConvertState = (StatusCodeType)Status;
154
            DocInfo_ID = docInfoID;
155
            DocumentName = documentName;
156
            DocumentNo = documentNo;
157
            Revision = revision;
158
            CurrentPageNo = currentPageNo;
159
            TotalPage = totalPage;
160
            Exception = exception;
161
            GroupNo = groupNo;
162
            CreateTime = create_datetime;
163
            StartTime = start_datetime;
164
            EndTime = end_datetime;
165
            ConvertPath = convertPath;
166
            MarkusLink = markusLink;
167
            OriginfilePath = originfilePath;
168

    
169
            if (OriginfilePath != null)
170
            {
171
                string result = "";
172
                if (originfilePath.Contains("/"))
173
                {
174
                    result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1);
175
                }
176
                else
177
                {
178
                    result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1);
179
                }
180
                this._FileName = result;
181
            }
182
            else
183
            {
184
                this._FileName = "";
185
            }
186
        }
187

    
188
        string _uniqueKey;
189
        string _projectNumber;
190
        string _convertID;
191
        string _serviceID;
192
        int? _reConverter;
193
        string _originfilePath;
194
        string _FileName;
195
        string _convertPath;
196
        StatusCodeType _convertState;
197
        int _currentPageNo;
198
        int _totalPage;
199
        string _exception;
200
        string _revision;//↓ DOCUMENT_ITEM
201
        string _documentNo;
202
        string _document_Name;
203
        string _GroupName;
204
        string _documentID;
205
        string _documentURL;
206
        string _validation;
207
        string _MarkusLink;
208

    
209

    
210
        DateTime _createtime;
211
        DateTime? _starttime;
212
        DateTime? _endtime;
213

    
214
        public event PropertyChangedEventHandler PropertyChanged;
215

    
216
        private void OnPropertyChanged(string propertyName)
217
        {
218
            if (PropertyChanged != null)
219
            {
220
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
221
            }
222

    
223
        }
224

    
225

    
226
        [DataMember]
227
        public string ConvertID
228
        {
229
            get
230
            {
231
                return _convertID;
232
            }
233
            set
234
            {
235
                if (_convertID != value)
236
                {
237
                    _convertID = value;
238
                    OnPropertyChanged("ConvertID");
239
                }
240
            }
241
        }
242

    
243
        [DataMember]
244
        public string ServiceID
245
        {
246
            get
247
            {
248
                return _serviceID;
249
            }
250
            set
251
            {
252
                if (_serviceID != value)
253
                {
254
                    _serviceID = value;
255
                    OnPropertyChanged("ServiceID");
256
                }
257
            }
258
        }
259

    
260
        [DataMember]
261
        public int? ReConverter
262
        {
263
            get
264
            {
265
                return _reConverter;
266
            }
267
            set
268
            {
269
                if (_reConverter != value)
270
                {
271
                    _reConverter = value;
272
                    OnPropertyChanged("ReConverter");
273
                }
274
            }
275
        }
276

    
277
        [DataMember]
278
        public string OriginfilePath
279
        {
280
            get
281
            {
282
                return _originfilePath;
283
            }
284
            set
285
            {
286
                if (_originfilePath != value)
287
                {
288
                    _originfilePath = value;
289
                    OnPropertyChanged("OriginfilePath");
290
                }
291
            }
292
        }
293

    
294

    
295
        [DataMember]
296
        public string FileName
297
        {
298
            get
299
            {
300
                return _FileName;
301
            }
302
            set
303
            {
304
                if (_FileName != value)
305
                {
306
                    _FileName = value;
307
                    OnPropertyChanged("FileName");
308
                }
309
            }
310
        }
311

    
312

    
313
        [DataMember]
314
        public string ConvertPath
315
        {
316
            get
317
            {
318
                return _convertPath;
319
            }
320
            set
321
            {
322
                if (_convertPath != value)
323
                {
324
                    _convertPath = value;
325
                   OnPropertyChanged("ConvertPath");
326
                }
327
            }
328
        }
329

    
330
        [DataMember]
331
        public StatusCodeType ConvertState
332
        {
333
            get
334
            {
335
                return _convertState;
336
            }
337
            set
338
            {
339
                if (_convertState != value)
340
                {
341
                    _convertState = value;
342
                    OnPropertyChanged("ConvertState");
343
                }
344
            }
345
        }
346

    
347
        [DataMember]
348
        public string ProjectNumber
349
        {
350
            get
351
            {
352
                return _projectNumber;
353
            }
354
            set
355
            {
356
                if (_projectNumber != value)
357
                {
358
                    _projectNumber = value;
359
                    OnPropertyChanged("ProjectNumber");
360
                }
361
            }
362
        }
363

    
364
        [DataMember]
365
        public int TotalPage
366
        {
367
            get
368
            {
369
                return _totalPage;
370
            }
371
            set
372
            {
373
                if (_totalPage != value)
374
                {
375
                    _totalPage = value;
376
                    OnPropertyChanged("TotalPage");
377
                }
378
            }
379
        }
380

    
381
        [DataMember]
382
        public int CurrentPageNo
383
        {
384
            get
385
            {
386
                return _currentPageNo;
387
            }
388
            set
389
            {
390
                if (_currentPageNo != value)
391
                {
392
                    _currentPageNo = value;
393
                    OnPropertyChanged("CurrentPageNo");
394
                }
395
            }
396
        }
397

    
398
        [DataMember]
399
        public DateTime CreateTime
400
        {
401
            get
402
            {
403
                return _createtime;
404
            }
405
            set
406
            {
407
                if (_createtime != value)
408
                {
409
                    _createtime = value;
410
                    OnPropertyChanged("CreateTime");
411
                }
412
            }
413
        }
414

    
415
        [DataMember]
416
        public DateTime? StartTime
417
        {
418
            get
419
            {
420
                return _starttime;
421
            }
422
            set
423
            {
424
                if (value == null)
425
                {
426
                    _starttime = null;
427
                    OnPropertyChanged("StartTime");
428
                }
429
                else if (_starttime != value)
430
                {
431
                    _starttime = value;
432
                    OnPropertyChanged("StartTime");
433
                }
434
            }
435
        }
436

    
437
        [DataMember]
438
        public DateTime? EndTime
439
        {
440
            get
441
            {
442
                return _endtime;
443
            }
444
            set
445
            {
446
                if (value == null)
447
                {
448
                    _endtime = null;
449
                    OnPropertyChanged("EndTime");
450
                }
451
                else if (_endtime != value)
452
                {
453
                    _endtime = value;
454
                    OnPropertyChanged("EndTime");
455
                }
456
            }
457
        }
458

    
459
        [DataMember]
460
        public string UniqueKey
461
        {
462
            get
463
            {
464
                return _uniqueKey;
465
            }
466
            set
467
            {
468
                if (_uniqueKey != value)
469
                {
470
                    _uniqueKey = value;
471
                    OnPropertyChanged("UniqueKey");
472
                }
473
            }
474
        }
475

    
476

    
477
        [DataMember]
478
        public string Exception
479
        {
480
            get
481
            {
482
                return _exception;
483
            }
484
            set
485
            {
486
                if (_exception != value)
487
                {
488
                    _exception = value;
489
                   OnPropertyChanged("Exception");
490

    
491
                }
492
            }
493
        }
494

    
495
        [DataMember]
496
        public Int64 ProcessorAffinity { get; set; }
497

    
498
        [DataMember]
499
        public string Revision
500
        {
501
            get
502
            {
503
                return _revision;
504
            }
505
            set
506
            {
507
                if (_revision != value)
508
                {
509
                    _revision = value;
510
                    OnPropertyChanged("Revision");
511

    
512
                }
513
            }
514
        }
515

    
516
        [DataMember]
517
        public string DocumentNo
518
        {
519
            get
520
            {
521
                return _documentNo;
522
            }
523
            set
524
            {
525
                if (_documentNo != value)
526
                {
527
                    _documentNo = value;
528
                    OnPropertyChanged("DocumentNo");
529

    
530
                }
531
            }
532
        }
533

    
534
        [DataMember]
535
        public string DocumentName
536
        {
537
            get
538
            {
539
                return _document_Name;
540
            }
541
            set
542
            {
543
                if (_document_Name != value)
544
                {
545
                    _document_Name = value;
546
                    OnPropertyChanged("DocumentName");
547

    
548
                }
549
            }
550
        }
551

    
552
        [DataMember]
553
        public string DocumnetURL
554
        {
555
            get
556
            {
557
                return _documentURL;
558
            }
559
            set
560
            {
561
                if (_documentURL != value)
562
                {
563
                    _documentURL = value;
564
                    OnPropertyChanged("DocumnetURL");
565

    
566
                }
567
            }
568
        }
569

    
570
            
571

    
572
        [DataMember]
573
        public string GroupNo
574
        {
575
            get
576
            {
577
                return _GroupName;
578
            }
579
            set
580
            {
581
                if (_GroupName != value)
582
                {
583
                    _GroupName = value;
584
                    OnPropertyChanged("GroupNo");
585

    
586
                }
587
            }
588
        }
589

    
590

    
591
        [DataMember]
592
        public string DocumentID
593
        {
594
            get
595
            {
596
                return _documentID;
597
            }
598
            set
599
            {
600
                if (_documentID != value)
601
                {
602
                    _documentID = value;
603
                    OnPropertyChanged("DocumentID");
604

    
605
                }
606
            }
607
        }
608

    
609

    
610
        [DataMember]
611
        public string Validation
612
        {
613
            get
614
            {
615
                return _validation;
616
            }
617
            set
618
            {
619
                if (_validation != value)
620
                {
621
                    _validation = value;
622
                    OnPropertyChanged("Validation");
623

    
624
                }
625
            }
626
        }
627

    
628
        [DataMember]
629
        public string MarkusLink
630
        {
631
            get
632
            {
633
                return _MarkusLink;
634
            }
635
            set
636
            {
637
                if (_MarkusLink != value)
638
                {
639
                    _MarkusLink = value;
640
                    OnPropertyChanged("MarkusLink");
641

    
642
                }
643
            }
644
        }
645

    
646
        [DataMember]
647
        private string _DocInfo_ID;
648
        public string DocInfo_ID
649
        {
650
            get
651
            {
652
                return _DocInfo_ID;
653
            }
654
            set
655
            {
656
                if (_DocInfo_ID != value)
657
                {
658
                    _DocInfo_ID = value;
659
                    OnPropertyChanged("DocInfo_ID");
660

    
661
                }
662
            }
663
        }
664

    
665
        [DataMember]
666
        private string _MarkupInfo_ID;
667
        public string MarkupInfo_ID
668
        {
669
            get
670
            {
671
                return _MarkupInfo_ID;
672
            }
673
            set
674
            {
675
                if (_MarkupInfo_ID != value)
676
                {
677
                    _MarkupInfo_ID = value;
678
                    OnPropertyChanged("MarkupInfo_ID");
679

    
680
                }
681
            }
682
        }
683

    
684
        [DataMember]
685
        private string _Create_User_ID;
686
        public string Create_User_ID
687
        {
688
            get
689
            {
690
                return _Create_User_ID;
691
            }
692
            set
693
            {
694
                if (_Create_User_ID != value)
695
                {
696
                    _Create_User_ID = value;
697
                    OnPropertyChanged("Create_User_ID");
698

    
699
                }
700
            }
701
        }
702
    }
703

    
704
    public enum StatusCodeType
705
    {
706
        None = 0,
707
        Wait = 1,
708
        PageLoading = 2,
709
        Saving = 3,
710
        Completed = 4,
711
        FileError = 50,
712
        PageError = 55,
713
        NeedsPassword = 60,
714
        Error = 99,
715
        All_Error = 100
716
    }
717
}
클립보드 이미지 추가 (최대 크기: 500 MB)