프로젝트

일반

사용자정보

통계
| 개정판:

hytos / ID2.Manager / ID2.Manager.Data / Models / Documents.cs @ f074a104

이력 | 보기 | 이력해설 | 다운로드 (12.7 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 : IEquatable<Documents>, INotifyPropertyChanged
17
    {
18
        public event PropertyChangedEventHandler PropertyChanged;
19
        protected void OnPropertyChanged(string propName)
20
        {
21
            if (PropertyChanged != null)
22
            {
23
                PropertyChanged(this, new PropertyChangedEventArgs(propName));
24
            }
25
        }
26

    
27
        [DataMember]
28
        public int Seq { get; set; }
29
        [DataMember]
30
        public string DocID { get; set; }
31
        [DataMember]
32
        public string DocumentNo { get; set; }
33
        [DataMember]
34
        public string RevisonNo { get; set; }
35
        [DataMember]
36
        public string System { get; set; }
37
        [DataMember]
38
        public string SubSystemCode { get; set; }
39
        [DataMember]
40
        public string RefProjectCode { get; set; }
41
        [DataMember]
42
        public string JobLevel { get; set; }
43
        [DataMember]
44
        public string PersonInCharge { get; set; }
45
        private string _Worker = string.Empty;
46
        [DataMember]
47
        public string Worker
48
        {
49
            get
50
            {
51
                return _Worker;
52
            }
53
            set
54
            {
55
                if (this._Worker != value)
56
                {
57
                    this._Worker = value;
58
                    OnPropertyChanged("Worker");
59
                }
60
            }
61
        }
62
        [DataMember]
63
        public string RegisteredUser { get; set; }
64
        [DataMember]
65
        public string ModifiedUser { get; set; }
66
        [DataMember]
67
        public string DeletedUser { get; set; }
68
        [DataMember]
69
        public string ToIsDiscussion { get; set; }
70
        [DataMember]
71
        public string ToRemarks { get; set; }
72
        [DataMember]
73
        public string ToCreator { get; set; }
74
        public int ToCapture { get; set; }
75
        [DataMember]
76
        public string FrReviewStatus { get; set; }
77
        [DataMember]
78
        public string FrRemarks { get; set; }
79
        [DataMember]
80
        public string FrCreator { get; set; }
81
        public int FrCapture { get; set; }
82
        [DataMember]
83
        public DateTime? ID2StartDate { get; set; }
84
        [DataMember]
85
        public DateTime? ID2EndDate { get; set; }
86
        [DataMember]
87
        public string ID2Status { get; set; }
88
        [DataMember]
89
        public string ID2Issues { get; set; }
90
        public int ID2Capture { get; set; }
91
        [DataMember]
92
        public string ReplyModifications { get; set; }
93
        [DataMember]
94
        public string ReplyRequester { get; set; }
95
        [DataMember]
96
        public string IsConvert { get; set; }
97
        [DataMember]
98
        public string AVEVAPersonInCharge { get; set; }
99
        [DataMember]
100
        public string AVEVAWorker { get; set; }
101
        [DataMember]
102
        public DateTime? AVEVAConvertDate { get; set; }
103
        [DataMember]
104
        public DateTime? AVEVAReviewDate { get; set; }
105
        [DataMember]
106
        public DateTime? AVEVAWorkDate { get; set; }
107
        [DataMember]
108
        public string AVEVAStatus { get; set; }
109
        [DataMember]
110
        public string AVEVAIssues { get; set; }
111
        [DataMember]
112
        public string ProdReviewer { get; set; }
113
        [DataMember]
114
        public string ProdIsResult { get; set; }
115
        [DataMember]
116
        public string ProdRemarks { get; set; }
117
        //public int ProdCapture { get; set; }
118
        [DataMember]
119
        public string ClientReviewer { get; set; }
120
        [DataMember]
121
        public string ClientIsResult { get; set; }
122
        [DataMember]
123
        public string ClientRemarks { get; set; }
124
        //public int ClientCapture { get; set; }
125
        [DataMember]
126
        public string DTIsGateWay { get; set; }
127
        [DataMember]
128
        public string DTIsImport { get; set; }
129
        [DataMember]
130
        public string DTIsRegSystem { get; set; }
131
        [DataMember]
132
        public string DTRemarks { get; set; }
133

    
134
        public List<MarkupText> Markups { get; set; }
135

    
136
        public List<AttFileInfo> AttFiles { get; set; }
137

    
138
        public int ConvertStatus { get; set; }
139

    
140
        public override bool Equals(object obj)
141
        {
142
            return Equals(obj as Documents);
143
        }
144

    
145
        public bool Equals(Documents other)
146
        {
147
            bool isAttfilesEqual = false;
148

    
149
            if (this != null && other == null)
150
                return false;
151

    
152
            if (this.AttFiles == null && other.AttFiles == null)
153
            {
154
                isAttfilesEqual = true;
155
            }
156
            else if (this.AttFiles != null && other.AttFiles != null)
157
            {
158
                isAttfilesEqual = this.AttFiles.SequenceEqual(other.AttFiles);
159
            }
160

    
161
            bool result = other != null && this.DocumentNo == other.DocumentNo && this.RevisonNo == other.RevisonNo && this.System == other.System && this.SubSystemCode == other.SubSystemCode
162
                && this.RefProjectCode == other.RefProjectCode && this.JobLevel == other.JobLevel
163
                && this.PersonInCharge == other.PersonInCharge && this.ToIsDiscussion == other.ToIsDiscussion && this.ToRemarks == other.ToRemarks
164
                && this.ToCreator == other.ToCreator
165
                && this.FrReviewStatus == other.FrReviewStatus && this.FrRemarks == other.FrRemarks && this.FrCreator == other.FrCreator
166
                && this.ID2StartDate == other.ID2StartDate && this.ID2EndDate == other.ID2EndDate && this.ID2Status == other.ID2Status
167
                && this.ID2Issues == other.ID2Issues && this.ReplyModifications == other.ReplyModifications && this.ReplyRequester == other.ReplyRequester && this.IsConvert == other.IsConvert && this.AVEVAPersonInCharge == other.AVEVAPersonInCharge && this.AVEVAWorker == other.AVEVAWorker
168
                && this.AVEVAConvertDate == other.AVEVAConvertDate && this.AVEVAReviewDate == other.AVEVAReviewDate && this.AVEVAWorkDate == other.AVEVAWorkDate
169
                && this.AVEVAStatus == other.AVEVAStatus && this.AVEVAIssues == other.AVEVAIssues
170
                && this.ProdReviewer == other.ProdReviewer && this.ProdIsResult == other.ProdIsResult && this.ProdRemarks == other.ProdRemarks && this.ClientReviewer == other.ClientReviewer
171
                && this.ClientIsResult == other.ClientIsResult && this.ClientRemarks == other.ClientRemarks && this.DTIsGateWay == other.DTIsGateWay && this.DTIsImport == other.DTIsImport
172
                && this.DTIsRegSystem == other.DTIsRegSystem && this.DTRemarks == other.DTRemarks && this.ConvertStatus == other.ConvertStatus
173
                && isAttfilesEqual;
174

    
175
            if (result == false)
176
            {
177
                string id = this.DocID;
178
            }
179

    
180
            return result;
181

    
182
        }
183
        public override int GetHashCode()
184
        {
185
            return this.DocumentNo.GetNullableHash() + this.RevisonNo.GetNullableHash() + this.System.GetNullableHash() + this.SubSystemCode.GetNullableHash()
186
                + this.RefProjectCode.GetNullableHash() + this.JobLevel.GetNullableHash()
187
                + this.PersonInCharge.GetNullableHash() + this.ToIsDiscussion.GetNullableHash() + this.ToRemarks.GetNullableHash()
188
                + this.ToCreator.GetNullableHash()
189
                + this.FrReviewStatus.GetNullableHash() + this.FrRemarks.GetNullableHash() + this.FrCreator.GetNullableHash()
190
                + this.ID2StartDate.GetNullableHash() + this.ID2EndDate.GetNullableHash() + this.ID2Status.GetNullableHash()
191
                + this.ID2Issues.GetNullableHash() + this.ReplyModifications.GetNullableHash() + this.ReplyRequester.GetNullableHash() + this.IsConvert.GetNullableHash() + this.AVEVAPersonInCharge.GetNullableHash() + this.AVEVAWorker.GetNullableHash()
192
                + this.AVEVAConvertDate.GetNullableHash() + this.AVEVAReviewDate.GetNullableHash() + this.AVEVAWorkDate.GetNullableHash()
193
                + this.AVEVAStatus.GetNullableHash() + this.AVEVAIssues.GetNullableHash()
194
                + this.ProdReviewer.GetNullableHash() + this.ProdIsResult.GetNullableHash() + this.ProdRemarks.GetNullableHash() + this.ClientReviewer.GetNullableHash()
195
                + this.ClientIsResult.GetNullableHash() + this.ClientRemarks.GetNullableHash() + this.DTIsGateWay.GetNullableHash() + this.DTIsImport.GetNullableHash()
196
                + this.DTIsRegSystem.GetNullableHash() + this.DTRemarks.GetNullableHash() + this.ConvertStatus.GetNullableHash();
197
        }
198

    
199
        public class DocumentsKeyCompare : IEqualityComparer<Documents>
200
        {
201
            public bool Equals(Documents x, Documents y)
202
            {
203
                if (x == null && y == null)
204
                    return true;
205
                else if (x == null || y == null)
206
                    return false;
207
                else
208
                {
209
                    return x.DocID == y.DocID;
210
                }
211
            }
212

    
213
            public int GetHashCode(Documents obj)
214
            {
215
                return (obj.DocID != null ? obj.DocID.GetHashCode() : 0);
216
            }
217
        }
218

    
219
        public class DocumentsUniqueCompare : IEqualityComparer<Documents>
220
        {
221
            public bool Equals(Documents x, Documents y)
222
            {
223
                if (x == null && y == null)
224
                    return true;
225
                else if (x == null || y == null)
226
                    return false;
227
                else
228
                {
229
                    return x.RefProjectCode == y.RefProjectCode && x.DocumentNo == y.DocumentNo;
230
                }
231
            }
232

    
233
            public int GetHashCode(Documents obj)
234
            {
235
                return (obj.RefProjectCode != null ? obj.RefProjectCode.GetHashCode() : 0) + (obj.DocumentNo != null ? obj.DocumentNo.GetHashCode() : 0);
236
            }
237
        }
238

    
239
        public void ValueCopy(Documents other)
240
        {
241
            this.DocumentNo = other.DocumentNo;
242
            this.RevisonNo = other.RevisonNo;
243
            this.System = other.System;
244
            this.SubSystemCode = other.SubSystemCode;
245
            this.RefProjectCode = other.RefProjectCode;
246
            this.JobLevel = other.JobLevel;
247
            this.PersonInCharge = other.PersonInCharge;
248
            this.ToIsDiscussion = other.ToIsDiscussion;
249
            this.ToRemarks = other.ToRemarks;
250
            this.ToCreator = other.ToCreator;
251
            this.ToCapture += other.ToCapture;
252
            this.FrReviewStatus = other.FrReviewStatus;
253
            this.FrRemarks = other.FrRemarks;
254
            this.FrCapture += other.FrCapture;
255
            this.FrCreator = other.FrCreator;
256
            this.ID2StartDate = other.ID2StartDate;
257
            this.ID2EndDate = other.ID2EndDate;
258
            this.ID2Status = other.ID2Status;
259
            this.ID2Issues = other.ID2Issues;
260
            this.ID2Capture += other.ID2Capture;
261
            this.ReplyModifications = other.ReplyModifications;
262
            this.ReplyRequester = other.ReplyRequester;
263
            this.IsConvert = other.IsConvert;
264
            this.AVEVAPersonInCharge = other.AVEVAPersonInCharge;
265
            this.AVEVAWorker = other.AVEVAWorker;
266
            this.AVEVAConvertDate = other.AVEVAConvertDate;
267
            this.AVEVAReviewDate = other.AVEVAReviewDate;
268
            this.AVEVAWorkDate = other.AVEVAWorkDate;
269
            this.AVEVAStatus = other.AVEVAStatus;
270
            this.AVEVAIssues = other.AVEVAIssues;
271
            this.ProdReviewer = other.ProdReviewer;
272
            this.ProdIsResult = other.ProdIsResult;
273
            this.ProdRemarks = other.ProdRemarks;
274
            this.ClientReviewer = other.ClientReviewer;
275
            this.ClientIsResult = other.ClientIsResult;
276
            this.ClientRemarks = other.ClientRemarks;
277
            this.DTIsGateWay = other.DTIsGateWay;
278
            this.DTIsImport = other.DTIsImport;
279
            this.DTIsRegSystem = other.DTIsRegSystem;
280
            this.DTRemarks = other.DTRemarks;
281
            if (this.AttFiles == null)
282
                this.AttFiles = other.AttFiles;
283
            else
284
                this.AttFiles.AddRange(other.AttFiles ?? new List<AttFileInfo>());
285
        }
286
    }
287

    
288
    [DataContract]
289
    public class ID2Drawings
290
    {
291
        [DataMember]
292
        public string PROJECTNAME { get; set; }
293
        [DataMember]
294
        public string UID { get; set; }
295
        [DataMember]
296
        public string NAME { get; set; }
297
        [DataMember]
298
        public string DOCNAME { get; set; }
299
        [DataMember]
300
        public DateTime? DATETIME { get; set; }
301
        [DataMember]
302
        public string OCCUPIED { get; set; }
303
        [DataMember]
304
        public byte[] Image { get; set; }
305
    }
306

    
307
    public class DocumentsResult
308
    {
309
        public List<Documents> Dwgs { get; set; }
310
        public int TotalCount { get; set; }
311
    }
312
}
클립보드 이미지 추가 (최대 크기: 500 MB)