프로젝트

일반

사용자정보

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

markus / ConvertService / ServiceBase / Markus.Service.StationController / Data / ConvertPDF.cs @ 95e7bd84

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

1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Linq;
5
using System.Text;
6
using System.Threading.Tasks;
7

    
8
namespace Markus.Service.StationController.Data
9
{
10
    public class ConvertPDF : INotifyPropertyChanged
11
    {
12
        public event PropertyChangedEventHandler PropertyChanged;
13

    
14
        private void OnPropertyChanged(string propertyName)
15
        {
16
            if (PropertyChanged != null)
17
            {
18
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
19
            }
20

    
21
        }
22
        public ConvertPDF()
23
        {
24

    
25
        }
26

    
27
        public bool Equals(ConvertPDF other)
28
        {
29
            if (other is null)
30
                return false;
31

    
32
            return this.ConvertID == other.ConvertID && this.ProjectNumber == other.ProjectNumber;
33
        }
34

    
35
        public override bool Equals(object obj) => Equals(obj as ConvertPDF);
36
        public override int GetHashCode()
37
        {
38
            var id = (ConvertID != null) ? ConvertID : "";
39
            var project = (ProjectNumber != null) ? ProjectNumber : "";
40

    
41
            return (id + project).GetHashCode();
42
        }
43

    
44
        public ConvertPDF(string serviceID, string convertId, string projectNo, int Status, string documentID, string documentName, string documentNo, string document_URL,
45
            string revision, int currentPageNo, int totalPage, string exception, string groupNo,
46
           DateTime create_datetime, DateTime? start_datetime, DateTime? end_datetime, string originfilePath, string convertPath, string markusLink, int? reconverter)
47
        {
48
            ServiceID = serviceID;
49
            DocumentID = documentID;
50
            ConvertID = convertId;
51
            ProjectNumber = projectNo;
52
            ConvertState = (StatusCodeType)Status;
53
            UniqueKey = documentID;
54
            DocumentName = documentName;
55
            DocumentNo = documentNo;
56
            DocumnetURL = document_URL;
57
            Revision = revision;
58
            CurrentPageNo = currentPageNo;
59
            TotalPage = totalPage;
60
            Exception = exception;
61
            GroupNo = groupNo;
62
            CreateTime = create_datetime;
63
            StartTime = start_datetime;
64
            EndTime = end_datetime;
65
            ConvertPath = convertPath;
66
            MarkusLink = markusLink;
67
            OriginfilePath = originfilePath;
68
            ReConverter = reconverter;
69

    
70
            TimeSpan duration = TimeSpan.MinValue;
71
            if (EndTime.HasValue)
72
            {
73
                duration = EndTime.Value - CreateTime;
74
            }
75
            if (duration != TimeSpan.MinValue)
76
            {
77
                TotalTime = duration.ToString();
78
            }
79

    
80
            string result = "";
81
            if (originfilePath.Contains("/"))
82
            {
83
                result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1);
84
            }
85
            else
86
            {
87
                result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1);
88
            }
89
            this._FileName = result;
90
        }
91

    
92
        private string _FileName;
93
        public string FileName
94
        {
95
            get
96
            {
97
                return _FileName;
98
            }
99
            set
100
            {
101
                if (_FileName != value)
102
                {
103
                    _FileName = value;
104
                    OnPropertyChanged("FileName");
105
                }
106
            }
107
        }
108

    
109
        private int? _ReConverter;
110
        public int? ReConverter
111
        {
112
            get
113
            {
114
                return _ReConverter;
115
            }
116
            set
117
            {
118
                if (_ReConverter != value)
119
                {
120
                    _ReConverter = value;
121
                    OnPropertyChanged("ReConverter");
122
                }
123
            }
124
        }
125

    
126
        private string _OriginfilePath;
127
        public string OriginfilePath
128
        {
129
            get
130
            {
131
                return _OriginfilePath;
132
            }
133
            set
134
            {
135
                if (_OriginfilePath != value)
136
                {
137
                    _OriginfilePath = value;
138
                    OnPropertyChanged("OriginfilePath");
139
                }
140
            }
141
        }
142

    
143
        private string _MarkusLink;
144
        public string MarkusLink
145
        {
146
            get
147
            {
148
                return _MarkusLink;
149
            }
150
            set
151
            {
152
                if (_MarkusLink != value)
153
                {
154
                    _MarkusLink = value;
155
                    OnPropertyChanged("MarkusLink");
156

    
157
                }
158
            }
159
        }
160

    
161
        private string _ConvertPath;
162
        public string ConvertPath
163
        {
164
            get
165
            {
166
                return _ConvertPath;
167
            }
168
            set
169
            {
170
                if (_ConvertPath != value)
171
                {
172
                    _ConvertPath = value;
173
                    OnPropertyChanged("ConvertPath");
174
                }
175
            }
176
        }
177

    
178
        private DateTime? _EndTime;
179
        public DateTime? EndTime
180
        {
181
            get
182
            {
183
                return _EndTime;
184
            }
185
            set
186
            {
187
                if (value == null)
188
                {
189
                    _EndTime = null;
190
                    OnPropertyChanged("EndTime");
191
                }
192
                else if (_EndTime != value)
193
                {
194
                    _EndTime = value;
195
                    OnPropertyChanged("EndTime");
196
                }
197
            }
198
        }
199

    
200
        private string _TotalTime;
201
        public string TotalTime
202
        {
203
            get
204
            {
205
                return _TotalTime;
206
            }
207
            set
208
            {
209
                if (_TotalTime != value)
210
                {
211
                    _TotalTime = value;
212
                    OnPropertyChanged("TotalTime");
213

    
214
                }
215
            }
216
        }
217

    
218
        private DateTime? _StartTime;
219
        public DateTime? StartTime
220
        {
221
            get
222
            {
223
                return _StartTime;
224
            }
225
            set
226
            {
227
                if (value == null)
228
                {
229
                    _StartTime = null;
230
                    OnPropertyChanged("StartTime");
231
                }
232
                else if (_StartTime != value)
233
                {
234
                    _StartTime = value;
235
                    OnPropertyChanged("StartTime");
236
                }
237
            }
238
        }
239

    
240
        private DateTime _CreateTime;
241
        public DateTime CreateTime
242
        {
243
            get
244
            {
245
                return _CreateTime;
246
            }
247
            set
248
            {
249
                if (_CreateTime != value)
250
                {
251
                    _CreateTime = value;
252
                    OnPropertyChanged("CreateTime");
253
                }
254
            }
255
        }
256

    
257
        private string _GroupNo;
258
        public string GroupNo
259
        {
260
            get
261
            {
262
                return _GroupNo;
263
            }
264
            set
265
            {
266
                if (_GroupNo != value)
267
                {
268
                    _GroupNo = value;
269
                    OnPropertyChanged("GroupNo");
270

    
271
                }
272
            }
273
        }
274

    
275
        private string _Exception;
276
        public string Exception
277
        {
278
            get
279
            {
280
                return _Exception;
281
            }
282
            set
283
            {
284
                if (_Exception != value)
285
                {
286
                    _Exception = value;
287
                    OnPropertyChanged("Exception");
288

    
289
                }
290
            }
291
        }
292

    
293
        private int _TotalPage;
294
        public int TotalPage
295
        {
296
            get
297
            {
298
                return _TotalPage;
299
            }
300
            set
301
            {
302
                if (_TotalPage != value)
303
                {
304
                    _TotalPage = value;
305
                    OnPropertyChanged("TotalPage");
306
                }
307
            }
308
        }
309

    
310
        private int _CurrentPageNo;
311
        public int CurrentPageNo
312
        {
313
            get
314
            {
315
                return _CurrentPageNo;
316
            }
317
            set
318
            {
319
                if (_CurrentPageNo != value)
320
                {
321
                    _CurrentPageNo = value;
322
                    OnPropertyChanged("CurrentPageNo");
323
                }
324
            }
325
        }
326

    
327
        private string _Revision;
328
        public string Revision
329
        {
330
            get
331
            {
332
                return _Revision;
333
            }
334
            set
335
            {
336
                if (_Revision != value)
337
                {
338
                    _Revision = value;
339
                    OnPropertyChanged("Revision");
340

    
341
                }
342
            }
343
        }
344

    
345
        private string _DocumnetURL;
346
        public string DocumnetURL
347
        {
348
            get
349
            {
350
                return _DocumnetURL;
351
            }
352
            set
353
            {
354
                if (_DocumnetURL != value)
355
                {
356
                    _DocumnetURL = value;
357
                    OnPropertyChanged("DocumnetURL");
358

    
359
                }
360
            }
361
        }
362

    
363
        private string _DocumentNo;
364
        public string DocumentNo
365
        {
366
            get
367
            {
368
                return _DocumentNo;
369
            }
370
            set
371
            {
372
                if (_DocumentNo != value)
373
                {
374
                    _DocumentNo = value;
375
                    OnPropertyChanged("DocumentNo");
376

    
377
                }
378
            }
379
        }
380

    
381
        private string _DocumentName;
382
        public string DocumentName
383
        {
384
            get
385
            {
386
                return _DocumentName;
387
            }
388
            set
389
            {
390
                if (_DocumentName != value)
391
                {
392
                    _DocumentName = value;
393
                    OnPropertyChanged("DocumentName");
394

    
395
                }
396
            }
397
        }
398

    
399
        private string _UniqueKey;
400
        public string UniqueKey
401
        {
402
            get
403
            {
404
                return _UniqueKey;
405
            }
406
            set
407
            {
408
                if (_UniqueKey != value)
409
                {
410
                    _UniqueKey = value;
411
                    OnPropertyChanged("UniqueKey");
412
                }
413
            }
414
        }
415

    
416
        private StatusCodeType _ConvertState;
417
        public StatusCodeType ConvertState
418
        {
419
            get
420
            {
421
                return _ConvertState;
422
            }
423
            set
424
            {
425
                if (_ConvertState != value)
426
                {
427
                    _ConvertState = value;
428
                    OnPropertyChanged("ConvertState");
429
                }
430
            }
431
        }
432

    
433
        private string _DocumentID;
434
        public string DocumentID
435
        {
436
            get
437
            {
438
                return _DocumentID;
439
            }
440
            set
441
            {
442
                if (_DocumentID != value)
443
                {
444
                    _DocumentID = value;
445
                    OnPropertyChanged("DocumentID");
446

    
447
                }
448
            }
449
        }
450

    
451

    
452
        private string _ConvertID;
453
        public string ConvertID
454
        {
455
            get
456
            {
457
                return _ConvertID;
458
            }
459
            set
460
            {
461
                if (_ConvertID != value)
462
                {
463
                    _ConvertID = value;
464
                    OnPropertyChanged("ConvertID");
465
                }
466
            }
467
        }
468

    
469
        private string _ServiceID;
470
        public string ServiceID
471
        {
472
            get
473
            {
474
                return _ServiceID;
475
            }
476
            set
477
            {
478
                if (_ServiceID != value)
479
                {
480
                    _ServiceID = value;
481
                    OnPropertyChanged("ServiceID");
482
                }
483
            }
484
        }
485

    
486
        private string _ProjectNumber;
487
        public string ProjectNumber
488
        {
489
            get
490
            {
491
                return _ProjectNumber;
492
            }
493
            set
494
            {
495
                if (_ProjectNumber != value)
496
                {
497
                    _ProjectNumber = value;
498
                    OnPropertyChanged("ProjectNumber");
499
                }
500
            }
501
        }
502

    
503
        public enum StatusCodeType
504
        {
505
            None = 0,
506
            Wait = 1,
507
            PageLoading = 2,
508
            Saving = 3,
509
            Completed = 4,
510
            FileError = 50,
511
            PageError = 55,
512
            NeedsPassword = 60,
513
            Error = 99,
514
            All_Error = 100,
515
            All = 1000
516
        }
517
    }
518
}
클립보드 이미지 추가 (최대 크기: 500 MB)