1: using System;
2: using System.Collections;
3: using System.Collections.Generic;
4: using System.Linq;
5: using System.Web;
6: using System.ComponentModel.DataAnnotations;
7: using System.ComponentModel.DataAnnotations.Schema;
8: using System.Data;
9:
10: namespace Ia.Ngn.Cl.Model.Huawei
11: {
12: ////////////////////////////////////////////////////////////////////////////
13:
14: /// <summary publish="true">
15: /// Sbr Entity Framework class for Next Generation Network (NGN) entity model.
16: /// </summary>
17: ///
18: /// <remarks>
19: /// Copyright © 2014-2015 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
20: ///
21: /// 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
22: /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
23: ///
24: /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
25: /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
26: ///
27: /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
28: ///
29: /// Copyright notice: This notice may not be removed or altered from any source distribution.
30: /// </remarks>
31: public partial class Sbr
32: {
33: /// <summary/>
34: public Sbr() { }
35:
36: //ADD SBR: IMPU="tel:+96523900039", UTYPE=POTS, CPC=ORDINARY, NSCFU=1, NSCFB=1, NSCFNR=1, NSCW=1, NS3PTY=1, NSCLIP=1, NSCBA=1, NSWAKE_UP=1, ITT=1, IITT=1, ICIDD=1, COP="4498";
37:
38: /// <summary/>
39: public long Id { get; set; }
40:
41: /// <summary/>
42: [Key]
43: public string IMPU { get; set; }
44:
45: /// <summary/>
46: public string UTYPE { get; set; }
47:
48: /// <summary/>
49: public string CPC { get; set; }
50:
51: /// <summary/>
52: public bool NSCFU { get; set; }
53:
54: /// <summary/>
55: public bool NSCFB { get; set; }
56:
57: /// <summary/>
58: public bool NSCFNR { get; set; }
59:
60: /// <summary/>
61: public bool NSCW { get; set; }
62:
63: /// <summary/>
64: public bool NS3PTY { get; set; }
65:
66: /// <summary/>
67: public bool NSCLIP { get; set; }
68:
69: /// <summary/>
70: public bool NSCBA { get; set; }
71:
72: /// <summary/>
73: public bool NSWAKE_UP { get; set; }
74:
75: /// <summary/>
76: public bool ITT { get; set; }
77:
78: /// <summary/>
79: public bool IITT { get; set; }
80:
81: /// <summary/>
82: public bool ICIDD { get; set; }
83:
84: /// <summary/>
85: public string COP { get; set; }
86:
87: /// <summary/>
88: public int LMTGRP { get; set; }
89:
90: /// <summary/>
91: public string STYPE { get; set; }
92:
93: /// <summary/>
94: public string TREAT { get; set; }
95:
96: /// <summary/>
97: public int NSICO { get; set; }
98:
99: /// <summary/>
100: public int NSOUTG { get; set; }
101:
102: /// <summary/>
103: public DateTime Created { get; set; }
104:
105: /// <summary/>
106: public DateTime Updated { get; set; }
107:
108: /// <summary/>
109: public DateTime Viewed { get; set; }
110:
111: ////////////////////////////////////////////////////////////////////////////
112:
113: /// <summary>
114: ///
115: /// </summary>
116: public bool Equal(Sbr b)
117: {
118: // below: this will not check the Id, Created, Updated, or Viewed fields
119: bool areEqual;
120:
121: if (this.IMPU != b.IMPU) areEqual = false;
122: else if (this.UTYPE != b.UTYPE) areEqual = false;
123: else if (this.CPC != b.CPC) areEqual = false;
124: else if (this.NSCFU != b.NSCFU) areEqual = false;
125: else if (this.NSCFB != b.NSCFB) areEqual = false;
126: else if (this.NSCFNR != b.NSCFNR) areEqual = false;
127: else if (this.NSCW != b.NSCW) areEqual = false;
128: else if (this.NS3PTY != b.NS3PTY) areEqual = false;
129: else if (this.NSCLIP != b.NSCLIP) areEqual = false;
130: else if (this.NSCBA != b.NSCBA) areEqual = false;
131: else if (this.NSWAKE_UP != b.NSWAKE_UP) areEqual = false;
132: else if (this.ITT != b.ITT) areEqual = false;
133: else if (this.IITT != b.IITT) areEqual = false;
134: else if (this.ICIDD != b.ICIDD) areEqual = false;
135: else if (this.COP != b.COP) areEqual = false;
136: else if (this.LMTGRP != b.LMTGRP) areEqual = false;
137: else if (this.STYPE != b.STYPE) areEqual = false;
138: else if (this.TREAT != b.TREAT) areEqual = false;
139: else if (this.NSICO != b.NSICO) areEqual = false;
140: else if (this.NSOUTG != b.NSOUTG) areEqual = false;
141: else areEqual = true;
142:
143: return areEqual;
144: }
145:
146: ////////////////////////////////////////////////////////////////////////////
147:
148: /// <summary>
149: ///
150: /// </summary>
151: public void Update(Sbr b)
152: {
153: // below: this will not update Id or Created
154:
155: if (this.IMPU != b.IMPU) this.IMPU = b.IMPU;
156: if (this.UTYPE != b.UTYPE) this.UTYPE = b.UTYPE;
157: if (this.CPC != b.CPC) this.CPC = b.CPC;
158: if (this.NSCFU != b.NSCFU) this.NSCFU = b.NSCFU;
159: if (this.NSCFB != b.NSCFB) this.NSCFB = b.NSCFB;
160: if (this.NSCFNR != b.NSCFNR) this.NSCFNR = b.NSCFNR;
161: if (this.NSCW != b.NSCW) this.NSCW = b.NSCW;
162: if (this.NS3PTY != b.NS3PTY) this.NS3PTY = b.NS3PTY;
163: if (this.NSCLIP != b.NSCLIP) this.NSCLIP = b.NSCLIP;
164: if (this.NSCBA != b.NSCBA) this.NSCBA = b.NSCBA;
165: if (this.NSWAKE_UP != b.NSWAKE_UP) this.NSWAKE_UP = b.NSWAKE_UP;
166: if (this.ITT != b.ITT) this.ITT = b.ITT;
167: if (this.IITT != b.IITT) this.IITT = b.IITT;
168: if (this.ICIDD != b.ICIDD) this.ICIDD = b.ICIDD;
169: if (this.COP != b.COP) this.COP = b.COP;
170: if (this.LMTGRP != b.LMTGRP) this.LMTGRP = b.LMTGRP;
171: if (this.STYPE != b.STYPE) this.STYPE = b.STYPE;
172: if (this.TREAT != b.TREAT) this.TREAT = b.TREAT;
173: if (this.NSICO != b.NSICO) this.NSICO = b.NSICO;
174: if (this.NSOUTG != b.NSOUTG) this.NSOUTG = b.NSOUTG;
175:
176: if (this.Updated != b.Updated) this.Updated = b.Updated;
177: if (this.Viewed != b.Viewed) this.Viewed = b.Viewed;
178: }
179:
180: /*
181: ////////////////////////////////////////////////////////////////////////////
182:
183: /// <summary>
184: ///
185: /// </summary>
186: public static long ServiceId(string lceid, int lan)
187: {
188: // below: logic below is based on LCEID data in service.xml
189: long id;
190:
191: id = Ia.Cl.Model.Default.HexToDec(lceid);
192: id = (id - 48000) / 16 * 100000;
193: id += lan;
194:
195: return id;
196: }
197:
198: ////////////////////////////////////////////////////////////////////////////
199:
200: /// <summary>
201: /// Read all services for a certain LCEID
202: /// </summary>
203: public static List<Service> ReadList(string lceidName)
204: {
205: List<Service> serviceList;
206:
207: using (var db = new Ia.Ngn.Cl.Model.Ngn())
208: {
209: serviceList = (from q in db.Services where q.LCEIDName == lceidName select q).ToList();
210: }
211:
212: return serviceList;
213: }
214:
215: ////////////////////////////////////////////////////////////////////////////
216:
217: /// <summary>
218: /// Read service of a DN
219: /// </summary>
220: public static Service Read(long dn)
221: {
222: Service service;
223:
224: using (var db = new Ia.Ngn.Cl.Model.Ngn())
225: {
226: service = (from q in db.Services where q.DN == dn select q).SingleOrDefault();
227: }
228:
229: return service;
230: }
231:
232: ////////////////////////////////////////////////////////////////////////////
233:
234: /// <summary>
235: /// Read all services for a DN list
236: /// </summary>
237: public static List<Service> ReadList(ArrayList dnList)
238: {
239: long i;
240: long[] sp;
241: List<Service> serviceList;
242:
243: i = 0;
244: sp = new long[dnList.Count];
245:
246: foreach (long l in dnList) sp[i++] = l;
247:
248: using (var db = new Ia.Ngn.Cl.Model.Ngn())
249: {
250: //serviceList = (from q in db.Services where dnList.Contains(q.DN) select q).ToList();
251:
252: // var pages = context.Pages.Where(x => keys.Any(key => x.Title.Contains(key)));
253: serviceList = db.Services.Where(q => sp.Any(v => q.DN == v)).ToList();
254: }
255:
256: return serviceList;
257: }
258: */
259:
260: ////////////////////////////////////////////////////////////////////////////
261: ////////////////////////////////////////////////////////////////////////////
262: }
263:
264: ////////////////////////////////////////////////////////////////////////////
265: ////////////////////////////////////////////////////////////////////////////
266: }