hytos / ID2.Manager / ID2.Manager.Data / Models / Documents.cs @ 295ce375
이력 | 보기 | 이력해설 | 다운로드 (11.5 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 |
[DataMember] |
95 |
public string ToCapture { get; set; } |
96 |
[DataMember] |
97 |
public string ToIsMarkup { get; set; } |
98 |
[DataMember] |
99 |
public string FrReviewStatus { get; set; } |
100 |
[DataMember] |
101 |
public string FrRemarks { get; set; } |
102 |
[DataMember] |
103 |
public string FrCreator { get; set; } |
104 |
[DataMember] |
105 |
public string FrCapture { get; set; } |
106 |
[DataMember] |
107 |
public string FrIsMarkup { get; set; } |
108 |
[DataMember] |
109 |
public string IsID2Work { get; set; } |
110 |
[DataMember] |
111 |
public string ID2Connection { get; set; } |
112 |
[DataMember] |
113 |
public DateTime? ID2StartDate { get; set; } |
114 |
[DataMember] |
115 |
public DateTime? ID2EndDate { get; set; } |
116 |
[DataMember] |
117 |
public int ID2JobTime { get; set; } |
118 |
public string ID2JobTimetoString |
119 |
{ |
120 |
get |
121 |
{ |
122 |
StringBuilder sbTemp; |
123 |
if (ID2JobTime > 0) |
124 |
{ |
125 |
sbTemp = new StringBuilder(TimeSpan.FromSeconds(Convert.ToInt32(ID2JobTime)).ToString(@"dd\:hh\:mm\:ss")); |
126 |
} |
127 |
else if (ID2JobTime < 0) |
128 |
{ |
129 |
sbTemp = new StringBuilder(TimeSpan.FromSeconds(Convert.ToInt32(ID2JobTime)).ToString(@"dd\:hh\:mm\:ss")); |
130 |
sbTemp.Insert(0, "-"); |
131 |
} |
132 |
else |
133 |
{ |
134 |
sbTemp = new StringBuilder(); |
135 |
} |
136 |
|
137 |
return sbTemp.ToString(); |
138 |
} |
139 |
} |
140 |
[DataMember] |
141 |
public string ID2Status { get; set; } |
142 |
[DataMember] |
143 |
public string ID2Issues { get; set; } |
144 |
[DataMember] |
145 |
public string AVEVAConnection { get; set; } |
146 |
[DataMember] |
147 |
public DateTime? AVEVAConvertDate { get; set; } |
148 |
[DataMember] |
149 |
public DateTime? AVEVAReviewDate { get; set; } |
150 |
[DataMember] |
151 |
public string AVEVAStatus { get; set; } |
152 |
[DataMember] |
153 |
public string AVEVAIssues { get; set; } |
154 |
[DataMember] |
155 |
public string ReviewFilePath { get; set; } |
156 |
[DataMember] |
157 |
public string ReviewFileName { get; set; } |
158 |
[DataMember] |
159 |
public string ProdReviewer { get; set; } |
160 |
[DataMember] |
161 |
public string ProdIsResult { get; set; } |
162 |
[DataMember] |
163 |
public string ProdRemarks { get; set; } |
164 |
[DataMember] |
165 |
public string ClientReviewer { get; set; } |
166 |
[DataMember] |
167 |
public string ClientIsResult { get; set; } |
168 |
[DataMember] |
169 |
public string ClientRemarks { 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 result = other != null && this.DocumentNo == other.DocumentNo && this.RevisonNo == other.RevisonNo && this.RefProjectCode == other.RefProjectCode && this.IsLatest == other.IsLatest |
192 |
&& this.AutoCADFilie == other.AutoCADFilie && this.PDFFile == other.PDFFile && this.MarkupLink == other.MarkupLink && this.AVEVALink == other.AVEVALink |
193 |
&& this.DocFilePath == other.DocFilePath && this.DocFileName == other.DocFileName && this.JobLevel == other.JobLevel && this.IsTypical == other.IsTypical |
194 |
&& this.PersonInCharge == other.PersonInCharge && this.IsDeleted == other.IsDeleted && this.ToIsDiscussion == other.ToIsDiscussion && this.ToRemarks == other.ToRemarks |
195 |
&& this.ToCreator == other.ToCreator && this.ToCapture == other.ToCapture && this.ToIsMarkup == other.ToIsMarkup |
196 |
&& this.FrReviewStatus == other.FrReviewStatus && this.FrRemarks == other.FrRemarks && this.FrCreator == other.FrCreator |
197 |
&& this.FrCapture == other.FrCapture && this.FrIsMarkup == other.FrIsMarkup && this.IsID2Work == other.IsID2Work && this.ID2Connection == other.ID2Connection |
198 |
&& this.ID2StartDate == other.ID2StartDate && this.ID2EndDate == other.ID2EndDate && this.ID2JobTime == other.ID2JobTime && this.ID2Status == other.ID2Status |
199 |
&& this.ID2Issues == other.ID2Issues && this.AVEVAConnection == other.AVEVAConnection && this.AVEVAConvertDate == other.AVEVAConvertDate && this.AVEVAReviewDate == other.AVEVAReviewDate |
200 |
&& this.AVEVAStatus == other.AVEVAStatus && this.AVEVAIssues == other.AVEVAIssues && this.ReviewFilePath == other.ReviewFilePath && this.ReviewFileName == other.ReviewFileName |
201 |
&& this.ProdReviewer == other.ProdReviewer && this.ProdIsResult == other.ProdIsResult && this.ProdRemarks == other.ProdRemarks && this.ClientReviewer == other.ClientReviewer |
202 |
&& this.ClientIsResult == other.ClientIsResult && this.ClientRemarks == other.ClientRemarks && this.DTIsGateWay == other.DTIsGateWay && this.DTIsImport == other.DTIsImport |
203 |
&& this.DTIsRegSystem == other.DTIsRegSystem && this.DTRemarks == other.DTRemarks |
204 |
&& this.AttFiles != null && other.AttFiles != null && this.AttFiles.SequenceEqual(other.AttFiles); |
205 |
|
206 |
if (result == false) |
207 |
{ |
208 |
string id = this.DocID; |
209 |
} |
210 |
|
211 |
return result; |
212 |
|
213 |
} |
214 |
public override int GetHashCode() |
215 |
{ |
216 |
return this.DocumentNo.GetNullableHash() + this.RevisonNo.GetNullableHash() + this.RefProjectCode.GetNullableHash() + this.IsLatest.GetNullableHash() |
217 |
+ this.AutoCADFilie.GetNullableHash() + this.PDFFile.GetNullableHash() + this.MarkupLink.GetNullableHash() + this.AVEVALink.GetNullableHash() |
218 |
+ this.DocFilePath.GetNullableHash() + this.DocFileName.GetNullableHash() + this.JobLevel.GetNullableHash() + this.IsTypical.GetNullableHash() |
219 |
+ this.PersonInCharge.GetNullableHash() + this.IsDeleted.GetNullableHash() + this.ToIsDiscussion.GetNullableHash() + this.ToRemarks.GetNullableHash() |
220 |
+ this.ToCreator.GetNullableHash() + this.ToCapture.GetNullableHash() + this.ToIsMarkup.GetNullableHash() |
221 |
+ this.FrReviewStatus.GetNullableHash() + this.FrRemarks.GetNullableHash() + this.FrCreator.GetNullableHash() |
222 |
+ this.FrCapture.GetNullableHash() + this.FrIsMarkup.GetNullableHash() + this.IsID2Work.GetNullableHash() + this.ID2Connection.GetNullableHash() |
223 |
+ this.ID2StartDate.GetNullableHash() + this.ID2EndDate.GetNullableHash() + this.ID2JobTime.GetNullableHash() + this.ID2Status.GetNullableHash() |
224 |
+ this.ID2Issues.GetNullableHash() + this.AVEVAConnection.GetNullableHash() + this.AVEVAConvertDate.GetNullableHash() + this.AVEVAReviewDate.GetNullableHash() |
225 |
+ this.AVEVAStatus.GetNullableHash() + this.AVEVAIssues.GetNullableHash() + this.ReviewFilePath.GetNullableHash() + this.ReviewFileName.GetNullableHash() |
226 |
+ this.ProdReviewer.GetNullableHash() + this.ProdIsResult.GetNullableHash() + this.ProdRemarks.GetNullableHash() + this.ClientReviewer.GetNullableHash() |
227 |
+ this.ClientIsResult.GetNullableHash() + this.ClientRemarks.GetNullableHash() + this.DTIsGateWay.GetNullableHash() + this.DTIsImport.GetNullableHash() |
228 |
+ this.DTIsRegSystem.GetNullableHash() + this.DTRemarks.GetNullableHash() |
229 |
+ this.AttFiles.GetNullableHash(); |
230 |
} |
231 |
|
232 |
public class DocumentsKeyComparer : IEqualityComparer<Documents> |
233 |
{ |
234 |
public bool Equals(Documents x, Documents y) |
235 |
{ |
236 |
if (x == null && y == null) |
237 |
return true; |
238 |
else if (x == null || y == null) |
239 |
return false; |
240 |
else |
241 |
{ |
242 |
return x.DocID == y.DocID; |
243 |
} |
244 |
} |
245 |
|
246 |
public int GetHashCode(Documents obj) |
247 |
{ |
248 |
return (obj.DocID != null ? obj.DocID.GetHashCode() : 0); |
249 |
} |
250 |
} |
251 |
} |
252 |
|
253 |
[DataContract] |
254 |
public class ID2Drawings |
255 |
{ |
256 |
[DataMember] |
257 |
public string PROJECTNAME { get; set; } |
258 |
[DataMember] |
259 |
public string UID { get; set; } |
260 |
[DataMember] |
261 |
public string NAME { get; set; } |
262 |
[DataMember] |
263 |
public string DOCNAME { get; set; } |
264 |
[DataMember] |
265 |
public DateTime? DATETIME { get; set; } |
266 |
[DataMember] |
267 |
public string OCCUPIED { get; set; } |
268 |
[DataMember] |
269 |
public byte[] Image { get; set; } |
270 |
} |
271 |
|
272 |
public class DocumentsResult |
273 |
{ |
274 |
public List<Documents> Dwgs { get; set; } |
275 |
public int TotalCount { get; set; } |
276 |
} |
277 |
} |