프로젝트

일반

사용자정보

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

hytos / ID2.Manager / ID2.Manager.Data / Models / Documents.cs @ 67cfe4dc

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

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

    
7
using System.ComponentModel;
8
using System.Runtime.Serialization;
9

    
10
using Newtonsoft.Json;
11
using System.IO;
12

    
13
namespace ID2.Manager.Data.Models
14
{
15
    //[DataContract]
16
    //[JsonObject(IsReference = true)]
17
    public class Documents : NotifyPropertyChange, IEquatable<Documents>
18
    {
19
        //[DataMember]
20
        public int Seq { get; set; }
21
        //[DataMember]
22
        public string DocID { get; set; }
23
        //[DataMember]
24
        public string DocumentNo { get; set; }
25
        //[DataMember]
26
        public string RevisonNo { get; set; }
27
        //[DataMember]
28
        public string System { get; set; }
29
        //[DataMember]
30
        public string SubSystemCode { get; set; }
31
        public string Team { get; set; }
32

    
33
        private string _Simularity = null;
34
        public string Simularity
35
        {
36
            get => this._Simularity;
37
            set => SetProperty(ref this._Simularity, value);
38
        }
39

    
40
        private string _Simularity2 = null;
41
        public string Simularity2
42
        {
43
            get => this._Simularity2;
44
            set => SetProperty(ref this._Simularity2, value);
45
        }
46

    
47
        private string _RefProjectCode = string.Empty;
48
        //[DataMember]
49
        public string RefProjectCode
50
        {
51
            get => this._RefProjectCode;
52
            set => SetProperty(ref this._RefProjectCode, value);
53
        }
54

    
55
        private string _JobLevel = string.Empty;
56
        //[DataMember]
57
        public string JobLevel
58
        {
59
            get => this._JobLevel;
60
            set => SetProperty(ref this._JobLevel, value);
61
        }
62

    
63
        private string _PersonInCharge = null;
64
        //[DataMember]
65
        public string PersonInCharge
66
        {
67
            get => this._PersonInCharge;
68
            set => SetProperty(ref this._PersonInCharge, value);
69
        }
70

    
71
        private string _Worker = null;
72
        //[DataMember]
73
        public string Worker
74
        {
75
            get => this._Worker;
76
            set => SetProperty(ref this._Worker, value);
77
        }
78

    
79
        //[DataMember]
80
        public string RegisteredUser { get; set; }
81
        //[DataMember]
82
        public string ModifiedUser { get; set; }
83
        //[DataMember]
84
        public string DeletedUser { get; set; }
85

    
86
        private string _ToIsDiscussion = string.Empty;
87
        //[DataMember]
88
        public string ToIsDiscussion
89
        {
90
            get => this._ToIsDiscussion;
91
            set => SetProperty(ref this._ToIsDiscussion, value);
92
        }
93

    
94
        //[DataMember]
95
        public string ToRemarks { get; set; }
96

    
97
        private string _ToCreator = null;
98
        //[DataMember]
99
        public string ToCreator
100
        {
101
            get => this._ToCreator;
102
            set => SetProperty(ref this._ToCreator, value);
103
        }
104

    
105
        public int ToCapture { get; set; }
106

    
107
        private string _FrReviewStatus = string.Empty;
108
        //[DataMember]
109
        public string FrReviewStatus
110
        {
111
            get => this._FrReviewStatus;
112
            set => SetProperty(ref this._FrReviewStatus, value);
113
        }
114

    
115
        //[DataMember]
116
        public string FrRemarks { get; set; }
117

    
118
        private string _FrCreator = null;
119
        //[DataMember]
120
        public string FrCreator
121
        {
122
            get => this._FrCreator;
123
            set => SetProperty(ref this._FrCreator, value);
124
        }
125

    
126
        public int FrCapture { get; set; }
127
        //[DataMember]
128
        public DateTime? ID2StartDate { get; set; }
129
        //[DataMember]
130
        public DateTime? ID2EndDate { get; set; }
131

    
132

    
133
        private string _ID2Status = string.Empty;
134
        //[DataMember]
135
        public string ID2Status
136
        {
137
            get => this._ID2Status;
138
            set => SetProperty(ref this._ID2Status, value);
139
        }
140

    
141

    
142
        //[DataMember]
143
        public string ID2Issues { get; set; }
144
        public int ID2Capture { get; set; }
145
        //[DataMember]
146
        public string ReplyModifications { get; set; }
147

    
148
        private string _ReplyRequester = null;
149
        //[DataMember]
150
        public string ReplyRequester
151
        {
152
            get => this._ReplyRequester;
153
            set => SetProperty(ref this._ReplyRequester, value);
154
        }
155

    
156
        private string _IsConvert = string.Empty;
157
        //[DataMember]
158
        public string IsConvert
159
        {
160
            get => this._IsConvert;
161
            set => SetProperty(ref this._IsConvert, value);
162
        }
163

    
164
        private string _AVEVAPersonInCharge = null;
165
        //[DataMember]
166
        public string AVEVAPersonInCharge
167
        {
168
            get => this._AVEVAPersonInCharge;
169
            set => SetProperty(ref this._AVEVAPersonInCharge, value);
170
        }
171

    
172
        private string _AVEVAWorker = null;
173
        //[DataMember]
174
        public string AVEVAWorker
175
        {
176
            get => this._AVEVAWorker;
177
            set => SetProperty(ref this._AVEVAWorker, value);
178
        }
179

    
180
        //[DataMember]
181
        public DateTime? AVEVAConvertDate { get; set; }
182
        //[DataMember]
183
        public DateTime? AVEVAReviewDate { get; set; }
184
        //[DataMember]
185
        public DateTime? AVEVAWorkDate { get; set; }
186

    
187
        private string _AVEVAStatus = string.Empty;
188
        //[DataMember]
189
        public string AVEVAStatus
190
        {
191
            get => this._AVEVAStatus;
192
            set => SetProperty(ref this._AVEVAStatus, value);
193
        }
194

    
195
        //[DataMember]
196
        public string AVEVAIssues { get; set; }
197

    
198
        private string _ProdReviewer = null;
199
        //[DataMember]
200
        public string ProdReviewer
201
        {
202
            get => this._ProdReviewer;
203
            set => SetProperty(ref this._ProdReviewer, value);
204
        }
205

    
206
        private string _ProdIsResult = string.Empty;
207
        //[DataMember]
208
        public string ProdIsResult
209
        {
210
            get => this._ProdIsResult;
211
            set => SetProperty(ref this._ProdIsResult, value);
212
        }
213

    
214
        //[DataMember]
215
        public string ProdRemarks { get; set; }
216

    
217
        private string _ClientReviewer = null;
218
        //[DataMember]
219
        public string ClientReviewer
220
        {
221
            get => this._ClientReviewer;
222
            set => SetProperty(ref this._ClientReviewer, value);
223
        }
224

    
225
        private string _ClientIsResult = string.Empty;
226
        //[DataMember]
227
        public string ClientIsResult
228
        {
229
            get => this._ClientIsResult;
230
            set => SetProperty(ref this._ClientIsResult, value);
231
        }
232

    
233
        //[DataMember]
234
        public string ClientRemarks { get; set; }
235

    
236
        private string _DTIsGateWay = string.Empty;
237
        //[DataMember]
238
        public string DTIsGateWay
239
        {
240
            get => this._DTIsGateWay;
241
            set => SetProperty(ref this._DTIsGateWay, value);
242
        }
243

    
244
        private string _DTIsImport = string.Empty;
245
        //[DataMember]
246
        public string DTIsImport
247
        {
248
            get => this._DTIsImport;
249
            set => SetProperty(ref this._DTIsImport, value);
250
        }
251

    
252
        private string _DTIsRegSystem = string.Empty;
253
        //[DataMember]
254
        public string DTIsRegSystem
255
        {
256
            get => this._DTIsRegSystem;
257
            set => SetProperty(ref this._DTIsRegSystem, value);
258
        }
259

    
260
        //[DataMember]
261
        public string DTRemarks { get; set; }
262

    
263
        public List<MarkupText> Markups { get; set; }
264

    
265
        public bool IsMarkup
266
        {
267
            get
268
            {
269
                return Markups?.Count > 0;
270
            }
271
        }
272

    
273
        public List<AttFileInfo> AttFiles { get; set; }
274

    
275
        public int ConvertStatus { get; set; }
276

    
277
        /// <summary>
278
        /// Local에 위치한 Drawing Folder
279
        /// </summary>
280
        public string LocalDrawingFolder { get; set; }
281

    
282
        /// <summary>
283
        /// Local에 위치한 도면 위치
284
        /// </summary>
285
        public string LocalDrawingFilePath
286
        {
287
            get
288
            {
289
                if (LocalDrawingFolder != null)
290
                    return Path.Combine(LocalDrawingFolder, "Drawings", "Native", $"{this.DocumentNo}.dwg");
291

    
292
                return string.Empty;
293
            }
294
        }
295

    
296
        public override bool Equals(object obj)
297
        {
298
            return Equals(obj as Documents);
299
        }
300

    
301
        public bool Equals(Documents other)
302
        {
303

    
304
            if (this != null && other == null)
305
                return false;
306

    
307
            if (this.DocumentNo != other.DocumentNo) return false;
308
            if (this.RevisonNo != other.RevisonNo) return false;
309
            if (this.System != other.System) return false;
310
            if (this.SubSystemCode != other.SubSystemCode) return false;
311
            if (this.RefProjectCode != other.RefProjectCode) return false;
312
            if (this.JobLevel != other.JobLevel) return false;
313
            if (this.Simularity != other.Simularity) return false;
314
            if (this.Simularity2 != other.Simularity2) return false;
315
            if (this.PersonInCharge != other.PersonInCharge) return false;
316
            if (this.Worker != other.Worker) return false;
317
            if (this.ToIsDiscussion != other.ToIsDiscussion) return false;
318
            if (this.ToRemarks != other.ToRemarks) return false;
319
            if (this.ToCreator != other.ToCreator) return false;
320

    
321
            if (this.FrReviewStatus != other.FrReviewStatus) return false;
322
            if (this.FrRemarks != other.FrRemarks) return false;
323
            if (this.FrCreator != other.FrCreator) return false;
324
            if (this.ID2StartDate != other.ID2StartDate) return false;
325
            if (this.ID2EndDate != other.ID2EndDate) return false;
326
            if (this.ID2Status != other.ID2Status) return false;
327
            if (this.ID2Issues != other.ID2Issues) return false;
328
            if (this.ReplyModifications != other.ReplyModifications) return false;
329
            if (this.ReplyRequester != other.ReplyRequester) return false;
330
            if (this.IsConvert != other.IsConvert) return false;
331
            if (this.AVEVAPersonInCharge != other.AVEVAPersonInCharge) return false;
332
            if (this.AVEVAWorker != other.AVEVAWorker) return false;
333
            if (this.AVEVAConvertDate != other.AVEVAConvertDate) return false;
334
            if (this.AVEVAReviewDate != other.AVEVAReviewDate) return false;
335
            if (this.AVEVAWorkDate != other.AVEVAWorkDate) return false;
336
            if (this.AVEVAStatus != other.AVEVAStatus) return false;
337
            if (this.AVEVAIssues != other.AVEVAIssues) return false;
338
            if (this.ProdReviewer != other.ProdReviewer) return false;
339
            if (this.ProdIsResult != other.ProdIsResult) return false;
340
            if (this.ProdRemarks != other.ProdRemarks) return false;
341
            if (this.ClientReviewer != other.ClientReviewer) return false;
342
            if (this.ClientIsResult != other.ClientIsResult) return false;
343
            if (this.ClientRemarks != other.ClientRemarks) return false;
344
            if (this.DTIsGateWay != other.DTIsGateWay) return false;
345
            if (this.DTIsImport != other.DTIsImport) return false;
346
            if (this.DTIsRegSystem != other.DTIsRegSystem) return false;
347
            if (this.DTRemarks != other.DTRemarks) return false;
348
            if (this.ConvertStatus != other.ConvertStatus) return false;
349

    
350
            if (this.AttFiles == null && other.AttFiles == null)
351
            {
352
                return true;
353
            }
354
            else if (this.AttFiles != null && other.AttFiles != null)
355
            {
356
                if (!this.AttFiles.SequenceEqual(other.AttFiles))
357
                    return false;
358
            }
359
            else
360
            {
361
                return false;
362
            }
363

    
364
            //bool result =  this.FrReviewStatus == other.FrReviewStatus && this.FrRemarks == other.FrRemarks && this.FrCreator == other.FrCreator
365
            //    && this.ID2StartDate == other.ID2StartDate && this.ID2EndDate == other.ID2EndDate && this.ID2Status == other.ID2Status
366
            //    && this.ID2Issues == other.ID2Issues && this.ReplyModifications == other.ReplyModifications && this.ReplyRequester == other.ReplyRequester && this.IsConvert == other.IsConvert && this.AVEVAPersonInCharge == other.AVEVAPersonInCharge && this.AVEVAWorker == other.AVEVAWorker
367
            //    && this.AVEVAConvertDate == other.AVEVAConvertDate && this.AVEVAReviewDate == other.AVEVAReviewDate && this.AVEVAWorkDate == other.AVEVAWorkDate
368
            //    && this.AVEVAStatus == other.AVEVAStatus && this.AVEVAIssues == other.AVEVAIssues
369
            //    && this.ProdReviewer == other.ProdReviewer && this.ProdIsResult == other.ProdIsResult && this.ProdRemarks == other.ProdRemarks && this.ClientReviewer == other.ClientReviewer
370
            //    && this.ClientIsResult == other.ClientIsResult && this.ClientRemarks == other.ClientRemarks && this.DTIsGateWay == other.DTIsGateWay && this.DTIsImport == other.DTIsImport
371
            //    && this.DTIsRegSystem == other.DTIsRegSystem && this.DTRemarks == other.DTRemarks && this.ConvertStatus == other.ConvertStatus
372
            //    && isAttfilesEqual;
373

    
374
            //if (result == false)
375
            //{
376
            //    string id = this.DocID;
377
            //}
378

    
379
            return true;
380

    
381
        }
382
        public override int GetHashCode()
383
        {
384
            return this.DocumentNo.GetNullableHash() + this.RevisonNo.GetNullableHash() + this.System.GetNullableHash() + this.SubSystemCode.GetNullableHash()
385
                + this.RefProjectCode.GetNullableHash() + this.JobLevel.GetNullableHash() + this.Simularity.GetNullableHash() + this.Simularity2.GetNullableHash()
386
                + this.PersonInCharge.GetNullableHash() + this.Worker.GetNullableHash() + this.ToIsDiscussion.GetNullableHash() + this.ToRemarks.GetNullableHash()
387
                + this.ToCreator.GetNullableHash()
388
                + this.FrReviewStatus.GetNullableHash() + this.FrRemarks.GetNullableHash() + this.FrCreator.GetNullableHash()
389
                + this.ID2StartDate.GetNullableHash() + this.ID2EndDate.GetNullableHash() + this.ID2Status.GetNullableHash()
390
                + this.ID2Issues.GetNullableHash() + this.ReplyModifications.GetNullableHash() + this.ReplyRequester.GetNullableHash() + this.IsConvert.GetNullableHash() + this.AVEVAPersonInCharge.GetNullableHash() + this.AVEVAWorker.GetNullableHash()
391
                + this.AVEVAConvertDate.GetNullableHash() + this.AVEVAReviewDate.GetNullableHash() + this.AVEVAWorkDate.GetNullableHash()
392
                + this.AVEVAStatus.GetNullableHash() + this.AVEVAIssues.GetNullableHash()
393
                + this.ProdReviewer.GetNullableHash() + this.ProdIsResult.GetNullableHash() + this.ProdRemarks.GetNullableHash() + this.ClientReviewer.GetNullableHash()
394
                + this.ClientIsResult.GetNullableHash() + this.ClientRemarks.GetNullableHash() + this.DTIsGateWay.GetNullableHash() + this.DTIsImport.GetNullableHash()
395
                + this.DTIsRegSystem.GetNullableHash() + this.DTRemarks.GetNullableHash() + this.ConvertStatus.GetNullableHash();
396
        }
397

    
398
        public class DocumentsKeyCompare : IEqualityComparer<Documents>
399
        {
400
            public bool Equals(Documents x, Documents y)
401
            {
402
                if (x == null && y == null)
403
                    return true;
404
                else if (x == null || y == null)
405
                    return false;
406
                else
407
                {
408
                    return x.DocID == y.DocID;
409
                }
410
            }
411

    
412
            public int GetHashCode(Documents obj)
413
            {
414
                return (obj.DocID != null ? obj.DocID.GetHashCode() : 0);
415
            }
416
        }
417

    
418
        public class DocumentsUniqueCompare : IEqualityComparer<Documents>
419
        {
420
            public bool Equals(Documents x, Documents y)
421
            {
422
                if (x == null && y == null)
423
                    return true;
424
                else if (x == null || y == null)
425
                    return false;
426
                else
427
                {
428
                    return x.RefProjectCode == y.RefProjectCode && x.DocumentNo == y.DocumentNo;
429
                }
430
            }
431

    
432
            public int GetHashCode(Documents obj)
433
            {
434
                return (obj.RefProjectCode != null ? obj.RefProjectCode.GetHashCode() : 0) + (obj.DocumentNo != null ? obj.DocumentNo.GetHashCode() : 0);
435
            }
436
        }
437

    
438
        public void DataCopy(Documents docData)
439
        {
440
            this.DocumentNo = docData.DocumentNo;
441
            this.RevisonNo = docData.RevisonNo;
442
            this.System = docData.System;
443
            this.SubSystemCode = docData.SubSystemCode;
444
            this.RefProjectCode = docData.RefProjectCode;
445
            this.JobLevel = docData.JobLevel;
446
            //this.Simularity = docData.Simularity;
447
            //this.Simularity2 = docData.Simularity2;
448
            this.PersonInCharge = docData.PersonInCharge;
449
            this.Worker = docData.Worker;
450
            this.ToIsDiscussion = docData.ToIsDiscussion;
451
            this.ToRemarks = docData.ToRemarks;
452
            this.ToCreator = docData.ToCreator;
453
            this.ToCapture += docData.ToCapture;
454
            this.FrReviewStatus = docData.FrReviewStatus;
455
            this.FrRemarks = docData.FrRemarks;
456
            this.FrCapture += docData.FrCapture;
457
            this.FrCreator = docData.FrCreator;
458
            this.ID2StartDate = docData.ID2StartDate;
459
            this.ID2EndDate = docData.ID2EndDate;
460
            this.ID2Status = docData.ID2Status;
461
            this.ID2Issues = docData.ID2Issues;
462
            this.ID2Capture += docData.ID2Capture;
463
            this.ReplyModifications = docData.ReplyModifications;
464
            this.ReplyRequester = docData.ReplyRequester;
465
            this.IsConvert = docData.IsConvert;
466
            this.AVEVAPersonInCharge = docData.AVEVAPersonInCharge;
467
            this.AVEVAWorker = docData.AVEVAWorker;
468
            this.AVEVAConvertDate = docData.AVEVAConvertDate;
469
            this.AVEVAReviewDate = docData.AVEVAReviewDate;
470
            this.AVEVAWorkDate = docData.AVEVAWorkDate;
471
            this.AVEVAStatus = docData.AVEVAStatus;
472
            this.AVEVAIssues = docData.AVEVAIssues;
473
            this.ProdReviewer = docData.ProdReviewer;
474
            this.ProdIsResult = docData.ProdIsResult;
475
            this.ProdRemarks = docData.ProdRemarks;
476
            this.ClientReviewer = docData.ClientReviewer;
477
            this.ClientIsResult = docData.ClientIsResult;
478
            this.ClientRemarks = docData.ClientRemarks;
479
            this.DTIsGateWay = docData.DTIsGateWay;
480
            this.DTIsImport = docData.DTIsImport;
481
            this.DTIsRegSystem = docData.DTIsRegSystem;
482
            this.DTRemarks = docData.DTRemarks;
483
            if (this.AttFiles == null)
484
                this.AttFiles = docData.AttFiles;
485
            else
486
                this.AttFiles.AddRange(docData.AttFiles ?? new List<AttFileInfo>());
487
        }
488
    }
489

    
490
    [DataContract]
491
    public class ID2Drawings
492
    {
493
        //[DataMember]
494
        public string PROJECTNAME { get; set; }
495
        //[DataMember]
496
        public string UID { get; set; }
497
        //[DataMember]
498
        public string NAME { get; set; }
499
        //[DataMember]
500
        public string DOCNAME { get; set; }
501
        //[DataMember]
502
        public DateTime? DATETIME { get; set; }
503
        //[DataMember]
504
        public string OCCUPIED { get; set; }
505
        //[DataMember]
506
        public byte[] Image { get; set; }
507
    }
508

    
509
    [DataContract]
510
    public class ID2Symbol
511
    {
512
        [DisplayName("Project")]
513
        [ReadOnly(true)]
514
        public string PrjName { get; set; }
515
        [Browsable(false)]
516
        [ReadOnly(true)]
517
        public string PrjPath { get; set; }
518
        [DataMember]
519
        [ReadOnly(true)]
520
        public string Name { get; set; }
521
        [DataMember]
522
        [ReadOnly(true)]
523
        public string Type { get; set; }
524
        [DataMember]
525
        [Browsable(false)]
526
        [ReadOnly(true)]
527
        public string OriginalPoint { get; set; }
528
        [DataMember]
529
        [Browsable(false)]
530
        [ReadOnly(true)]
531
        public string ConnectionPoint { get; set; }
532

    
533
        [ReadOnly(true)]
534
        public int Width{ get; set; }
535

    
536
        [ReadOnly(true)]
537
        public int Height{ get; set; }
538
    }
539

    
540
    [DataContract]
541
    public class ID2Configuration
542
    {
543
        public string Section{ get; set; }
544
        public string Key{ get; set; }
545
        public string Value{ get; set; }
546
    }
547

    
548
    public class DocumentsResult
549
    {
550
        public List<Documents> Dwgs { get; set; }
551
        public int TotalCount { get; set; }
552
    }
553
}
클립보드 이미지 추가 (최대 크기: 500 MB)