1: using System;
2: using System.ComponentModel.DataAnnotations;
3: using System.ComponentModel.DataAnnotations.Schema;
4: using System.Linq;
5: using System.Threading;
6: using System.Threading.Tasks;
7:
8: namespace Ia.Ngn.Cl.Model.Siemens
9: {
10: ////////////////////////////////////////////////////////////////////////////
11:
12: /// <summary publish="true">
13: /// EWSD Subscriber Entity Framework class for Optical Fiber Network (OFN) entity model.
14: /// </summary>
15: ///
16: /// <remarks>
17: /// Copyright � 2019-2021 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
18: ///
19: /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
20: /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
21: ///
22: /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
23: /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
24: ///
25: /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
26: ///
27: /// Copyright notice: This notice may not be removed or altered from any source distribution.
28: /// </remarks>
29: public class EwsdSubscriber
30: {
31: /// <summary/>
32: public EwsdSubscriber() { }
33:
34: /// <summary/>
35: [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
36: public string Id { get; set; }
37:
38: /// <summary/>
39: public int DN { get; set; }
40:
41: /// <summary/>
42: public string LAC { get; set; }
43:
44: /// <summary/>
45: public string EQN { get; set; }
46:
47: /// <summary/>
48: public string CAT { get; set; }
49:
50: /// <summary/>
51: public string LTT { get; set; }
52:
53: /// <summary/>
54: public string OPTRCL { get; set; }
55:
56: /// <summary/>
57: public string SUBTRCL { get; set; }
58:
59: /// <summary/>
60: public string NUMCAL { get; set; }
61:
62: /// <summary/>
63: public string ORIG1 { get; set; }
64:
65: /// <summary/>
66: public string TRARSTR { get; set; }
67:
68: /// <summary/>
69: public string LNATT { get; set; }
70:
71: /// <summary/>
72: public string DIV { get; set; }
73:
74: /// <summary/>
75: public string COS { get; set; }
76:
77: /// <summary/>
78: public string ADDINF { get; set; }
79:
80: /// <summary/>
81: public string NUMBCH { get; set; }
82:
83: /// <summary/>
84: public string CTDIVI { get; set; }
85:
86: /// <summary/>
87: public string BLK { get; set; }
88:
89: /// <summary/>
90: public string Content { get; set; }
91:
92: /// <summary/>
93: public DateTime Created { get; set; }
94:
95: /// <summary/>
96: public DateTime Updated { get; set; }
97:
98: ////////////////////////////////////////////////////////////////////////////
99:
100: /// <summary>
101: ///
102: /// </summary>
103: public bool Equal(Ia.Ngn.Cl.Model.Siemens.EwsdSubscriber b)
104: {
105: // below: this will not check the Id, Created, Updated fields
106: bool areEqual;
107:
108: if (this.DN != b.DN) areEqual = false;
109: else if (this.LAC != b.LAC) areEqual = false;
110: else if (this.EQN != b.EQN) areEqual = false;
111: else if (this.CAT != b.CAT) areEqual = false;
112: else if (this.LTT != b.LTT) areEqual = false;
113: else if (this.OPTRCL != b.OPTRCL) areEqual = false;
114: else if (this.SUBTRCL != b.SUBTRCL) areEqual = false;
115: else if (this.NUMCAL != b.NUMCAL) areEqual = false;
116: else if (this.ORIG1 != b.ORIG1) areEqual = false;
117: else if (this.TRARSTR != b.TRARSTR) areEqual = false;
118: else if (this.LNATT != b.LNATT) areEqual = false;
119: else if (this.DIV != b.DIV) areEqual = false;
120: else if (this.COS != b.COS) areEqual = false;
121: else if (this.ADDINF != b.ADDINF) areEqual = false;
122: else if (this.NUMBCH != b.NUMBCH) areEqual = false;
123: else if (this.CTDIVI != b.CTDIVI) areEqual = false;
124: else if (this.BLK != b.BLK) areEqual = false;
125: else if (this.Content != b.Content) areEqual = false;
126: else areEqual = true;
127:
128: return areEqual;
129: }
130:
131: ////////////////////////////////////////////////////////////////////////////
132:
133: /// <summary>
134: ///
135: /// </summary>
136: public bool Update(Ia.Ngn.Cl.Model.Siemens.EwsdSubscriber updatedItem)
137: {
138: // below: this will not update Id, Created
139: bool updated;
140:
141: updated = false;
142:
143: if (this.DN != updatedItem.DN) { this.DN = updatedItem.DN; updated = true; }
144: if (this.LAC != updatedItem.LAC) { this.LAC = updatedItem.LAC; updated = true; }
145: if (this.EQN != updatedItem.EQN) { this.EQN = updatedItem.EQN; updated = true; }
146: if (this.CAT != updatedItem.CAT) { this.CAT = updatedItem.CAT; updated = true; }
147: if (this.LTT != updatedItem.LTT) { this.LTT = updatedItem.LTT; updated = true; }
148: if (this.OPTRCL != updatedItem.OPTRCL) { this.OPTRCL = updatedItem.OPTRCL; updated = true; }
149: if (this.SUBTRCL != updatedItem.SUBTRCL) { this.SUBTRCL = updatedItem.SUBTRCL; updated = true; }
150: if (this.NUMCAL != updatedItem.NUMCAL) { this.NUMCAL = updatedItem.NUMCAL; updated = true; }
151: if (this.ORIG1 != updatedItem.ORIG1) { this.ORIG1 = updatedItem.ORIG1; updated = true; }
152: if (this.TRARSTR != updatedItem.TRARSTR) { this.TRARSTR = updatedItem.TRARSTR; updated = true; }
153: if (this.LNATT != updatedItem.LNATT) { this.LNATT = updatedItem.LNATT; updated = true; }
154: if (this.DIV != updatedItem.DIV) { this.DIV = updatedItem.DIV; updated = true; }
155: if (this.COS != updatedItem.COS) { this.COS = updatedItem.COS; updated = true; }
156: if (this.ADDINF != updatedItem.ADDINF) { this.ADDINF = updatedItem.ADDINF; updated = true; }
157: if (this.NUMBCH != updatedItem.NUMBCH) { this.NUMBCH = updatedItem.NUMBCH; updated = true; }
158: if (this.CTDIVI != updatedItem.CTDIVI) { this.CTDIVI = updatedItem.CTDIVI; updated = true; }
159: if (this.BLK != updatedItem.BLK) { this.BLK = updatedItem.BLK; updated = true; }
160: if (this.Content != updatedItem.Content) { this.Content = updatedItem.Content; updated = true; }
161:
162: if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
163:
164: return updated;
165: }
166:
167: ////////////////////////////////////////////////////////////////////////////
168: ////////////////////////////////////////////////////////////////////////////
169:
170: /// <summary>
171: ///
172: /// </summary>
173: public string ToSimpleTextString()
174: {
175: return Ia.Ngn.Cl.Model.Data.Siemens.Subscriber.ToSimpleTextString(this);
176: }
177:
178: ////////////////////////////////////////////////////////////////////////////
179: ////////////////////////////////////////////////////////////////////////////
180: }
181:
182: ////////////////////////////////////////////////////////////////////////////
183: ////////////////////////////////////////////////////////////////////////////
184: }