프로젝트

일반

사용자정보

통계
| 개정판:

hytos / ID2.Manager / ID2.Manager.Data / Models / Documents.cs @ 70ed289d

이력 | 보기 | 이력해설 | 다운로드 (11.9 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 RefProjectCode { get; set; }
37
        [DataMember]
38
        public bool IsLatest { get; set; }
39
        [DataMember]
40
        public string AutoCADFilie { get; set; }
41
        [DataMember]
42
        public string PDFFile { get; set; }
43
        [DataMember]
44
        public string MarkupLink { get; set; }
45
        [DataMember]
46
        public string AVEVALink { get; set; }
47
        [DataMember]
48
        public string DocFilePath { get; set; }
49
        [DataMember]
50
        public string DocFileName { get; set; }
51
        [DataMember]
52
        public string JobLevel { get; set; }
53
        [DataMember]
54
        public string IsTypical { get; set; }
55
        [DataMember]
56
        public string PersonInCharge { get; set; }
57
        private string _Worker = string.Empty;
58
        [DataMember]
59
        public string Worker
60
        {
61
            get
62
            {
63
                return _Worker;
64
            }
65
            set
66
            {
67
                if (this._Worker != value)
68
                {
69
                    this._Worker = value;
70
                    OnPropertyChanged("Worker");
71
                }
72
            }
73
        }
74
        [DataMember]
75
        public bool IsDeleted { get; set; }
76
        [DataMember]
77
        public DateTime RegisteredDate { get; set; }
78
        [DataMember]
79
        public DateTime? ModifiedDate { get; set; }
80
        [DataMember]
81
        public DateTime? DeletedDate { get; set; }
82
        [DataMember]
83
        public string RegisteredUser { get; set; }
84
        [DataMember]
85
        public string ModifiedUser { get; set; }
86
        [DataMember]
87
        public string DeletedUser { get; set; }
88
        [DataMember]
89
        public string ToIsDiscussion { get; set; }
90
        [DataMember]
91
        public string ToRemarks { get; set; }
92
        [DataMember]
93
        public string ToCreator { get; set; }
94
        public int ToCapture { get; set; }
95
        [DataMember]
96
        public string ToIsMarkup { get; set; }
97
        [DataMember]
98
        public string FrReviewStatus { get; set; }
99
        [DataMember]
100
        public string FrRemarks { get; set; }
101
        [DataMember]
102
        public string FrCreator { get; set; }
103
        public int FrCapture { get; set; }
104
        [DataMember]
105
        public string FrIsMarkup { get; set; }
106
        [DataMember]
107
        public string IsID2Work { get; set; }
108
        [DataMember]
109
        public string ID2Connection { get; set; }
110
        [DataMember]
111
        public DateTime? ID2StartDate { get; set; }
112
        [DataMember]
113
        public DateTime? ID2EndDate { get; set; }
114
        [DataMember]
115
        public int ID2JobTime { get; set; }
116
        public string ID2JobTimetoString
117
        {
118
            get
119
            {
120
                StringBuilder sbTemp;
121
                if (ID2JobTime > 0)
122
                {
123
                    sbTemp = new StringBuilder(TimeSpan.FromSeconds(Convert.ToInt32(ID2JobTime)).ToString(@"dd\:hh\:mm\:ss"));
124
                }
125
                else if (ID2JobTime < 0)
126
                {
127
                    sbTemp = new StringBuilder(TimeSpan.FromSeconds(Convert.ToInt32(ID2JobTime)).ToString(@"dd\:hh\:mm\:ss"));
128
                    sbTemp.Insert(0, "-");
129
                }
130
                else
131
                {
132
                    sbTemp = new StringBuilder();
133
                }
134

    
135
                return sbTemp.ToString();
136
            }
137
        }
138
        [DataMember]
139
        public string ID2Status { get; set; }
140
        [DataMember]
141
        public string ID2Issues { get; set; }
142
        [DataMember]
143
        public string AVEVAConnection { get; set; }
144
        [DataMember]
145
        public DateTime? AVEVAConvertDate { get; set; }
146
        [DataMember]
147
        public DateTime? AVEVAReviewDate { get; set; }
148
        [DataMember]
149
        public string AVEVAStatus { get; set; }
150
        [DataMember]
151
        public string AVEVAIssues { get; set; }
152
        [DataMember]
153
        public string ReviewFilePath { get; set; }
154
        [DataMember]
155
        public string ReviewFileName { get; set; }
156
        [DataMember]
157
        public string ProdReviewer { get; set; }
158
        [DataMember]
159
        public string ProdIsResult { get; set; }
160
        [DataMember]
161
        public string ProdRemarks { get; set; }
162
        public int ProdCapture { get; set; }
163
        [DataMember]
164
        public string ClientReviewer { get; set; }
165
        [DataMember]
166
        public string ClientIsResult { get; set; }
167
        [DataMember]
168
        public string ClientRemarks { get; set; }
169
        public int ClientCapture { get; set; }
170
        [DataMember]
171
        public string DTIsGateWay { get; set; }
172
        [DataMember]
173
        public string DTIsImport { get; set; }
174
        [DataMember]
175
        public string DTIsRegSystem { get; set; }
176
        [DataMember]
177
        public string DTRemarks { get; set; }
178

    
179
        public List<MarkupText> Markups { get; set; }
180

    
181
        public List<AttFileInfo> AttFiles { get; set; }
182

    
183

    
184
        public override bool Equals(object obj)
185
        {
186
            return Equals(obj as Documents);
187
        }
188

    
189
        public bool Equals(Documents other)
190
        {
191
            bool isAttfilesEqual = false;
192

    
193
            if (this != null && other == null)
194
                return false;
195

    
196
            if (this.AttFiles == null && other.AttFiles == null)
197
            {
198
                isAttfilesEqual = true;
199
            }
200
            else if (this.AttFiles != null && other.AttFiles != null)
201
            {
202
                isAttfilesEqual = this.AttFiles.SequenceEqual(other.AttFiles);
203
            }
204

    
205
            bool result = other != null && this.DocumentNo == other.DocumentNo && this.RevisonNo == other.RevisonNo && this.RefProjectCode == other.RefProjectCode && this.IsLatest == other.IsLatest
206
                && this.AutoCADFilie == other.AutoCADFilie && this.PDFFile == other.PDFFile && this.MarkupLink == other.MarkupLink && this.AVEVALink == other.AVEVALink
207
                && this.DocFilePath == other.DocFilePath && this.DocFileName == other.DocFileName && this.JobLevel == other.JobLevel && this.IsTypical == other.IsTypical
208
                && this.PersonInCharge == other.PersonInCharge && this.IsDeleted == other.IsDeleted && this.ToIsDiscussion == other.ToIsDiscussion && this.ToRemarks == other.ToRemarks
209
                && this.ToCreator == other.ToCreator && this.ToCapture == other.ToCapture && this.ToIsMarkup == other.ToIsMarkup
210
                && this.FrReviewStatus == other.FrReviewStatus && this.FrRemarks == other.FrRemarks && this.FrCreator == other.FrCreator
211
                && this.FrCapture == other.FrCapture && this.FrIsMarkup == other.FrIsMarkup && this.IsID2Work == other.IsID2Work && this.ID2Connection == other.ID2Connection
212
                && this.ID2StartDate == other.ID2StartDate && this.ID2EndDate == other.ID2EndDate && this.ID2JobTime == other.ID2JobTime && this.ID2Status == other.ID2Status
213
                && this.ID2Issues == other.ID2Issues && this.AVEVAConnection == other.AVEVAConnection && this.AVEVAConvertDate == other.AVEVAConvertDate && this.AVEVAReviewDate == other.AVEVAReviewDate
214
                && this.AVEVAStatus == other.AVEVAStatus && this.AVEVAIssues == other.AVEVAIssues && this.ReviewFilePath == other.ReviewFilePath && this.ReviewFileName == other.ReviewFileName
215
                && this.ProdReviewer == other.ProdReviewer && this.ProdIsResult == other.ProdIsResult && this.ProdRemarks == other.ProdRemarks && this.ClientReviewer == other.ClientReviewer
216
                && this.ClientIsResult == other.ClientIsResult && this.ClientRemarks == other.ClientRemarks && this.DTIsGateWay == other.DTIsGateWay && this.DTIsImport == other.DTIsImport
217
                && this.DTIsRegSystem == other.DTIsRegSystem && this.DTRemarks == other.DTRemarks
218
                && isAttfilesEqual;
219

    
220
            if (result == false)
221
            {
222
                string id = this.DocID;
223
            }
224

    
225
            return result;
226

    
227
        }
228
        public override int GetHashCode()
229
        {
230
            return this.DocumentNo.GetNullableHash() + this.RevisonNo.GetNullableHash() + this.RefProjectCode.GetNullableHash() + this.IsLatest.GetNullableHash()
231
                + this.AutoCADFilie.GetNullableHash() + this.PDFFile.GetNullableHash() + this.MarkupLink.GetNullableHash() + this.AVEVALink.GetNullableHash()
232
                + this.DocFilePath.GetNullableHash() + this.DocFileName.GetNullableHash() + this.JobLevel.GetNullableHash() + this.IsTypical.GetNullableHash()
233
                + this.PersonInCharge.GetNullableHash() + this.IsDeleted.GetNullableHash() + this.ToIsDiscussion.GetNullableHash() + this.ToRemarks.GetNullableHash()
234
                + this.ToCreator.GetNullableHash() + this.ToCapture.GetNullableHash() + this.ToIsMarkup.GetNullableHash()
235
                + this.FrReviewStatus.GetNullableHash() + this.FrRemarks.GetNullableHash() + this.FrCreator.GetNullableHash()
236
                + this.FrCapture.GetNullableHash() + this.FrIsMarkup.GetNullableHash() + this.IsID2Work.GetNullableHash() + this.ID2Connection.GetNullableHash()
237
                + this.ID2StartDate.GetNullableHash() + this.ID2EndDate.GetNullableHash() + this.ID2JobTime.GetNullableHash() + this.ID2Status.GetNullableHash()
238
                + this.ID2Issues.GetNullableHash() + this.AVEVAConnection.GetNullableHash() + this.AVEVAConvertDate.GetNullableHash() + this.AVEVAReviewDate.GetNullableHash()
239
                + this.AVEVAStatus.GetNullableHash() + this.AVEVAIssues.GetNullableHash() + this.ReviewFilePath.GetNullableHash() + this.ReviewFileName.GetNullableHash()
240
                + this.ProdReviewer.GetNullableHash() + this.ProdIsResult.GetNullableHash() + this.ProdRemarks.GetNullableHash() + this.ClientReviewer.GetNullableHash()
241
                + this.ClientIsResult.GetNullableHash() + this.ClientRemarks.GetNullableHash() + this.DTIsGateWay.GetNullableHash() + this.DTIsImport.GetNullableHash()
242
                + this.DTIsRegSystem.GetNullableHash() + this.DTRemarks.GetNullableHash();
243
        }
244

    
245
        public class DocumentsKeyComparer : IEqualityComparer<Documents>
246
        {
247
            public bool Equals(Documents x, Documents y)
248
            {
249
                if (x == null && y == null)
250
                    return true;
251
                else if (x == null || y == null)
252
                    return false;
253
                else
254
                {
255
                    return x.DocID == y.DocID;
256
                }
257
            }
258

    
259
            public int GetHashCode(Documents obj)
260
            {
261
                return (obj.DocID != null ? obj.DocID.GetHashCode() : 0);
262
            }
263
        }
264
    }
265

    
266
    [DataContract]
267
    public class ID2Drawings
268
    {
269
        [DataMember]
270
        public string PROJECTNAME { get; set; }
271
        [DataMember]
272
        public string UID { get; set; }
273
        [DataMember]
274
        public string NAME { get; set; }
275
        [DataMember]
276
        public string DOCNAME { get; set; }
277
        [DataMember]
278
        public DateTime? DATETIME { get; set; }
279
        [DataMember]
280
        public string OCCUPIED { get; set; }
281
        [DataMember]
282
        public byte[] Image { get; set; }
283
    }
284

    
285
    public class DocumentsResult
286
    {
287
        public List<Documents> Dwgs { get; set; }
288
        public int TotalCount { get; set; }
289
    }
290
}
클립보드 이미지 추가 (최대 크기: 500 MB)