hytos / ID2.Manager / ID2.Manager.Data / Models / Documents.cs @ 4a7e4492
이력 | 보기 | 이력해설 | 다운로드 (11.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 : 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 JobLevel { get; set; } |
49 |
[DataMember] |
50 |
public string IsTypical { get; set; } |
51 |
[DataMember] |
52 |
public string PersonInCharge { get; set; } |
53 |
private string _Worker = string.Empty; |
54 |
[DataMember] |
55 |
public string Worker |
56 |
{ |
57 |
get |
58 |
{ |
59 |
return _Worker; |
60 |
} |
61 |
set |
62 |
{ |
63 |
if (this._Worker != value) |
64 |
{ |
65 |
this._Worker = value; |
66 |
OnPropertyChanged("Worker"); |
67 |
} |
68 |
} |
69 |
} |
70 |
[DataMember] |
71 |
public bool IsDeleted { get; set; } |
72 |
[DataMember] |
73 |
public DateTime RegisteredDate { get; set; } |
74 |
[DataMember] |
75 |
public DateTime? ModifiedDate { get; set; } |
76 |
[DataMember] |
77 |
public DateTime? DeletedDate { get; set; } |
78 |
[DataMember] |
79 |
public string RegisteredUser { get; set; } |
80 |
[DataMember] |
81 |
public string ModifiedUser { get; set; } |
82 |
[DataMember] |
83 |
public string DeletedUser { get; set; } |
84 |
[DataMember] |
85 |
public string ToIsDiscussion { get; set; } |
86 |
[DataMember] |
87 |
public string ToRemarks { get; set; } |
88 |
[DataMember] |
89 |
public string ToCreator { get; set; } |
90 |
public int ToCapture { get; set; } |
91 |
[DataMember] |
92 |
public string ToIsMarkup { get; set; } |
93 |
[DataMember] |
94 |
public string FrReviewStatus { get; set; } |
95 |
[DataMember] |
96 |
public string FrRemarks { get; set; } |
97 |
[DataMember] |
98 |
public string FrCreator { get; set; } |
99 |
public int FrCapture { get; set; } |
100 |
[DataMember] |
101 |
public string FrIsMarkup { get; set; } |
102 |
[DataMember] |
103 |
public string IsID2Work { get; set; } |
104 |
[DataMember] |
105 |
public string ID2Connection { get; set; } |
106 |
[DataMember] |
107 |
public DateTime? ID2StartDate { get; set; } |
108 |
[DataMember] |
109 |
public DateTime? ID2EndDate { get; set; } |
110 |
[DataMember] |
111 |
public int ID2JobTime { get; set; } |
112 |
public string ID2JobTimetoString |
113 |
{ |
114 |
get |
115 |
{ |
116 |
StringBuilder sbTemp; |
117 |
if (ID2JobTime > 0) |
118 |
{ |
119 |
sbTemp = new StringBuilder(TimeSpan.FromSeconds(Convert.ToInt32(ID2JobTime)).ToString(@"dd\:hh\:mm\:ss")); |
120 |
} |
121 |
else if (ID2JobTime < 0) |
122 |
{ |
123 |
sbTemp = new StringBuilder(TimeSpan.FromSeconds(Convert.ToInt32(ID2JobTime)).ToString(@"dd\:hh\:mm\:ss")); |
124 |
sbTemp.Insert(0, "-"); |
125 |
} |
126 |
else |
127 |
{ |
128 |
sbTemp = new StringBuilder(); |
129 |
} |
130 |
|
131 |
return sbTemp.ToString(); |
132 |
} |
133 |
} |
134 |
[DataMember] |
135 |
public string ID2Status { get; set; } |
136 |
[DataMember] |
137 |
public string ID2Issues { get; set; } |
138 |
[DataMember] |
139 |
public string AVEVAConnection { get; set; } |
140 |
[DataMember] |
141 |
public DateTime? AVEVAConvertDate { get; set; } |
142 |
[DataMember] |
143 |
public DateTime? AVEVAReviewDate { get; set; } |
144 |
[DataMember] |
145 |
public string AVEVAStatus { get; set; } |
146 |
[DataMember] |
147 |
public string AVEVAIssues { get; set; } |
148 |
[DataMember] |
149 |
public string ReviewFilePath { get; set; } |
150 |
[DataMember] |
151 |
public string ReviewFileName { get; set; } |
152 |
[DataMember] |
153 |
public string ProdReviewer { get; set; } |
154 |
[DataMember] |
155 |
public string ProdIsResult { get; set; } |
156 |
[DataMember] |
157 |
public string ProdRemarks { get; set; } |
158 |
public int ProdCapture { get; set; } |
159 |
[DataMember] |
160 |
public string ClientReviewer { get; set; } |
161 |
[DataMember] |
162 |
public string ClientIsResult { get; set; } |
163 |
[DataMember] |
164 |
public string ClientRemarks { get; set; } |
165 |
public int ClientCapture { get; set; } |
166 |
[DataMember] |
167 |
public string DTIsGateWay { get; set; } |
168 |
[DataMember] |
169 |
public string DTIsImport { get; set; } |
170 |
[DataMember] |
171 |
public string DTIsRegSystem { get; set; } |
172 |
[DataMember] |
173 |
public string DTRemarks { get; set; } |
174 |
|
175 |
public List<MarkupText> Markups { get; set; } |
176 |
|
177 |
public List<AttFileInfo> AttFiles { get; set; } |
178 |
|
179 |
|
180 |
public override bool Equals(object obj) |
181 |
{ |
182 |
return Equals(obj as Documents); |
183 |
} |
184 |
|
185 |
public bool Equals(Documents other) |
186 |
{ |
187 |
bool isAttfilesEqual = false; |
188 |
|
189 |
if (this != null && other == null) |
190 |
return false; |
191 |
|
192 |
if (this.AttFiles == null && other.AttFiles == null) |
193 |
{ |
194 |
isAttfilesEqual = true; |
195 |
} |
196 |
else if (this.AttFiles != null && other.AttFiles != null) |
197 |
{ |
198 |
isAttfilesEqual = this.AttFiles.SequenceEqual(other.AttFiles); |
199 |
} |
200 |
|
201 |
bool result = other != null && this.DocumentNo == other.DocumentNo && this.RevisonNo == other.RevisonNo && this.RefProjectCode == other.RefProjectCode && this.IsLatest == other.IsLatest |
202 |
&& this.AutoCADFilie == other.AutoCADFilie && this.PDFFile == other.PDFFile && this.MarkupLink == other.MarkupLink && this.AVEVALink == other.AVEVALink |
203 |
&& this.JobLevel == other.JobLevel && this.IsTypical == other.IsTypical |
204 |
&& this.PersonInCharge == other.PersonInCharge && this.IsDeleted == other.IsDeleted && this.ToIsDiscussion == other.ToIsDiscussion && this.ToRemarks == other.ToRemarks |
205 |
&& this.ToCreator == other.ToCreator && this.ToIsMarkup == other.ToIsMarkup |
206 |
&& this.FrReviewStatus == other.FrReviewStatus && this.FrRemarks == other.FrRemarks && this.FrCreator == other.FrCreator |
207 |
&& this.FrIsMarkup == other.FrIsMarkup && this.IsID2Work == other.IsID2Work && this.ID2Connection == other.ID2Connection |
208 |
&& this.ID2StartDate == other.ID2StartDate && this.ID2EndDate == other.ID2EndDate && this.ID2JobTime == other.ID2JobTime && this.ID2Status == other.ID2Status |
209 |
&& this.ID2Issues == other.ID2Issues && this.AVEVAConnection == other.AVEVAConnection && this.AVEVAConvertDate == other.AVEVAConvertDate && this.AVEVAReviewDate == other.AVEVAReviewDate |
210 |
&& this.AVEVAStatus == other.AVEVAStatus && this.AVEVAIssues == other.AVEVAIssues && this.ReviewFilePath == other.ReviewFilePath && this.ReviewFileName == other.ReviewFileName |
211 |
&& this.ProdReviewer == other.ProdReviewer && this.ProdIsResult == other.ProdIsResult && this.ProdRemarks == other.ProdRemarks && this.ClientReviewer == other.ClientReviewer |
212 |
&& this.ClientIsResult == other.ClientIsResult && this.ClientRemarks == other.ClientRemarks && this.DTIsGateWay == other.DTIsGateWay && this.DTIsImport == other.DTIsImport |
213 |
&& this.DTIsRegSystem == other.DTIsRegSystem && this.DTRemarks == other.DTRemarks |
214 |
&& isAttfilesEqual; |
215 |
|
216 |
if (result == false) |
217 |
{ |
218 |
string id = this.DocID; |
219 |
} |
220 |
|
221 |
return result; |
222 |
|
223 |
} |
224 |
public override int GetHashCode() |
225 |
{ |
226 |
return this.DocumentNo.GetNullableHash() + this.RevisonNo.GetNullableHash() + this.RefProjectCode.GetNullableHash() + this.IsLatest.GetNullableHash() |
227 |
+ this.AutoCADFilie.GetNullableHash() + this.PDFFile.GetNullableHash() + this.MarkupLink.GetNullableHash() + this.AVEVALink.GetNullableHash() |
228 |
+ this.JobLevel.GetNullableHash() + this.IsTypical.GetNullableHash() |
229 |
+ this.PersonInCharge.GetNullableHash() + this.IsDeleted.GetNullableHash() + this.ToIsDiscussion.GetNullableHash() + this.ToRemarks.GetNullableHash() |
230 |
+ this.ToCreator.GetNullableHash() + this.ToIsMarkup.GetNullableHash() |
231 |
+ this.FrReviewStatus.GetNullableHash() + this.FrRemarks.GetNullableHash() + this.FrCreator.GetNullableHash() |
232 |
+ this.FrIsMarkup.GetNullableHash() + this.IsID2Work.GetNullableHash() + this.ID2Connection.GetNullableHash() |
233 |
+ this.ID2StartDate.GetNullableHash() + this.ID2EndDate.GetNullableHash() + this.ID2JobTime.GetNullableHash() + this.ID2Status.GetNullableHash() |
234 |
+ this.ID2Issues.GetNullableHash() + this.AVEVAConnection.GetNullableHash() + this.AVEVAConvertDate.GetNullableHash() + this.AVEVAReviewDate.GetNullableHash() |
235 |
+ this.AVEVAStatus.GetNullableHash() + this.AVEVAIssues.GetNullableHash() + this.ReviewFilePath.GetNullableHash() + this.ReviewFileName.GetNullableHash() |
236 |
+ this.ProdReviewer.GetNullableHash() + this.ProdIsResult.GetNullableHash() + this.ProdRemarks.GetNullableHash() + this.ClientReviewer.GetNullableHash() |
237 |
+ this.ClientIsResult.GetNullableHash() + this.ClientRemarks.GetNullableHash() + this.DTIsGateWay.GetNullableHash() + this.DTIsImport.GetNullableHash() |
238 |
+ this.DTIsRegSystem.GetNullableHash() + this.DTRemarks.GetNullableHash(); |
239 |
} |
240 |
|
241 |
public class DocumentsKeyComparer : IEqualityComparer<Documents> |
242 |
{ |
243 |
public bool Equals(Documents x, Documents y) |
244 |
{ |
245 |
if (x == null && y == null) |
246 |
return true; |
247 |
else if (x == null || y == null) |
248 |
return false; |
249 |
else |
250 |
{ |
251 |
return x.DocID == y.DocID; |
252 |
} |
253 |
} |
254 |
|
255 |
public int GetHashCode(Documents obj) |
256 |
{ |
257 |
return (obj.DocID != null ? obj.DocID.GetHashCode() : 0); |
258 |
} |
259 |
} |
260 |
} |
261 |
|
262 |
[DataContract] |
263 |
public class ID2Drawings |
264 |
{ |
265 |
[DataMember] |
266 |
public string PROJECTNAME { get; set; } |
267 |
[DataMember] |
268 |
public string UID { get; set; } |
269 |
[DataMember] |
270 |
public string NAME { get; set; } |
271 |
[DataMember] |
272 |
public string DOCNAME { get; set; } |
273 |
[DataMember] |
274 |
public DateTime? DATETIME { get; set; } |
275 |
[DataMember] |
276 |
public string OCCUPIED { get; set; } |
277 |
[DataMember] |
278 |
public byte[] Image { get; set; } |
279 |
} |
280 |
|
281 |
public class DocumentsResult |
282 |
{ |
283 |
public List<Documents> Dwgs { get; set; } |
284 |
public int TotalCount { get; set; } |
285 |
} |
286 |
} |