Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
Skip Navigation LinksHome » Code Library » AgcfEndpoint

Public general use code classes and xml files that we've compiled and used over the years:

AGCF Endpoint Entity Framework class for Next Generation Network (NGN) entity model.

   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:  using System.Text.RegularExpressions;
   9:  using System.Data.Entity;
  10:   
  11:  namespace Ia.Ngn.Cl.Model.Nokia
  12:  {
  13:      ////////////////////////////////////////////////////////////////////////////
  14:   
  15:      /// <summary publish="true">
  16:      /// AGCF Endpoint Entity Framework class for Next Generation Network (NGN) entity model.
  17:      /// </summary>
  18:      /// 
  19:      /// <remarks> 
  20:      /// Copyright � 2014-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  21:      ///
  22:      /// 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
  23:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  24:      ///
  25:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  26:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  27:      /// 
  28:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  29:      /// 
  30:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  31:      /// </remarks> 
  32:      public partial class AgcfEndpoint
  33:      {
  34:          /// <summary>
  35:          /// 1360 COM WebAPI User Guide 255-400-419R3.X
  36:          /// ngfs-agcfendpoint-v2(rtrv,ent,ed,dlt)
  37:          /// </summary>
  38:          public AgcfEndpoint() { }
  39:   
  40:          /// <summary/>
  41:          [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
  42:          public string Id { get; set; }
  43:   
  44:          /// <summary>
  45:          /// PrividUser (req for ent,req for ed). LCP Aid of AGCF Endpoint, same value of PrimaryPUID. String (0-32) [+0-9a-zA-Z:,\-_\.'()]*
  46:          /// </summary>
  47:          public string PrividUser { get; set; }
  48:   
  49:          /// <summary>
  50:          /// Slot (opt for ent,na for ed). LCP Integer (1-99)
  51:          /// </summary>
  52:          public int Slot { get; set; }
  53:   
  54:          /// <summary>
  55:          /// Port (opt for ent,na for ed). LCP Integer (1-99), LCP Integer (2048-4047), LCP-CTS R8.0 Integer (2048-18047), LCP-CTS R8.1.1 Integer (2048-502047)
  56:          /// </summary>
  57:          public int Port { get; set; }
  58:   
  59:          /// <summary>
  60:          /// GwId (req for ent,na for ed). LCP-CTS R9.1 Integer (2048-5002047)
  61:          /// </summary>
  62:          public int GwId { get; set; }
  63:   
  64:          /// <summary>
  65:          /// Dn (req for ent,na for ed). LCP String (0-32) [+0-9a-zA-Z:,\-_\.'()]*
  66:          /// </summary>
  67:          public string Dn { get; set; }
  68:   
  69:          /// <summary>
  70:          /// AdditionalDNs (opt for ent,opt for ed). LCP-CTS R8.1 String, up 9 space separated additional DNs. Each can be up to 32 characters long [0-9a-zA-Z&amp;=\+$,\?/\-_\.!~\*'()]*
  71:          /// </summary>
  72:          public string AdditionalDNs { get; set; }
  73:   
  74:          /// <summary>
  75:          /// DomainIndex (opt for ent,na for ed). LCP Integer (0-150)
  76:          /// </summary>
  77:          public int DomainIndex { get; set; }
  78:   
  79:          /// <summary>
  80:          /// FeatureFlag (opt for ent,opt for ed). LCP Valid value: 0, 1, 2, 0 means None, 1 means WarmLine, 2 means HotLine
  81:          /// </summary>
  82:          public int FeatureFlag { get; set; }
  83:   
  84:          /// <summary>
  85:          /// DslamId (opt for ent,na for ed). LCP String (0-32) [a-zA-Z0-9\*#\.,\-+'~`!@$%^:;=(){}\[\]?&quot;&apos;&amp;&gt;&lt;/_|\\ ]*
  86:          /// </summary>
  87:          public string DslamId { get; set; }
  88:   
  89:          /// <summary>
  90:          /// Rack (opt for ent,na for ed). LCP Integer (1-9)
  91:          /// </summary>
  92:          public int Rack { get; set; }
  93:   
  94:          /// <summary>
  95:          /// Shelf (opt for ent,na for ed). LCP Integer (1-99)
  96:          /// </summary>
  97:          public int Shelf { get; set; }
  98:   
  99:          /// <summary>
 100:          /// FlatTermID (opt for ent,na for ed). LCP-CTS R6.1 Integer (1-32767)
 101:          /// If the GwId corresponding PhysicalTermIDScheme is set to FlatTermID, this FlatTermID field can have D. LCP Command. 317
 102:          /// the value between 1-32767 and the other field shall be set as the following default value:
 103:          /// Slot: 0
 104:          /// Port: 0
 105:          /// DslamId : null
 106:          /// Rack: -1
 107:          /// Shelf: 0
 108:          /// LCP-ISC R21.1.1 Integer (0-32767)
 109:          /// When Shelf/Slot/Port is provisioned, this field will be
 110:          /// set to -1 and value will not be send to NE
 111:          /// </summary>
 112:          public int FlatTermID { get; set; }
 113:   
 114:          /// <summary>
 115:          /// SubscriberType (opt for ent,na for ed). LCP-CTS R6.2 Range: Analog or ISDNBRA. Default: Analog
 116:          /// </summary>
 117:          public bool SubscriberType { get; set; }
 118:   
 119:          /// <summary>
 120:          /// ReversePolarity (opt for ent,opt for ed). LCP-CTS R7.1
 121:          /// Enum: NO_POLARITY_REVERSAL, UPON_DIGIT_COLLECTION_ALWAYS, UPON_REMOTE_ANSWER_ALWAYS, UPON_REMOTE_ANSWER_EXCEPT_FREE_CALLS
 122:          /// Default: NO_POLARITY_REVERSAL
 123:          /// </summary>
 124:          public int ReversePolarity { get; set; }
 125:   
 126:          /// <summary>
 127:          /// PayphoneMetering (opt for ent,opt for ed). LCP-CTS R7.1 
 128:          /// enum: PAYPHONE_REVERSE_POLARITY, PAYPHONE_PULSE_METERING_16_KHZ
 129:          /// default: PAYPHONE_PULSE_METERING_16_KHZ
 130:          /// </summary>
 131:          public int PayphoneMetering { get; set; }
 132:   
 133:          /// <summary>
 134:          /// DigitMap1st (opt for ent,opt for ed). LCP-CTS R7.1 Integer: 0-64
 135:          /// </summary>
 136:          public int DigitMap1st { get; set; }
 137:   
 138:          /// <summary>
 139:          /// DigitMap2nd (opt for ent,opt for ed). LCP-CTS R7.1 Integer: 0-64
 140:          /// </summary>
 141:          public int DigitMap2nd { get; set; }
 142:   
 143:          /// <summary>
 144:          /// DialTone2nd (opt for ent,opt for ed). LCP-CTS R7.1 Integer: 0-128
 145:          /// </summary>
 146:          public int DialTone2nd { get; set; }
 147:   
 148:          /// <summary>
 149:          /// CallHoldLc (opt for ent,opt for ed). LCP-CTS R8.0 boolean, default true
 150:          /// </summary>
 151:          public bool CallHoldLc { get; set; }
 152:   
 153:          /// <summary>
 154:          /// CallWaitingLc (opt for ent,opt for ed). LCP-CTS R8.0 boolean, default true
 155:          /// </summary>
 156:          public bool CallWaitingLc { get; set; }
 157:   
 158:          /// <summary>
 159:          /// CallToggleLc (opt for ent,opt for ed). LCP-CTS R8.0 boolean, default true
 160:          /// </summary>
 161:          public bool CallToggleLc { get; set; }
 162:   
 163:          /// <summary>
 164:          /// ThreeWayCallLc (opt for ent,opt for ed). LCP-CTS R8.0 boolean, default true
 165:          /// </summary>
 166:          public bool ThreeWayCallLc { get; set; }
 167:   
 168:          /// <summary>
 169:          /// McidLc (opt for ent,opt for ed). LCP-CTS R8.0 boolean, default false
 170:          /// </summary>
 171:          public bool McidLc { get; set; }
 172:   
 173:          /// <summary>
 174:          /// Password (opt for ent,opt for ed,na for rtrv). LCP-CTS R8.1 String, max length 32. [+0-9a-zA-Z(),':@&=|-_\.!~*%]*
 175:          /// </summary>
 176:          public string Password { get; set; }
 177:   
 178:          /// <summary>
 179:          /// CallTransferLc (opt for ent,opt for ed). LCP-ISC R22.1 boolean, default false
 180:          /// </summary>
 181:          public bool CallTransferLc { get; set; }
 182:   
 183:          /// <summary/>
 184:          public virtual AgcfGatewayRecord AgcfGatewayRecord { get; set; }
 185:   
 186:          /// <summary/>
 187:          public virtual ICollection<SubParty> SubParties { get; set; }
 188:   
 189:          /// <summary/>
 190:          public DateTime Created { get; set; }
 191:          /// <summary/>
 192:          public DateTime Updated { get; set; }
 193:          /// <summary/>
 194:          public System.Guid UserId { get; set; }
 195:   
 196:          ////////////////////////////////////////////////////////////////////////////
 197:   
 198:          /// <summary>
 199:          ///
 200:          /// </summary>
 201:          public static string AgcfEndpointId(string prividUser)
 202:          {
 203:              return prividUser;
 204:          }
 205:   
 206:          ////////////////////////////////////////////////////////////////////////////
 207:   
 208:          /// <summary>
 209:          ///
 210:          /// </summary>
 211:          public bool Equal(AgcfEndpoint b)
 212:          {
 213:              // below: this will not check the Id, Created, Updated fields
 214:              bool areEqual;
 215:   
 216:              //if (this.BatteryBackupAvailable != b.BatteryBackupAvailable) areEqual = false;
 217:              //else areEqual = true;
 218:   
 219:              areEqual = false;
 220:   
 221:              return areEqual;
 222:          }
 223:   
 224:          ////////////////////////////////////////////////////////////////////////////
 225:   
 226:          /// <summary>
 227:          ///
 228:          /// </summary>
 229:          public bool Update(AgcfEndpoint updatedAgcfEndpoint)
 230:          {
 231:              // below: this will not update Id, Created
 232:              bool updated;
 233:   
 234:              updated = false;
 235:   
 236:              if (this.PrividUser != updatedAgcfEndpoint.PrividUser) { this.PrividUser = updatedAgcfEndpoint.PrividUser; updated = true; }
 237:              if (this.Slot != updatedAgcfEndpoint.Slot) { this.Slot = updatedAgcfEndpoint.Slot; updated = true; }
 238:              if (this.Port != updatedAgcfEndpoint.Port) { this.Port = updatedAgcfEndpoint.Port; updated = true; }
 239:              if (this.GwId != updatedAgcfEndpoint.GwId) { this.GwId = updatedAgcfEndpoint.GwId; updated = true; }
 240:              if (this.Dn != updatedAgcfEndpoint.Dn) { this.Dn = updatedAgcfEndpoint.Dn; updated = true; }
 241:              if (this.AdditionalDNs != updatedAgcfEndpoint.AdditionalDNs) { this.AdditionalDNs = updatedAgcfEndpoint.AdditionalDNs; updated = true; }
 242:              if (this.DomainIndex != updatedAgcfEndpoint.DomainIndex) { this.DomainIndex = updatedAgcfEndpoint.DomainIndex; updated = true; }
 243:              if (this.FeatureFlag != updatedAgcfEndpoint.FeatureFlag) { this.FeatureFlag = updatedAgcfEndpoint.FeatureFlag; updated = true; }
 244:              if (this.DslamId != updatedAgcfEndpoint.DslamId) { this.DslamId = updatedAgcfEndpoint.DslamId; updated = true; }
 245:              if (this.Rack != updatedAgcfEndpoint.Rack) { this.Rack = updatedAgcfEndpoint.Rack; updated = true; }
 246:              if (this.Shelf != updatedAgcfEndpoint.Shelf) { this.Shelf = updatedAgcfEndpoint.Shelf; updated = true; }
 247:              if (this.FlatTermID != updatedAgcfEndpoint.FlatTermID) { this.FlatTermID = updatedAgcfEndpoint.FlatTermID; updated = true; }
 248:              if (this.SubscriberType != updatedAgcfEndpoint.SubscriberType) { this.SubscriberType = updatedAgcfEndpoint.SubscriberType; updated = true; }
 249:              if (this.ReversePolarity != updatedAgcfEndpoint.ReversePolarity) { this.ReversePolarity = updatedAgcfEndpoint.ReversePolarity; updated = true; }
 250:              if (this.PayphoneMetering != updatedAgcfEndpoint.PayphoneMetering) { this.PayphoneMetering = updatedAgcfEndpoint.PayphoneMetering; updated = true; }
 251:              if (this.DigitMap1st != updatedAgcfEndpoint.DigitMap1st) { this.DigitMap1st = updatedAgcfEndpoint.DigitMap1st; updated = true; }
 252:              if (this.DigitMap2nd != updatedAgcfEndpoint.DigitMap2nd) { this.DigitMap2nd = updatedAgcfEndpoint.DigitMap2nd; updated = true; }
 253:              if (this.DialTone2nd != updatedAgcfEndpoint.DialTone2nd) { this.DialTone2nd = updatedAgcfEndpoint.DialTone2nd; updated = true; }
 254:              if (this.CallHoldLc != updatedAgcfEndpoint.CallHoldLc) { this.CallHoldLc = updatedAgcfEndpoint.CallHoldLc; updated = true; }
 255:              if (this.CallWaitingLc != updatedAgcfEndpoint.CallWaitingLc) { this.CallWaitingLc = updatedAgcfEndpoint.CallWaitingLc; updated = true; }
 256:              if (this.CallToggleLc != updatedAgcfEndpoint.CallToggleLc) { this.CallToggleLc = updatedAgcfEndpoint.CallToggleLc; updated = true; }
 257:              if (this.ThreeWayCallLc != updatedAgcfEndpoint.ThreeWayCallLc) { this.ThreeWayCallLc = updatedAgcfEndpoint.ThreeWayCallLc; updated = true; }
 258:              if (this.McidLc != updatedAgcfEndpoint.McidLc) { this.McidLc = updatedAgcfEndpoint.McidLc; updated = true; }
 259:              if (this.Password != updatedAgcfEndpoint.Password) { this.Password = updatedAgcfEndpoint.Password; updated = true; }
 260:              if (this.CallTransferLc != updatedAgcfEndpoint.CallTransferLc) { this.CallTransferLc = updatedAgcfEndpoint.CallTransferLc; updated = true; }
 261:   
 262:              if (this.AgcfGatewayRecord != updatedAgcfEndpoint.AgcfGatewayRecord) { this.AgcfGatewayRecord = updatedAgcfEndpoint.AgcfGatewayRecord; updated = true; }
 263:   
 264:              if (this.UserId != updatedAgcfEndpoint.UserId) { this.UserId = updatedAgcfEndpoint.UserId; updated = true; }
 265:   
 266:              if(updated) this.Updated = DateTime.UtcNow.AddHours(3);
 267:   
 268:              return updated;
 269:          }
 270:   
 271:          ////////////////////////////////////////////////////////////////////////////
 272:          ////////////////////////////////////////////////////////////////////////////
 273:      }
 274:   
 275:      ////////////////////////////////////////////////////////////////////////////
 276:      ////////////////////////////////////////////////////////////////////////////
 277:  }