프로젝트

일반

사용자정보

통계
| 개정판:

hytos / ID2.Manager / ID2.Manager.Data / Models / Documents.cs @ 4d2f9e47

이력 | 보기 | 이력해설 | 다운로드 (15.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 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
            else if (this.AttFiles != null && other.AttFiles != null)
272
            {
273
                isAttfilesEqual = this.AttFiles.SequenceEqual(other.AttFiles);
274
            }
275

    
276
            bool result = other != null && this.DocumentNo == other.DocumentNo && this.RevisonNo == other.RevisonNo && this.System == other.System && this.SubSystemCode == other.SubSystemCode
277
                && this.RefProjectCode == other.RefProjectCode && this.JobLevel == other.JobLevel
278
                && this.PersonInCharge == other.PersonInCharge && this.ToIsDiscussion == other.ToIsDiscussion && this.ToRemarks == other.ToRemarks
279
                && this.ToCreator == other.ToCreator
280
                && this.FrReviewStatus == other.FrReviewStatus && this.FrRemarks == other.FrRemarks && this.FrCreator == other.FrCreator
281
                && this.ID2StartDate == other.ID2StartDate && this.ID2EndDate == other.ID2EndDate && this.ID2Status == other.ID2Status
282
                && this.ID2Issues == other.ID2Issues && this.ReplyModifications == other.ReplyModifications && this.ReplyRequester == other.ReplyRequester && this.IsConvert == other.IsConvert && this.AVEVAPersonInCharge == other.AVEVAPersonInCharge && this.AVEVAWorker == other.AVEVAWorker
283
                && this.AVEVAConvertDate == other.AVEVAConvertDate && this.AVEVAReviewDate == other.AVEVAReviewDate && this.AVEVAWorkDate == other.AVEVAWorkDate
284
                && this.AVEVAStatus == other.AVEVAStatus && this.AVEVAIssues == other.AVEVAIssues
285
                && this.ProdReviewer == other.ProdReviewer && this.ProdIsResult == other.ProdIsResult && this.ProdRemarks == other.ProdRemarks && this.ClientReviewer == other.ClientReviewer
286
                && this.ClientIsResult == other.ClientIsResult && this.ClientRemarks == other.ClientRemarks && this.DTIsGateWay == other.DTIsGateWay && this.DTIsImport == other.DTIsImport
287
                && this.DTIsRegSystem == other.DTIsRegSystem && this.DTRemarks == other.DTRemarks && this.ConvertStatus == other.ConvertStatus
288
                && isAttfilesEqual;
289

    
290
            if (result == false)
291
            {
292
                string id = this.DocID;
293
            }
294

    
295
            return result;
296

    
297
        }
298
        public override int GetHashCode()
299
        {
300
            return this.DocumentNo.GetNullableHash() + this.RevisonNo.GetNullableHash() + this.System.GetNullableHash() + this.SubSystemCode.GetNullableHash()
301
                + this.RefProjectCode.GetNullableHash() + this.JobLevel.GetNullableHash()
302
                + this.PersonInCharge.GetNullableHash() + this.ToIsDiscussion.GetNullableHash() + this.ToRemarks.GetNullableHash()
303
                + this.ToCreator.GetNullableHash()
304
                + this.FrReviewStatus.GetNullableHash() + this.FrRemarks.GetNullableHash() + this.FrCreator.GetNullableHash()
305
                + this.ID2StartDate.GetNullableHash() + this.ID2EndDate.GetNullableHash() + this.ID2Status.GetNullableHash()
306
                + this.ID2Issues.GetNullableHash() + this.ReplyModifications.GetNullableHash() + this.ReplyRequester.GetNullableHash() + this.IsConvert.GetNullableHash() + this.AVEVAPersonInCharge.GetNullableHash() + this.AVEVAWorker.GetNullableHash()
307
                + this.AVEVAConvertDate.GetNullableHash() + this.AVEVAReviewDate.GetNullableHash() + this.AVEVAWorkDate.GetNullableHash()
308
                + this.AVEVAStatus.GetNullableHash() + this.AVEVAIssues.GetNullableHash()
309
                + this.ProdReviewer.GetNullableHash() + this.ProdIsResult.GetNullableHash() + this.ProdRemarks.GetNullableHash() + this.ClientReviewer.GetNullableHash()
310
                + this.ClientIsResult.GetNullableHash() + this.ClientRemarks.GetNullableHash() + this.DTIsGateWay.GetNullableHash() + this.DTIsImport.GetNullableHash()
311
                + this.DTIsRegSystem.GetNullableHash() + this.DTRemarks.GetNullableHash() + this.ConvertStatus.GetNullableHash();
312
        }
313

    
314
        public class DocumentsKeyCompare : IEqualityComparer<Documents>
315
        {
316
            public bool Equals(Documents x, Documents y)
317
            {
318
                if (x == null && y == null)
319
                    return true;
320
                else if (x == null || y == null)
321
                    return false;
322
                else
323
                {
324
                    return x.DocID == y.DocID;
325
                }
326
            }
327

    
328
            public int GetHashCode(Documents obj)
329
            {
330
                return (obj.DocID != null ? obj.DocID.GetHashCode() : 0);
331
            }
332
        }
333

    
334
        public class DocumentsUniqueCompare : IEqualityComparer<Documents>
335
        {
336
            public bool Equals(Documents x, Documents y)
337
            {
338
                if (x == null && y == null)
339
                    return true;
340
                else if (x == null || y == null)
341
                    return false;
342
                else
343
                {
344
                    return x.RefProjectCode == y.RefProjectCode && x.DocumentNo == y.DocumentNo;
345
                }
346
            }
347

    
348
            public int GetHashCode(Documents obj)
349
            {
350
                return (obj.RefProjectCode != null ? obj.RefProjectCode.GetHashCode() : 0) + (obj.DocumentNo != null ? obj.DocumentNo.GetHashCode() : 0);
351
            }
352
        }
353

    
354
        public void DataCopy(Documents docData)
355
        {
356
            this.DocumentNo = docData.DocumentNo;
357
            this.RevisonNo = docData.RevisonNo;
358
            this.System = docData.System;
359
            this.SubSystemCode = docData.SubSystemCode;
360
            this.RefProjectCode = docData.RefProjectCode;
361
            this.JobLevel = docData.JobLevel;
362
            this.PersonInCharge = docData.PersonInCharge;
363
            this.ToIsDiscussion = docData.ToIsDiscussion;
364
            this.ToRemarks = docData.ToRemarks;
365
            this.ToCreator = docData.ToCreator;
366
            this.ToCapture += docData.ToCapture;
367
            this.FrReviewStatus = docData.FrReviewStatus;
368
            this.FrRemarks = docData.FrRemarks;
369
            this.FrCapture += docData.FrCapture;
370
            this.FrCreator = docData.FrCreator;
371
            this.ID2StartDate = docData.ID2StartDate;
372
            this.ID2EndDate = docData.ID2EndDate;
373
            this.ID2Status = docData.ID2Status;
374
            this.ID2Issues = docData.ID2Issues;
375
            this.ID2Capture += docData.ID2Capture;
376
            this.ReplyModifications = docData.ReplyModifications;
377
            this.ReplyRequester = docData.ReplyRequester;
378
            this.IsConvert = docData.IsConvert;
379
            this.AVEVAPersonInCharge = docData.AVEVAPersonInCharge;
380
            this.AVEVAWorker = docData.AVEVAWorker;
381
            this.AVEVAConvertDate = docData.AVEVAConvertDate;
382
            this.AVEVAReviewDate = docData.AVEVAReviewDate;
383
            this.AVEVAWorkDate = docData.AVEVAWorkDate;
384
            this.AVEVAStatus = docData.AVEVAStatus;
385
            this.AVEVAIssues = docData.AVEVAIssues;
386
            this.ProdReviewer = docData.ProdReviewer;
387
            this.ProdIsResult = docData.ProdIsResult;
388
            this.ProdRemarks = docData.ProdRemarks;
389
            this.ClientReviewer = docData.ClientReviewer;
390
            this.ClientIsResult = docData.ClientIsResult;
391
            this.ClientRemarks = docData.ClientRemarks;
392
            this.DTIsGateWay = docData.DTIsGateWay;
393
            this.DTIsImport = docData.DTIsImport;
394
            this.DTIsRegSystem = docData.DTIsRegSystem;
395
            this.DTRemarks = docData.DTRemarks;
396
            if (this.AttFiles == null)
397
                this.AttFiles = docData.AttFiles;
398
            else
399
                this.AttFiles.AddRange(docData.AttFiles ?? new List<AttFileInfo>());
400
        }
401
    }
402

    
403
    [DataContract]
404
    public class ID2Drawings
405
    {
406
        [DataMember]
407
        public string PROJECTNAME { get; set; }
408
        [DataMember]
409
        public string UID { get; set; }
410
        [DataMember]
411
        public string NAME { get; set; }
412
        [DataMember]
413
        public string DOCNAME { get; set; }
414
        [DataMember]
415
        public DateTime? DATETIME { get; set; }
416
        [DataMember]
417
        public string OCCUPIED { get; set; }
418
        [DataMember]
419
        public byte[] Image { get; set; }
420
    }
421

    
422
    public class DocumentsResult
423
    {
424
        public List<Documents> Dwgs { get; set; }
425
        public int TotalCount { get; set; }
426
    }
427
}
클립보드 이미지 추가 (최대 크기: 500 MB)