1: using System;
2: using System.Collections.Generic;
3: using System.Linq;
4: using System.Web;
5: using System.Web.Security;
6: using System.ComponentModel.DataAnnotations;
7: using System.ComponentModel.DataAnnotations.Schema;
8:
9: namespace Ia.Ngn.Cl.Model
10: {
11: ////////////////////////////////////////////////////////////////////////////
12:
13: /// <summary publish="true">
14: /// ONT-SERVICEHSI Entity Framework class for Next Generation Network (NGN) entity model.
15: /// </summary>
16: ///
17: /// <remarks>
18: /// Copyright © 2006-2018 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
19: ///
20: /// 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
21: /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
22: ///
23: /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
24: /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
25: ///
26: /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
27: ///
28: /// Copyright notice: This notice may not be removed or altered from any source distribution.
29: /// </remarks>
30: public partial class OntServiceHsi
31: {
32: /// <summary/>
33: public OntServiceHsi() { }
34:
35: /// <summary/>
36: public enum PriorityQueueProfile { A = 1 };
37:
38: /// <summary/>
39: [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
40: public string Id { get; set; }
41:
42: /// <summary/>
43: public int StateId { get; set; }
44:
45: /// <summary/>
46: public int Card { get; set; }
47:
48: /// <summary/>
49: public int Port { get; set; }
50:
51: /// <summary/>
52: public int Service { get; set; }
53:
54: /// <summary/>
55: public int UpstreamBandwidthProfileId { get; set; }
56:
57: /// <summary/>
58: public int DownstreamBandwidthProfileId { get; set; }
59:
60: /// <summary/>
61: public int PriorityQueueProfileId { get; set; }
62:
63: /// <summary/>
64: public bool Aes { get; set; }
65:
66: /// <summary/>
67: public int Svlan { get; set; }
68:
69: /// <summary/>
70: public string Label { get; set; }
71:
72: /// <summary/>
73: public string Customer { get; set; }
74:
75: /// <summary/>
76: public DateTime Created { get; set; }
77:
78: /// <summary/>
79: public DateTime Updated { get; set; }
80:
81: /// <summary/>
82: public System.Guid UserId { get; set; }
83:
84: /// <summary/>
85: public virtual Ont Ont { get; set; }
86:
87: ////////////////////////////////////////////////////////////////////////////
88:
89: /// <summary>
90: ///
91: /// </summary>
92: [NotMapped]
93: public string State
94: {
95: get
96: {
97: return Ia.Ngn.Cl.Model.Data.Nokia.Ams.BellcoreStateFromId(this.StateId);
98: }
99: }
100:
101: ////////////////////////////////////////////////////////////////////////////
102:
103: /// <summary>
104: ///
105: /// </summary>
106: public bool Equal(OntServiceHsi b)
107: {
108: // below: this will not check the Id, Created, Updated fields
109: bool areEqual;
110:
111: /*if (this.BatteryBackupAvailable != b.BatteryBackupAvailable) areEqual = false;
112: else*/ areEqual = true;
113:
114: return areEqual;
115: }
116:
117: ////////////////////////////////////////////////////////////////////////////
118:
119: /// <summary>
120: ///
121: /// </summary>
122: public bool Update(OntServiceHsi b)
123: {
124: // below: this will not update Id, Created
125: bool updated;
126:
127: updated = false;
128:
129: if (this.Aes != b.Aes) { this.Aes = b.Aes; updated = true; }
130: if (this.Card != b.Card) { this.Card = b.Card; updated = true; }
131: if (this.Customer != b.Customer) { this.Customer = b.Customer; updated = true; }
132: if (this.DownstreamBandwidthProfileId != b.DownstreamBandwidthProfileId) { this.DownstreamBandwidthProfileId = b.DownstreamBandwidthProfileId; updated = true; }
133: if (this.Label != b.Label) { this.Label = b.Label; updated = true; }
134: if (this.Ont != b.Ont) { this.Ont = b.Ont; updated = true; }
135: if (this.Port != b.Port) { this.Port = b.Port; updated = true; }
136:
137: if (this.PriorityQueueProfileId != b.PriorityQueueProfileId) { this.PriorityQueueProfileId = b.PriorityQueueProfileId; updated = true; }
138: if (this.Service != b.Service) { this.Service = b.Service; updated = true; }
139: if (this.StateId != b.StateId) { this.StateId = b.StateId; updated = true; }
140: if (this.Svlan != b.Svlan) { this.Svlan = b.Svlan; updated = true; }
141: if (this.UpstreamBandwidthProfileId != b.UpstreamBandwidthProfileId) { this.UpstreamBandwidthProfileId = b.UpstreamBandwidthProfileId; updated = true; }
142: if (this.UserId != b.UserId) { this.UserId = b.UserId; updated = true; }
143:
144: if(updated) this.Updated = DateTime.UtcNow.AddHours(3);
145:
146: return updated;
147: }
148:
149: ////////////////////////////////////////////////////////////////////////////
150: ////////////////////////////////////////////////////////////////////////////
151:
152: /// <summary>
153: ///
154: /// </summary>
155: public string ToSimpleTextString()
156: {
157: return Ia.Ngn.Cl.Model.Data.Nokia.OntServiceHsi.ToSimpleTextString(this);
158: }
159:
160: ////////////////////////////////////////////////////////////////////////////
161: ////////////////////////////////////////////////////////////////////////////
162: }
163:
164: ////////////////////////////////////////////////////////////////////////////
165: ////////////////////////////////////////////////////////////////////////////
166: }