프로젝트

일반

사용자정보

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

hytos / ID2.Manager / ID2.Manager.Data / Models / Documents.cs @ 0a6036cb

이력 | 보기 | 이력해설 | 다운로드 (18.8 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

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

    
33
        private string _RefProjectCode = string.Empty;
34
        //[DataMember]
35
        public string RefProjectCode
36
        {
37
            get => this._RefProjectCode;
38
            set => SetProperty(ref this._RefProjectCode, value);
39
        }
40

    
41
        private string _JobLevel = string.Empty;
42
        //[DataMember]
43
        public string JobLevel
44
        {
45
            get => this._JobLevel;
46
            set => SetProperty(ref this._JobLevel, value);
47
        }
48

    
49
        private string _PersonInCharge = string.Empty;
50
        //[DataMember]
51
        public string PersonInCharge
52
        {
53
            get => this._PersonInCharge;
54
            set => SetProperty(ref this._PersonInCharge, value);
55
        }
56

    
57
        private string _Worker = string.Empty;
58
        //[DataMember]
59
        public string Worker
60
        {
61
            get =>  this._Worker;
62
            set => SetProperty(ref this._Worker, value);
63
        }
64

    
65
        //[DataMember]
66
        public string RegisteredUser { get; set; }
67
        //[DataMember]
68
        public string ModifiedUser { get; set; }
69
        //[DataMember]
70
        public string DeletedUser { get; set; }
71

    
72
        private string _ToIsDiscussion = string.Empty;
73
        //[DataMember]
74
        public string ToIsDiscussion
75
        {
76
            get => this._ToIsDiscussion;
77
            set => SetProperty(ref this._ToIsDiscussion, value);
78
        }
79

    
80
        //[DataMember]
81
        public string ToRemarks { get; set; }
82

    
83
        private string _ToCreator = string.Empty;
84
        //[DataMember]
85
        public string ToCreator
86
        {
87
            get => this._ToCreator;
88
            set => SetProperty(ref this._ToCreator, value);
89
        }
90

    
91
        public int ToCapture { get; set; }
92

    
93
        private string _FrReviewStatus = string.Empty;
94
        //[DataMember]
95
        public string FrReviewStatus
96
        {
97
            get => this._FrReviewStatus;
98
            set => SetProperty(ref this._FrReviewStatus, value);
99
        }
100

    
101
        //[DataMember]
102
        public string FrRemarks { get; set; }
103

    
104
        private string _FrCreator = string.Empty;
105
        //[DataMember]
106
        public string FrCreator
107
        {
108
            get => this._FrCreator;
109
            set => SetProperty(ref this._FrCreator, value);
110
        }
111

    
112
        public int FrCapture { get; set; }
113
        //[DataMember]
114
        public DateTime? ID2StartDate { get; set; }
115
        //[DataMember]
116
        public DateTime? ID2EndDate { get; set; }
117

    
118

    
119
        private string _ID2Status = string.Empty;
120
        //[DataMember]
121
        public string ID2Status
122
        {
123
            get => this._ID2Status;
124
            set => SetProperty(ref this._ID2Status, value);
125
        }
126

    
127

    
128
        //[DataMember]
129
        public string ID2Issues { get; set; }
130
        public int ID2Capture { get; set; }
131
        //[DataMember]
132
        public string ReplyModifications { get; set; }
133

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

    
142
        private string _IsConvert = string.Empty;
143
        //[DataMember]
144
        public string IsConvert
145
        {
146
            get => this._IsConvert;
147
            set => SetProperty(ref this._IsConvert, value);
148
        }
149

    
150
        private string _AVEVAPersonInCharge = string.Empty;
151
        //[DataMember]
152
        public string AVEVAPersonInCharge
153
        {
154
            get => this._AVEVAPersonInCharge;
155
            set => SetProperty(ref this._AVEVAPersonInCharge, value);
156
        }
157

    
158
        private string _AVEVAWorker = string.Empty;
159
        //[DataMember]
160
        public string AVEVAWorker
161
        {
162
            get => this._AVEVAWorker;
163
            set => SetProperty(ref this._AVEVAWorker, value);
164
        }
165

    
166
        //[DataMember]
167
        public DateTime? AVEVAConvertDate { get; set; }
168
        //[DataMember]
169
        public DateTime? AVEVAReviewDate { get; set; }
170
        //[DataMember]
171
        public DateTime? AVEVAWorkDate { get; set; }
172

    
173
        private string _AVEVAStatus = string.Empty;
174
        //[DataMember]
175
        public string AVEVAStatus
176
        {
177
            get => this._AVEVAStatus;
178
            set => SetProperty(ref this._AVEVAStatus, value);
179
        }
180

    
181
        //[DataMember]
182
        public string AVEVAIssues { get; set; }
183

    
184
        private string _ProdReviewer = string.Empty;
185
        //[DataMember]
186
        public string ProdReviewer
187
        {
188
            get => this._ProdReviewer;
189
            set => SetProperty(ref this._ProdReviewer, value);
190
        }
191

    
192
        private string _ProdIsResult = string.Empty;
193
        //[DataMember]
194
        public string ProdIsResult
195
        {
196
            get => this._ProdIsResult;
197
            set => SetProperty(ref this._ProdIsResult, value);
198
        }
199

    
200
        //[DataMember]
201
        public string ProdRemarks { get; set; }
202

    
203
        private string _ClientReviewer = string.Empty;
204
        //[DataMember]
205
        public string ClientReviewer
206
        {
207
            get => this._ClientReviewer;
208
            set => SetProperty(ref this._ClientReviewer, value);
209
        }
210

    
211
        private string _ClientIsResult = string.Empty;
212
        //[DataMember]
213
        public string ClientIsResult
214
        {
215
            get => this._ClientIsResult;
216
            set => SetProperty(ref this._ClientIsResult, value);
217
        }
218

    
219
        //[DataMember]
220
        public string ClientRemarks { get; set; }
221

    
222
        private string _DTIsGateWay = string.Empty;
223
        //[DataMember]
224
        public string DTIsGateWay
225
        {
226
            get => this._DTIsGateWay;
227
            set => SetProperty(ref this._DTIsGateWay, value);
228
        }
229

    
230
        private string _DTIsImport = string.Empty;
231
        //[DataMember]
232
        public string DTIsImport
233
        {
234
            get => this._DTIsImport;
235
            set => SetProperty(ref this._DTIsImport, value);
236
        }
237

    
238
        private string _DTIsRegSystem = string.Empty;
239
        //[DataMember]
240
        public string DTIsRegSystem
241
        {
242
            get => this._DTIsRegSystem;
243
            set => SetProperty(ref this._DTIsRegSystem, value);
244
        }
245

    
246
        //[DataMember]
247
        public string DTRemarks { get; set; }
248

    
249
        public List<MarkupText> Markups { get; set; }
250

    
251
        public List<AttFileInfo> AttFiles { get; set; }
252

    
253
        public int ConvertStatus { get; set; }
254

    
255
        public override bool Equals(object obj)
256
        {
257
            return Equals(obj as Documents);
258
        }
259

    
260
        public bool Equals(Documents other)
261
        {
262
            bool isAttfilesEqual = false;
263

    
264
            if (this != null && other == null)
265
                return false;
266

    
267
            if (this.AttFiles == null && other.AttFiles == null)
268
            {
269
                isAttfilesEqual = true;
270
            }
271

    
272
            if (isAttfilesEqual)
273
            {
274
                if (this.DocumentNo != other.DocumentNo)
275
                    return false;
276

    
277
                if (this.RevisonNo != other.RevisonNo)
278
                    return false;
279

    
280
                if (this.System != other.System)
281
                    return false;
282

    
283
                if (this.SubSystemCode != other.SubSystemCode)
284
                    return false;
285

    
286
                if (this.RefProjectCode != other.RefProjectCode)
287
                    return false;
288

    
289
                if (this.JobLevel != other.JobLevel)
290
                    return false;
291

    
292
                if (this.PersonInCharge != other.PersonInCharge)
293
                    return false;
294

    
295
                if (this.ToIsDiscussion != other.ToIsDiscussion)
296
                    return false;
297

    
298
                if (this.ToRemarks != other.ToRemarks)
299
                    return false;
300

    
301
                if (this.ToCreator != other.ToCreator)
302
                    return false;
303

    
304
                if (this.FrReviewStatus != other.FrReviewStatus) return false;
305
                if ( this.FrRemarks != other.FrRemarks                           )      return false;
306
                if ( this.FrCreator != other.FrCreator                           )      return false;
307
                if ( this.ID2StartDate != other.ID2StartDate                     )      return false;
308
                if ( this.ID2EndDate != other.ID2EndDate                         )      return false;
309
                if ( this.ID2Status != other.ID2Status                           )      return false;
310
                if ( this.ID2Issues != other.ID2Issues                           )      return false;
311
                if ( this.ReplyModifications != other.ReplyModifications         )      return false;
312
                if ( this.ReplyRequester != other.ReplyRequester                 )      return false;
313
                if ( this.IsConvert != other.IsConvert                           )      return false;
314
                if ( this.AVEVAPersonInCharge != other.AVEVAPersonInCharge       )      return false;
315
                if ( this.AVEVAWorker != other.AVEVAWorker                       )      return false;
316
                if ( this.AVEVAConvertDate != other.AVEVAConvertDate             )      return false;
317
                if ( this.AVEVAReviewDate != other.AVEVAReviewDate               )      return false;
318
                if ( this.AVEVAWorkDate != other.AVEVAWorkDate                   )      return false;
319
                if ( this.AVEVAStatus != other.AVEVAStatus                       )      return false;
320
                if ( this.AVEVAIssues != other.AVEVAIssues                       )      return false;
321
                if ( this.ProdReviewer != other.ProdReviewer                     )      return false;
322
                if ( this.ProdIsResult != other.ProdIsResult                     )      return false;
323
                if ( this.ProdRemarks != other.ProdRemarks                       )      return false;
324
                if ( this.ClientReviewer != other.ClientReviewer                 )      return false;
325
                if ( this.ClientIsResult != other.ClientIsResult                 )      return false;
326
                if ( this.ClientRemarks != other.ClientRemarks                   )      return false;
327
                if ( this.DTIsGateWay != other.DTIsGateWay                       )      return false;
328
                if ( this.DTIsImport != other.DTIsImport                         )      return false;
329
                if ( this.DTIsRegSystem != other.DTIsRegSystem                   )      return false;
330
                if ( this.DTRemarks != other.DTRemarks                           )      return false;
331
                if ( this.ConvertStatus != other.ConvertStatus) return false;
332
            }
333
            else if (this.AttFiles != null && other.AttFiles != null)
334
            {
335
                if (!this.AttFiles.SequenceEqual(other.AttFiles))
336
                    return false;
337
            }
338

    
339
            //bool result =  this.FrReviewStatus == other.FrReviewStatus && this.FrRemarks == other.FrRemarks && this.FrCreator == other.FrCreator
340
            //    && this.ID2StartDate == other.ID2StartDate && this.ID2EndDate == other.ID2EndDate && this.ID2Status == other.ID2Status
341
            //    && this.ID2Issues == other.ID2Issues && this.ReplyModifications == other.ReplyModifications && this.ReplyRequester == other.ReplyRequester && this.IsConvert == other.IsConvert && this.AVEVAPersonInCharge == other.AVEVAPersonInCharge && this.AVEVAWorker == other.AVEVAWorker
342
            //    && this.AVEVAConvertDate == other.AVEVAConvertDate && this.AVEVAReviewDate == other.AVEVAReviewDate && this.AVEVAWorkDate == other.AVEVAWorkDate
343
            //    && this.AVEVAStatus == other.AVEVAStatus && this.AVEVAIssues == other.AVEVAIssues
344
            //    && this.ProdReviewer == other.ProdReviewer && this.ProdIsResult == other.ProdIsResult && this.ProdRemarks == other.ProdRemarks && this.ClientReviewer == other.ClientReviewer
345
            //    && this.ClientIsResult == other.ClientIsResult && this.ClientRemarks == other.ClientRemarks && this.DTIsGateWay == other.DTIsGateWay && this.DTIsImport == other.DTIsImport
346
            //    && this.DTIsRegSystem == other.DTIsRegSystem && this.DTRemarks == other.DTRemarks && this.ConvertStatus == other.ConvertStatus
347
            //    && isAttfilesEqual;
348

    
349
            //if (result == false)
350
            //{
351
            //    string id = this.DocID;
352
            //}
353

    
354
            return true;
355

    
356
        }
357
        public override int GetHashCode()
358
        {
359
            return this.DocumentNo.GetNullableHash() + this.RevisonNo.GetNullableHash() + this.System.GetNullableHash() + this.SubSystemCode.GetNullableHash()
360
                + this.RefProjectCode.GetNullableHash() + this.JobLevel.GetNullableHash()
361
                + this.PersonInCharge.GetNullableHash() + this.ToIsDiscussion.GetNullableHash() + this.ToRemarks.GetNullableHash()
362
                + this.ToCreator.GetNullableHash()
363
                + this.FrReviewStatus.GetNullableHash() + this.FrRemarks.GetNullableHash() + this.FrCreator.GetNullableHash()
364
                + this.ID2StartDate.GetNullableHash() + this.ID2EndDate.GetNullableHash() + this.ID2Status.GetNullableHash()
365
                + this.ID2Issues.GetNullableHash() + this.ReplyModifications.GetNullableHash() + this.ReplyRequester.GetNullableHash() + this.IsConvert.GetNullableHash() + this.AVEVAPersonInCharge.GetNullableHash() + this.AVEVAWorker.GetNullableHash()
366
                + this.AVEVAConvertDate.GetNullableHash() + this.AVEVAReviewDate.GetNullableHash() + this.AVEVAWorkDate.GetNullableHash()
367
                + this.AVEVAStatus.GetNullableHash() + this.AVEVAIssues.GetNullableHash()
368
                + this.ProdReviewer.GetNullableHash() + this.ProdIsResult.GetNullableHash() + this.ProdRemarks.GetNullableHash() + this.ClientReviewer.GetNullableHash()
369
                + this.ClientIsResult.GetNullableHash() + this.ClientRemarks.GetNullableHash() + this.DTIsGateWay.GetNullableHash() + this.DTIsImport.GetNullableHash()
370
                + this.DTIsRegSystem.GetNullableHash() + this.DTRemarks.GetNullableHash() + this.ConvertStatus.GetNullableHash();
371
        }
372

    
373
        public class DocumentsKeyCompare : IEqualityComparer<Documents>
374
        {
375
            public bool Equals(Documents x, Documents y)
376
            {
377
                if (x == null && y == null)
378
                    return true;
379
                else if (x == null || y == null)
380
                    return false;
381
                else
382
                {
383
                    return x.DocID == y.DocID;
384
                }
385
            }
386

    
387
            public int GetHashCode(Documents obj)
388
            {
389
                return (obj.DocID != null ? obj.DocID.GetHashCode() : 0);
390
            }
391
        }
392

    
393
        public class DocumentsUniqueCompare : IEqualityComparer<Documents>
394
        {
395
            public bool Equals(Documents x, Documents y)
396
            {
397
                if (x == null && y == null)
398
                    return true;
399
                else if (x == null || y == null)
400
                    return false;
401
                else
402
                {
403
                    return x.RefProjectCode == y.RefProjectCode && x.DocumentNo == y.DocumentNo;
404
                }
405
            }
406

    
407
            public int GetHashCode(Documents obj)
408
            {
409
                return (obj.RefProjectCode != null ? obj.RefProjectCode.GetHashCode() : 0) + (obj.DocumentNo != null ? obj.DocumentNo.GetHashCode() : 0);
410
            }
411
        }
412

    
413
        public void DataCopy(Documents docData)
414
        {
415
            this.DocumentNo = docData.DocumentNo;
416
            this.RevisonNo = docData.RevisonNo;
417
            this.System = docData.System;
418
            this.SubSystemCode = docData.SubSystemCode;
419
            this.RefProjectCode = docData.RefProjectCode;
420
            this.JobLevel = docData.JobLevel;
421
            this.PersonInCharge = docData.PersonInCharge;
422
            this.ToIsDiscussion = docData.ToIsDiscussion;
423
            this.ToRemarks = docData.ToRemarks;
424
            this.ToCreator = docData.ToCreator;
425
            this.ToCapture += docData.ToCapture;
426
            this.FrReviewStatus = docData.FrReviewStatus;
427
            this.FrRemarks = docData.FrRemarks;
428
            this.FrCapture += docData.FrCapture;
429
            this.FrCreator = docData.FrCreator;
430
            this.ID2StartDate = docData.ID2StartDate;
431
            this.ID2EndDate = docData.ID2EndDate;
432
            this.ID2Status = docData.ID2Status;
433
            this.ID2Issues = docData.ID2Issues;
434
            this.ID2Capture += docData.ID2Capture;
435
            this.ReplyModifications = docData.ReplyModifications;
436
            this.ReplyRequester = docData.ReplyRequester;
437
            this.IsConvert = docData.IsConvert;
438
            this.AVEVAPersonInCharge = docData.AVEVAPersonInCharge;
439
            this.AVEVAWorker = docData.AVEVAWorker;
440
            this.AVEVAConvertDate = docData.AVEVAConvertDate;
441
            this.AVEVAReviewDate = docData.AVEVAReviewDate;
442
            this.AVEVAWorkDate = docData.AVEVAWorkDate;
443
            this.AVEVAStatus = docData.AVEVAStatus;
444
            this.AVEVAIssues = docData.AVEVAIssues;
445
            this.ProdReviewer = docData.ProdReviewer;
446
            this.ProdIsResult = docData.ProdIsResult;
447
            this.ProdRemarks = docData.ProdRemarks;
448
            this.ClientReviewer = docData.ClientReviewer;
449
            this.ClientIsResult = docData.ClientIsResult;
450
            this.ClientRemarks = docData.ClientRemarks;
451
            this.DTIsGateWay = docData.DTIsGateWay;
452
            this.DTIsImport = docData.DTIsImport;
453
            this.DTIsRegSystem = docData.DTIsRegSystem;
454
            this.DTRemarks = docData.DTRemarks;
455
            if (this.AttFiles == null)
456
                this.AttFiles = docData.AttFiles;
457
            else
458
                this.AttFiles.AddRange(docData.AttFiles ?? new List<AttFileInfo>());
459
        }
460
    }
461

    
462
    [DataContract]
463
    public class ID2Drawings
464
    {
465
        //[DataMember]
466
        public string PROJECTNAME { get; set; }
467
        //[DataMember]
468
        public string UID { get; set; }
469
        //[DataMember]
470
        public string NAME { get; set; }
471
        //[DataMember]
472
        public string DOCNAME { get; set; }
473
        //[DataMember]
474
        public DateTime? DATETIME { get; set; }
475
        //[DataMember]
476
        public string OCCUPIED { get; set; }
477
        //[DataMember]
478
        public byte[] Image { get; set; }
479
    }
480

    
481
    public class DocumentsResult
482
    {
483
        public List<Documents> Dwgs { get; set; }
484
        public int TotalCount { get; set; }
485
    }
486
}
클립보드 이미지 추가 (최대 크기: 500 MB)