프로젝트

일반

사용자정보

통계
| 개정판:

hytos / ID2.Manager / ID2.Manager.Data / Models / Documents.cs @ 904fbe46

이력 | 보기 | 이력해설 | 다운로드 (11 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
namespace ID2.Manager.Data.Models
11
{
12
    [DataContract]
13
    public class Documents : IEquatable<Documents>, INotifyPropertyChanged
14
    {
15
        public event PropertyChangedEventHandler PropertyChanged;
16
        protected void OnPropertyChanged(string propName)
17
        {
18
            if (PropertyChanged != null)
19
            {
20
                PropertyChanged(this, new PropertyChangedEventArgs(propName));
21
            }
22
        }
23

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

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

    
176
        public string MarkupText { get; set; }
177

    
178
        public override bool Equals(object obj)
179
        {
180
            return Equals(obj as Documents);
181
        }
182

    
183
        public bool Equals(Documents other)
184
        {
185
            return other != null && this.DocumentNo == other.DocumentNo && this.RevisonNo == other.RevisonNo && this.RefProjectCode == other.RefProjectCode && this.IsLatest == other.IsLatest
186
                && this.AutoCADFilie == other.AutoCADFilie && this.PDFFile == other.PDFFile && this.MarkupLink == other.MarkupLink && this.AVEVALink == other.AVEVALink
187
                && this.DocFilePath == other.DocFilePath && this.DocFileName == other.DocFileName && this.JobLevel == other.JobLevel && this.IsTypical == other.IsTypical
188
                && this.PersonInCharge == other.PersonInCharge && this.IsDeleted == other.IsDeleted && this.ToIsDiscussion == other.ToIsDiscussion && this.ToRemarks == other.ToRemarks
189
                && this.ToCreator == other.ToCreator && this.ToCapture == other.ToCapture && this.ToIsMarkup == other.ToIsMarkup
190
                && this.FrReviewStatus == other.FrReviewStatus && this.FrRemarks == other.FrRemarks && this.FrCreator == other.FrCreator
191
                && this.FrCapture == other.FrCapture && this.FrIsMarkup == other.FrIsMarkup && this.IsID2Work == other.IsID2Work && this.ID2Connection == other.ID2Connection
192
                && this.ID2StartDate == other.ID2StartDate && this.ID2EndDate == other.ID2EndDate && this.ID2JobTime == other.ID2JobTime && this.ID2Status == other.ID2Status
193
                && this.ID2Issues == other.ID2Issues && this.AVEVAConnection == other.AVEVAConnection && this.AVEVAConvertDate == other.AVEVAConvertDate && this.AVEVAReviewDate == other.AVEVAReviewDate
194
                && this.AVEVAStatus == other.AVEVAStatus && this.AVEVAIssues == other.AVEVAIssues && this.ReviewFilePath == other.ReviewFilePath && this.ReviewFileName == other.ReviewFileName
195
                && this.ProdReviewer == other.ProdReviewer && this.ProdIsResult == other.ProdIsResult && this.ProdRemarks == other.ProdRemarks && this.ClientReviewer == other.ClientReviewer
196
                && this.ClientIsResult == other.ClientIsResult && this.ClientRemarks == other.ClientRemarks && this.DTIsGateWay == other.DTIsGateWay && this.DTIsImport == other.DTIsImport
197
                && this.DTIsRegSystem == other.DTIsRegSystem && this.DTRemarks == other.DTRemarks
198
                && this.MarkupText == other.MarkupText;
199

    
200
        }
201
        public override int GetHashCode()
202
        {
203
            return this.DocumentNo.GetHashCode() + this.RevisonNo.GetHashCode() + this.RefProjectCode.GetHashCode() + this.IsLatest.GetHashCode()
204
                + this.AutoCADFilie.GetHashCode() + this.PDFFile.GetHashCode() + this.MarkupLink.GetHashCode() + this.AVEVALink.GetHashCode()
205
                + this.DocFilePath.GetHashCode() + this.DocFileName.GetHashCode() + this.JobLevel.GetHashCode() + this.IsTypical.GetHashCode()
206
                + this.PersonInCharge.GetHashCode() + this.IsDeleted.GetHashCode() + this.ToIsDiscussion.GetHashCode() + this.ToRemarks.GetHashCode()
207
                + this.ToCreator.GetHashCode() + this.ToCapture.GetHashCode() + this.ToIsMarkup.GetHashCode()
208
                + this.FrReviewStatus.GetHashCode() + this.FrRemarks.GetHashCode() + this.FrCreator.GetHashCode()
209
                + this.FrCapture.GetHashCode() + this.FrIsMarkup.GetHashCode() + this.IsID2Work.GetHashCode() + this.ID2Connection.GetHashCode()
210
                + this.ID2StartDate.GetHashCode() + this.ID2EndDate.GetHashCode() + this.ID2JobTime.GetHashCode() + this.ID2Status.GetHashCode()
211
                + this.ID2Issues.GetHashCode() + this.AVEVAConnection.GetHashCode() + this.AVEVAConvertDate.GetHashCode() + this.AVEVAReviewDate.GetHashCode()
212
                + this.AVEVAStatus.GetHashCode() + this.AVEVAIssues.GetHashCode() + this.ReviewFilePath.GetHashCode() + this.ReviewFileName.GetHashCode()
213
                + this.ProdReviewer.GetHashCode() + this.ProdIsResult.GetHashCode() + this.ProdRemarks.GetHashCode() + this.ClientReviewer.GetHashCode()
214
                + this.ClientIsResult.GetHashCode() + this.ClientRemarks.GetHashCode() + this.DTIsGateWay.GetHashCode() + this.DTIsImport.GetHashCode()
215
                + this.DTIsRegSystem.GetHashCode() + this.DTRemarks.GetHashCode()
216
                + this.MarkupText.GetHashCode();
217
        }
218

    
219
        public class DocumentsKeyComparer : 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.DocID == y.DocID;
230
                }
231
            }
232

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

    
240
    [DataContract]
241
    public class ID2Drawings
242
    {
243
        [DataMember]
244
        public string PROJECTNAME { get; set; }        
245
        [DataMember]
246
        public string UID { get; set; }
247
        [DataMember]
248
        public string NAME { get; set; }
249
        [DataMember]
250
        public string DOCNAME { get; set; }
251
        [DataMember]
252
        public DateTime? DATETIME { get; set; }
253
        [DataMember]
254
        public string OCCUPIED { get; set; }
255
        [DataMember]
256
        public byte[] Image { get; set; }
257
    }
258

    
259
    public class DocumentsResult
260
    {
261
        public List<Documents> Dwgs { get; set; }
262
        public int TotalCount { get; set; }
263
    }
264
}
클립보드 이미지 추가 (최대 크기: 500 MB)