프로젝트

일반

사용자정보

통계
| 개정판:

hytos / ID2.Manager / ID2.Manager.Data / Models / Documents.cs @ 9598eb6e

이력 | 보기 | 이력해설 | 다운로드 (18.4 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 int Seq { get; set; }
20
        //[DataMember]
21
        public string DocID { get; set; }
22
        //[DataMember]
23
        public string DocumentNo { get; set; }
24
        //[DataMember]
25
        public string RevisonNo { get; set; }
26
        //[DataMember]
27
        public string System { get; set; }
28
        //[DataMember]
29
        public string SubSystemCode { get; set; }
30

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

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

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

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

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

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

    
78
        //[DataMember]
79
        public string ToRemarks { get; set; }
80

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

    
89
        public int ToCapture { get; set; }
90

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

    
99
        //[DataMember]
100
        public string FrRemarks { get; set; }
101

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

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

    
116

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

    
125

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

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

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

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

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

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

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

    
179
        //[DataMember]
180
        public string AVEVAIssues { get; set; }
181

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

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

    
198
        //[DataMember]
199
        public string ProdRemarks { get; set; }
200

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

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

    
217
        //[DataMember]
218
        public string ClientRemarks { get; set; }
219

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

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

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

    
244
        //[DataMember]
245
        public string DTRemarks { get; set; }
246

    
247
        public List<MarkupText> Markups { get; set; }
248

    
249
        public List<AttFileInfo> AttFiles { get; set; }
250

    
251
        public int ConvertStatus { get; set; }
252

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

    
258
        public bool Equals(Documents other)
259
        {
260

    
261
            if (this != null && other == null)
262
                return false;
263

    
264
            if ( this.DocumentNo != other.DocumentNo                  ) return false;
265
            if ( this.RevisonNo != other.RevisonNo                    ) return false;
266
            if ( this.System != other.System                          ) return false;
267
            if ( this.SubSystemCode != other.SubSystemCode            ) return false;
268
            if ( this.RefProjectCode != other.RefProjectCode          ) return false;
269
            if ( this.JobLevel != other.JobLevel                      ) return false;
270
            if ( this.PersonInCharge != other.PersonInCharge          ) return false;
271
            if ( this.Worker != other.Worker                          ) return false;
272
            if ( this.ToIsDiscussion != other.ToIsDiscussion          ) return false;
273
            if ( this.ToRemarks != other.ToRemarks                    ) return false;
274
            if ( this.ToCreator != other.ToCreator                    ) return false;
275

    
276
            if ( this.FrReviewStatus != other.FrReviewStatus          ) return false;
277
            if ( this.FrRemarks != other.FrRemarks                    ) return false;
278
            if ( this.FrCreator != other.FrCreator                    ) return false;
279
            if ( this.ID2StartDate != other.ID2StartDate              ) return false;
280
            if ( this.ID2EndDate != other.ID2EndDate                  ) return false;
281
            if ( this.ID2Status != other.ID2Status                    ) return false;
282
            if ( this.ID2Issues != other.ID2Issues                    ) return false;
283
            if ( this.ReplyModifications != other.ReplyModifications  ) return false;
284
            if ( this.ReplyRequester != other.ReplyRequester          ) return false;
285
            if ( this.IsConvert != other.IsConvert                    ) return false;
286
            if ( this.AVEVAPersonInCharge != other.AVEVAPersonInCharge) return false;
287
            if ( this.AVEVAWorker != other.AVEVAWorker                ) return false;
288
            if ( this.AVEVAConvertDate != other.AVEVAConvertDate      ) return false;
289
            if ( this.AVEVAReviewDate != other.AVEVAReviewDate        ) return false;
290
            if ( this.AVEVAWorkDate != other.AVEVAWorkDate            ) return false;
291
            if ( this.AVEVAStatus != other.AVEVAStatus                ) return false;
292
            if ( this.AVEVAIssues != other.AVEVAIssues                ) return false;
293
            if ( this.ProdReviewer != other.ProdReviewer              ) return false;
294
            if ( this.ProdIsResult != other.ProdIsResult              ) return false;
295
            if ( this.ProdRemarks != other.ProdRemarks                ) return false;
296
            if ( this.ClientReviewer != other.ClientReviewer          ) return false;
297
            if ( this.ClientIsResult != other.ClientIsResult          ) return false;
298
            if ( this.ClientRemarks != other.ClientRemarks            ) return false;
299
            if ( this.DTIsGateWay != other.DTIsGateWay                ) return false;
300
            if ( this.DTIsImport != other.DTIsImport                  ) return false;
301
            if ( this.DTIsRegSystem != other.DTIsRegSystem            ) return false;
302
            if ( this.DTRemarks != other.DTRemarks                    ) return false;
303
            if ( this.ConvertStatus != other.ConvertStatus            ) return false;
304

    
305
            if (this.AttFiles == null && other.AttFiles == null)
306
            {
307
                return true;
308
            }
309
            else if (this.AttFiles != null && other.AttFiles != null)
310
            {
311
                if (!this.AttFiles.SequenceEqual(other.AttFiles))
312
                    return false;
313
            }
314
            else
315
            {
316
                return false;
317
            }
318

    
319
            //bool result =  this.FrReviewStatus == other.FrReviewStatus && this.FrRemarks == other.FrRemarks && this.FrCreator == other.FrCreator
320
            //    && this.ID2StartDate == other.ID2StartDate && this.ID2EndDate == other.ID2EndDate && this.ID2Status == other.ID2Status
321
            //    && this.ID2Issues == other.ID2Issues && this.ReplyModifications == other.ReplyModifications && this.ReplyRequester == other.ReplyRequester && this.IsConvert == other.IsConvert && this.AVEVAPersonInCharge == other.AVEVAPersonInCharge && this.AVEVAWorker == other.AVEVAWorker
322
            //    && this.AVEVAConvertDate == other.AVEVAConvertDate && this.AVEVAReviewDate == other.AVEVAReviewDate && this.AVEVAWorkDate == other.AVEVAWorkDate
323
            //    && this.AVEVAStatus == other.AVEVAStatus && this.AVEVAIssues == other.AVEVAIssues
324
            //    && this.ProdReviewer == other.ProdReviewer && this.ProdIsResult == other.ProdIsResult && this.ProdRemarks == other.ProdRemarks && this.ClientReviewer == other.ClientReviewer
325
            //    && this.ClientIsResult == other.ClientIsResult && this.ClientRemarks == other.ClientRemarks && this.DTIsGateWay == other.DTIsGateWay && this.DTIsImport == other.DTIsImport
326
            //    && this.DTIsRegSystem == other.DTIsRegSystem && this.DTRemarks == other.DTRemarks && this.ConvertStatus == other.ConvertStatus
327
            //    && isAttfilesEqual;
328

    
329
            //if (result == false)
330
            //{
331
            //    string id = this.DocID;
332
            //}
333

    
334
            return true;
335

    
336
        }
337
        public override int GetHashCode()
338
        {
339
            return this.DocumentNo.GetNullableHash() + this.RevisonNo.GetNullableHash() + this.System.GetNullableHash() + this.SubSystemCode.GetNullableHash()
340
                + this.RefProjectCode.GetNullableHash() + this.JobLevel.GetNullableHash()
341
                + this.PersonInCharge.GetNullableHash() + this.Worker.GetNullableHash() + this.ToIsDiscussion.GetNullableHash() + this.ToRemarks.GetNullableHash()
342
                + this.ToCreator.GetNullableHash()
343
                + this.FrReviewStatus.GetNullableHash() + this.FrRemarks.GetNullableHash() + this.FrCreator.GetNullableHash()
344
                + this.ID2StartDate.GetNullableHash() + this.ID2EndDate.GetNullableHash() + this.ID2Status.GetNullableHash()
345
                + this.ID2Issues.GetNullableHash() + this.ReplyModifications.GetNullableHash() + this.ReplyRequester.GetNullableHash() + this.IsConvert.GetNullableHash() + this.AVEVAPersonInCharge.GetNullableHash() + this.AVEVAWorker.GetNullableHash()
346
                + this.AVEVAConvertDate.GetNullableHash() + this.AVEVAReviewDate.GetNullableHash() + this.AVEVAWorkDate.GetNullableHash()
347
                + this.AVEVAStatus.GetNullableHash() + this.AVEVAIssues.GetNullableHash()
348
                + this.ProdReviewer.GetNullableHash() + this.ProdIsResult.GetNullableHash() + this.ProdRemarks.GetNullableHash() + this.ClientReviewer.GetNullableHash()
349
                + this.ClientIsResult.GetNullableHash() + this.ClientRemarks.GetNullableHash() + this.DTIsGateWay.GetNullableHash() + this.DTIsImport.GetNullableHash()
350
                + this.DTIsRegSystem.GetNullableHash() + this.DTRemarks.GetNullableHash() + this.ConvertStatus.GetNullableHash();
351
        }
352

    
353
        public class DocumentsKeyCompare : IEqualityComparer<Documents>
354
        {
355
            public bool Equals(Documents x, Documents y)
356
            {
357
                if (x == null && y == null)
358
                    return true;
359
                else if (x == null || y == null)
360
                    return false;
361
                else
362
                {
363
                    return x.DocID == y.DocID;
364
                }
365
            }
366

    
367
            public int GetHashCode(Documents obj)
368
            {
369
                return (obj.DocID != null ? obj.DocID.GetHashCode() : 0);
370
            }
371
        }
372

    
373
        public class DocumentsUniqueCompare : 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.RefProjectCode == y.RefProjectCode && x.DocumentNo == y.DocumentNo;
384
                }
385
            }
386

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

    
393
        public void DataCopy(Documents docData)
394
        {
395
            this.DocumentNo = docData.DocumentNo;
396
            this.RevisonNo = docData.RevisonNo;
397
            this.System = docData.System;
398
            this.SubSystemCode = docData.SubSystemCode;
399
            this.RefProjectCode = docData.RefProjectCode;
400
            this.JobLevel = docData.JobLevel;
401
            this.PersonInCharge = docData.PersonInCharge;
402
            this.Worker = docData.Worker;
403
            this.ToIsDiscussion = docData.ToIsDiscussion;
404
            this.ToRemarks = docData.ToRemarks;
405
            this.ToCreator = docData.ToCreator;
406
            this.ToCapture += docData.ToCapture;
407
            this.FrReviewStatus = docData.FrReviewStatus;
408
            this.FrRemarks = docData.FrRemarks;
409
            this.FrCapture += docData.FrCapture;
410
            this.FrCreator = docData.FrCreator;
411
            this.ID2StartDate = docData.ID2StartDate;
412
            this.ID2EndDate = docData.ID2EndDate;
413
            this.ID2Status = docData.ID2Status;
414
            this.ID2Issues = docData.ID2Issues;
415
            this.ID2Capture += docData.ID2Capture;
416
            this.ReplyModifications = docData.ReplyModifications;
417
            this.ReplyRequester = docData.ReplyRequester;
418
            this.IsConvert = docData.IsConvert;
419
            this.AVEVAPersonInCharge = docData.AVEVAPersonInCharge;
420
            this.AVEVAWorker = docData.AVEVAWorker;
421
            this.AVEVAConvertDate = docData.AVEVAConvertDate;
422
            this.AVEVAReviewDate = docData.AVEVAReviewDate;
423
            this.AVEVAWorkDate = docData.AVEVAWorkDate;
424
            this.AVEVAStatus = docData.AVEVAStatus;
425
            this.AVEVAIssues = docData.AVEVAIssues;
426
            this.ProdReviewer = docData.ProdReviewer;
427
            this.ProdIsResult = docData.ProdIsResult;
428
            this.ProdRemarks = docData.ProdRemarks;
429
            this.ClientReviewer = docData.ClientReviewer;
430
            this.ClientIsResult = docData.ClientIsResult;
431
            this.ClientRemarks = docData.ClientRemarks;
432
            this.DTIsGateWay = docData.DTIsGateWay;
433
            this.DTIsImport = docData.DTIsImport;
434
            this.DTIsRegSystem = docData.DTIsRegSystem;
435
            this.DTRemarks = docData.DTRemarks;
436
            if (this.AttFiles == null)
437
                this.AttFiles = docData.AttFiles;
438
            else
439
                this.AttFiles.AddRange(docData.AttFiles ?? new List<AttFileInfo>());
440
        }
441
    }
442

    
443
    [DataContract]
444
    public class ID2Drawings
445
    {
446
        //[DataMember]
447
        public string PROJECTNAME { get; set; }
448
        //[DataMember]
449
        public string UID { get; set; }
450
        //[DataMember]
451
        public string NAME { get; set; }
452
        //[DataMember]
453
        public string DOCNAME { get; set; }
454
        //[DataMember]
455
        public DateTime? DATETIME { get; set; }
456
        //[DataMember]
457
        public string OCCUPIED { get; set; }
458
        //[DataMember]
459
        public byte[] Image { get; set; }
460
    }
461

    
462
    public class DocumentsResult
463
    {
464
        public List<Documents> Dwgs { get; set; }
465
        public int TotalCount { get; set; }
466
    }
467
}
클립보드 이미지 추가 (최대 크기: 500 MB)