)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Skip Navigation LinksHome » Code Library » AgcfGatewayRecordTemp

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

AGCF Gateway Record Entity Framework class for Optical Fiber Network (OFN) entity model.

    1: using System;
    2: using System.Collections.Generic;
    3: using System.ComponentModel.DataAnnotations;
    4: using System.ComponentModel.DataAnnotations.Schema;
    5: using System.Linq;
    6: using System.Threading;
    7: using System.Threading.Tasks;
    8:  
    9: namespace Ia.Ngn.Cl.Model.Nokia
   10: {
   11:     ////////////////////////////////////////////////////////////////////////////
   12:  
   13:     /// <summary publish="true">
   14:     /// AGCF Gateway Record Entity Framework class for Optical Fiber Network (OFN) entity model.
   15:     /// </summary>
   16:     /// 
   17:     /// <remarks> 
   18:     /// Copyright � 2014-2021 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 class AgcfGatewayRecordTemp
   31:     {
   32:         /// <summary>
   33:         /// 1360 COM WebAPI User Guide 255-400-419R3.X
   34:         /// ngfs-agcfgatewayrecord-v2(rtrv,ent,ed,dlt)
   35:         /// </summary>
   36:         public AgcfGatewayRecordTemp() { }
   37:  
   38:         /// <summary/>
   39:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   40:         public int Id { get; set; }
   41:  
   42:         /// <summary>
   43:         /// NgcfAgcfGatewayRecordAid (opt for ent,req for ed) LCP Format as GatewayTableId`GatewayRecordId. GatewayRecordId (2048-4047). The value of GatewayTableId should be same as 'TableId'. The value of GatewayRecordId should be same as 'GwId' LCP-CTS R8.0 From CTS R8.0,GatewayRecordId support(2048-18047) LCP-CTS R8.1.1 From CTS R8.1.1,GatewayRecordId support(2048-502047) LCP-CTS R9.1 From CTS R9.1, GatewayRecordId support(2048-5002047)
   44:         /// </summary>
   45:         public string NgcfAgcfGatewayRecordAid { get; set; }
   46:  
   47:         /// <summary>
   48:         /// TableId (req for ent,req for ed) LCP Same value as the aid of Agcf Gateway Table, Integer (1-99)
   49:         /// </summary>
   50:         public int TableId { get; set; }
   51:  
   52:         /// <summary>
   53:         /// GwId (req for ent,req for ed). LCP Integer (2048-4047). cannot be modified. Default 2048. LCP-CTS R8.0 Integer (2048-18047). Default 2048 LCP-CTS R8.1.1 Integer (2048-502047) Default 2048 LCP-CTS R9.1 Integer (2048-5002047) Default 2048
   54:         /// </summary>
   55:         public int GwId { get; set; }
   56:  
   57:         /// <summary>
   58:         /// AgcfSipIaPort (req for ent,opt for ed). LCP String (1-71)
   59:         /// </summary>
   60:         public string AgcfSipIaPort { get; set; }
   61:  
   62:         /// <summary>
   63:         /// ConnectionType (opt for ent,opt for ed). LCP Valid value: UDP/IP TCP/IP Default UDP/IP
   64:         /// </summary>
   65:         public bool ConnectionType { get; set; }
   66:  
   67:         /// <summary>
   68:         /// ContextAudits (opt for ent,opt for ed). LCP Valid value: None Audit Value Based Default Audit Value Based
   69:         /// </summary>
   70:         public bool ContextAudits { get; set; }
   71:  
   72:         /// <summary>
   73:         /// GwDigitMapId (req for ent,opt for ed). LCP Integer (1-5)
   74:         /// </summary>
   75:         public int GwDigitMapId { get; set; }
   76:  
   77:         /// <summary>
   78:         /// EnableChannelStatusAudits (opt for ent,opt for ed). LCP Boolean (true or false) D. LCP Command. 230 Default false LCP-CTS R8.1.1 Deprecated and will be replaced by "Channel Status Audit/Arming Options".
   79:         /// </summary>
   80:         public bool EnableChannelStatusAudits { get; set; }
   81:  
   82:         /// <summary>
   83:         /// GwUserId (opt for ent,opt for ed). LCP String (1-28). Supported since CTS R6.1, could not be empty after CTS R6.1,, cannot be modified 
   84:         /// </summary>
   85:         public string GwUserId { get; set; }
   86:  
   87:         /// <summary>
   88:         /// GwDomain (req for ent,opt for ed). LCP String (1-255), cannot be modified
   89:         /// </summary>
   90:         public string GwDomain { get; set; }
   91:  
   92:         /// <summary>
   93:         /// GwName (req for ent,opt for ed). LCP String (1-32)
   94:         /// </summary>
   95:         public string GwName { get; set; }
   96:  
   97:         /// <summary>
   98:         /// GwPrivId (req for ent,opt for ed). LCP String(1-100) LCP-CTS R6.1 Deprecated and must be empty since CTS R6.1 (R17.18).
   99:         /// </summary>
  100:         public string GwPrivId { get; set; }
  101:  
  102:         /// <summary>
  103:         /// IP1 (req for ent,opt for ed). LCP Format as: ((([0-1]?[0-9]?[0-9])|(2[0-4][0-9])|(25[0-5]))\.){3}((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])) Default 0.0.0.0
  104:         /// </summary>
  105:         public string IP1 { get; set; }
  106:  
  107:         /// <summary>
  108:         /// IP2 (opt for ent,opt for ed). LCP Format as: ((([0-1]?[0-9]?[0-9])|(2[0-4][0-9])|(25[0-5]))\.){3}((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])) Default 0.0.0.0
  109:         /// </summary>
  110:         public string IP2 { get; set; }
  111:  
  112:         /// <summary>
  113:         /// LocalTermTypePrefix (opt for ent,opt for ed). LCP String (1-32) Default AL LCP-CTS R6.2 Deprecated in CTS 6.2 and later:
  114:         /// </summary>
  115:         public string LocalTermTypePrefix { get; set; }
  116:  
  117:         /// <summary>
  118:         /// LocalTermTypeAnalogPrefix (opt for ent,opt for ed). LCP-CTS R6.2 String (1-32) Default: AL replaces LocalTermTypePrefix
  119:         /// </summary>
  120:         public string LocalTermTypeAnalogPrefix { get; set; }
  121:  
  122:         /// <summary>
  123:         /// IsLocalTermTypeTDMAnalog (opt for ent,opt for ed). LCP Boolean (true or false) Default true
  124:         /// </summary>
  125:         public bool IsLocalTermTypeTDMAnalog { get; set; }
  126:  
  127:         /// <summary>
  128:         /// NetTermTypePrefix (opt for ent,opt for ed). LCP String (1-32) Default RTP/
  129:         /// </summary>
  130:         public string NetTermTypePrefix { get; set; }
  131:  
  132:         /// <summary>
  133:         /// IsNetTermTypeRTPUDP (opt for ent,opt for ed). LCP Boolean (true or false) default true
  134:         /// </summary>
  135:         public bool IsNetTermTypeRTPUDP { get; set; }
  136:  
  137:         /// <summary>
  138:         /// PhysicalTermIdScheme (opt for ent,opt for ed). LCP-CTS R6.0 Valid value:CTS 6.0 and beyond: a. al/dslam/rack/shelf/slot/port b. al/rack/shelf/slot/port c. al/shelf/slot/port Default al/dslam/rack/shelf/slot/port LCP-CTS R6.1 CTS 6.1 addition d. Flat Term ID LCP-CTS R6.2 Deprecated values in CTS 6.2 and later: al/dslam/rack/shelf/slot/port al/rack/shelf/slot/port al/shelf/slot/port New values for CTS 6.2 and later: prefix/dslam/rack/shelf/slot/port[/channel] D. LCP Command. 231 prefix/rack/shelf/slot/port[/channel] prefix/shelf/slot/port[/channel] LCP Boolean (true or false) Default false
  139:         /// </summary>
  140:         public string PhysicalTermIdScheme { get; set; }
  141:  
  142:         /// <summary>
  143:         /// SendCompactMessages (opt for ent,opt for ed). LCP-CTS R8.1.1 default value changed to true
  144:         /// </summary>
  145:         public bool SendCompactMessages { get; set; }
  146:  
  147:         /// <summary>
  148:         /// SendEphemeralPrefix (opt for ent,opt for ed). LCP Boolean (true or false) Default false
  149:         /// </summary>
  150:         public bool SendEphemeralPrefix { get; set; }
  151:  
  152:         /// <summary>
  153:         /// UdpPort (opt for ent,opt for ed). LCP default value:2944 LCP-CTS R8.1.1 value range: 2944-20287 This field specifies the UDP/IP port used by a gateway. From R24.21, the default value depends on the "Gateway Type" field. - Multiple RGWs/iAGs can share port 2944, so the default port for RGWs/iADs is 2944. - For AGWs, non-2944 port number must be unique, so the default should be a free port, the following formala will most likely identify a free port: ((Gateway ID - 2048)%17242) + 2945. 
  154:         /// </summary>
  155:         public int UdpPort { get; set; }
  156:  
  157:         /// <summary>
  158:         /// GwVariantId (req for ent,opt for ed). LCP Integer (1-17) LCP-CTS R8.0 Integer (1-64)
  159:         /// </summary>
  160:         public int GwVariantId { get; set; }
  161:  
  162:         /// <summary>
  163:         /// AreaId (opt for ent,opt for ed). LCP-ISC R21.1.1 Integer (0-100) Default: 0 - means the Area ID is not provisioned Used by the iAGCF to populate the X-ALU-Area-ID parameter sent to the S-CSCF during gateway registrations.
  164:         /// </summary>
  165:         public int AreaId { get; set; }
  166:  
  167:         /// <summary>
  168:         /// ComfortNoise (opt for ent,opt for ed). LCP-ISC R20.0 Boolean (true or false) Default:false
  169:         /// </summary>
  170:         public bool ComfortNoise { get; set; }
  171:  
  172:         /// <summary>
  173:         /// Dtmf (opt for ent,opt for ed). LCP-ISC R20.0 Boolean (true or false) Default:false
  174:         /// </summary>
  175:         public bool Dtmf { get; set; }
  176:  
  177:         /// <summary>
  178:         /// FaxEvents (opt for ent,opt for ed). LCP-ISC R20.0 Boolean (true or false) Default:false
  179:         /// </summary>
  180:         public bool FaxEvents { get; set; }
  181:  
  182:         /// <summary>
  183:         /// ModemEvents (opt for ent,opt for ed). LCP-ISC R20.0 Boolean (true or false) Default:false
  184:         /// </summary>
  185:         public bool ModemEvents { get; set; }
  186:  
  187:         /// <summary>
  188:         /// TextTelephonyEvents (opt for ent,opt for ed). LCP-ISC R20.0 Boolean (true or false) Default:false
  189:         /// </summary>
  190:         public bool TextTelephonyEvents { get; set; }
  191:  
  192:         /// <summary>
  193:         /// AllCodecDataStr (opt for ent,opt for ed). LCP-CTS R6.2 Format as Type|CodecAlgType|PayloadSize|SilenceSupression Type: Audio CodecAlgType: valid value: G.711 - aLaw, G.711 - uLaw. default G.711 - uLaw D. LCP Command. 232 PayloadSize: Integer 1-6 or a multiple of 5 less than or equal to 80. Default 20 SilenceSupression: Boolean (true or false) default false LCP-CTS R7.0 CodecAlgType: valid value: G.711 - aLaw, G.711 - uLaw, G.723, G.729. LCP-CTS R7.0.1 PayloadSize: The field will actually contain "Packetization Time" in milliseconds. Valid range depends on CodecAlgType, as follows: G.711 - aLaw: 10 to 30 in increments of 10 G.711 - uLaw: 10 to 30 in increments of 10 G.723: 30 to 60 in increments of 30 G.729: 10 to 60 in increments of 10 Default for G.723 is 30ms, and for the other 3 types - 20ms.
  194:         /// </summary>
  195:         public string AllCodecDataStr { get; set; }
  196:  
  197:         /// <summary>
  198:         /// AgwIuaIpAddress (opt for ent,opt for ed). LCP-CTS R6.2 String (0-45)[a-fA-F0-9:.]*
  199:         /// </summary>
  200:         public string AgwIuaIpAddress { get; set; }
  201:  
  202:         /// <summary>
  203:         /// AgwIuaSctpPort (opt for ent,opt for ed). LCP-CTS R6.2 Integer 1-65535 Default:9900
  204:         /// </summary>
  205:         public int AgwIuaSctpPort { get; set; }
  206:  
  207:         /// <summary>
  208:         /// AgcfLocalSctpPort (opt for ent,opt for ed). LCP-CTS R6.2 Integer 1025-65535 Default: GatewayId - 2048 + 9900
  209:         /// </summary>
  210:         public int AgcfLocalSctpPort { get; set; }
  211:  
  212:         /// <summary>
  213:         /// SctpProfile (opt for ent,opt for ed). LCP-CTS R6.2 Integer 0-15 Default:0
  214:         /// </summary>
  215:         public int SctpProfile { get; set; }
  216:  
  217:         /// <summary>
  218:         /// IuaIIDMapScheme (opt for ent,opt for ed). LCP-CTS R6.2 Range: "", rack/shelf/slot/port/channel, Flat Term ID Default: rack/shelf/slot/port/channel 
  219:         /// </summary>
  220:         public string IuaIIDMapScheme { get; set; }
  221:  
  222:         /// <summary>
  223:         /// LocalTermTypeIsdnPrefix (opt for ent,opt for ed). LCP-CTS R6.2 This field and AgwIuaIpAddress, AgwIuaIpAddress, AgwIuaSctpPort, AgcfLocalSctpPort , SctpProfile, IuaIIDMapScheme, AuditAllActiveIsdnCalls are for ISDN, if one of them is provided with a non null value, then all ISDN fields must be provided, and vice versa. Default values only apply when AgwIuaIpAddress is not empty. string (1-10) Default: BA
  224:         /// </summary>
  225:         public string LocalTermTypeIsdnPrefix { get; set; }
  226:  
  227:         /// <summary>
  228:         /// AuditAllActiveIsdnCalls (opt for ent,opt for ed). LCP-CTS R6.2 Boolean (true or false) Default:false
  229:         /// </summary>
  230:         public bool AuditAllActiveIsdnCalls { get; set; }
  231:  
  232:         /// <summary>
  233:         /// MateSite (opt for ent,opt for ed). LCP-CTS R6.1 A value of 0 indicates that the GW is not geo-redundant. Otherwise, the GW is considered Geo-Redundant and all the HW data including HSS data will be provisioned on primary and protection switches. The Id given here should D. LCP Command. 233 be that of the switch (2-8) as seen under the alternate switch's protection site list. 
  234:         /// </summary>
  235:         public int MateSite { get; set; }
  236:  
  237:         /// <summary>
  238:         /// MateExternalIPAddr (opt for ent,opt for ed). LCP-CTS R6.1 Default IPv4 external address of the AGCF card on the alternate switch. So, on the Primary, it will be the Protection Switch's AGCF Card IP address. And on the Protection, it will be the Primary Switch's AGCF Card IP address.
  239:         /// </summary>
  240:         public string MateExternalIPAddr { get; set; }
  241:  
  242:         /// <summary>
  243:         /// IsPrimary (opt for ent,opt for ed). LCP-CTS R6.1 True indicates to the switch that it is designated as the primary in the geo-redundancy mode. False otherwise.
  244:         /// </summary>
  245:         public bool IsPrimary { get; set; }
  246:  
  247:         /// <summary>
  248:         /// AddtionalDigitMapList (opt for ent,opt for ed). LCP-CTS R7.1 Digit Map Table id list. Format as tableid1^tableid2^...
  249:         /// </summary>
  250:         public string AddtionalDigitMapList { get; set; }
  251:  
  252:         /// <summary>
  253:         /// AuthTimer (opt for ent,opt for ed). LCP-CTS R8.1.1 Integer (1-60) default:10
  254:         /// </summary>
  255:         public int AuthTimer { get; set; }
  256:  
  257:         /// <summary>
  258:         /// LocalSecKey (opt for ent,opt for ed,na for rtrv). LCP-CTS R8.1.1 Integer (2-65535) default:888
  259:         /// </summary>
  260:         public int LocalSecKey { get; set; }
  261:  
  262:         /// <summary>
  263:         /// SharedBasNumber (opt for ent,opt for ed). LCP-CTS R8.1.1 Ulong (2-4294967295) default:101
  264:         /// </summary>
  265:         public long SharedBasNumber { get; set; }
  266:  
  267:         /// <summary>
  268:         /// SharedPriNumber (opt for ent,opt for ed). LCP-CTS R8.1.1 Integer (2-65535) default:523
  269:         /// </summary>
  270:         public int SharedPriNumber { get; set; }
  271:  
  272:         /// <summary>
  273:         /// SharedSecKey (opt for ent,opt for ed,na for rtrv). LCP-CTS R8.1.1 Hex_Digits (0-32) default:null
  274:         /// </summary>
  275:         public string SharedSecKey { get; set; }
  276:  
  277:         /// <summary>
  278:         /// MgID (opt for ent,opt for ed). LCP-CTS R8.1.1 Hex_Digits (0-32) default:null
  279:         /// </summary>
  280:         public string MgID { get; set; }
  281:  
  282:         /// <summary>
  283:         /// EnnableMD5DigAuteh (opt for ent,opt for ed). LCP-CTS R8.1.1 Boolean (true or false) Default false
  284:         /// </summary>
  285:         public bool EnnableMD5DigAuteh { get; set; }
  286:  
  287:         /// <summary>
  288:         /// ChannelAudits (opt for ent,opt for ed). LCP-CTS R8.1.1 0-Audit disabled 1-Arming Modify+AuditValue in one Transaction 2-Arming Modify and AuditValue done one after another sequentially. default value:Arming Modify+AuditValue in one Transaction
  289:         /// </summary>
  290:         public int ChannelAudits { get; set; }
  291:  
  292:         /// <summary>
  293:         /// GroupId (opt for ent,opt for ed). LCP-CTS R8.1.1 value range:0-500 0 for AGWs; For RGW/iAD, if the GW ID is k, the default value of GW group ID is 1 + (k - 2048)/1000 LCP-CTS R9.1 value range:0-500 0 for AGWs; For RGW/iAD, if the GW ID is k, the default value of GW group ID is 1 + (k - 2048)/10000 
  294:         /// </summary>
  295:         public int GroupId { get; set; }
  296:  
  297:         /// <summary>
  298:         /// AgcfGateWayType (opt for ent,opt for ed). LCP-CTS R8.1.1 RGWs/iADs and AGWs
  299:         /// <summary/>
  300:         public int AgcfGateWayType { get; set; }
  301:  
  302:         /// <summary/>
  303:         public virtual ICollection<AgcfEndpoint> AgcfEndpoints { get; set; }
  304:  
  305:         public DateTime Created { get; set; }
  306:  
  307:         /// <summary/>
  308:         public DateTime Updated { get; set; }
  309:  
  310:         /// <summary/>
  311:         public System.Guid UserId { get; set; }
  312:  
  313:         ////////////////////////////////////////////////////////////////////////////
  314:  
  315:         /// <summary>
  316:         ///
  317:         /// </summary>
  318:         public static int AgcfGatewayRecordId(int tableId, int gwId)
  319:         {
  320:             int id;
  321:             string s;
  322:  
  323:             s = tableId.ToString() + gwId.ToString().PadLeft(6, '0');
  324:  
  325:             id = int.Parse(s);
  326:  
  327:             return id;
  328:         }
  329:  
  330:         ////////////////////////////////////////////////////////////////////////////
  331:  
  332:         /// <summary>
  333:         ///
  334:         /// </summary>
  335:         public static bool Create(AgcfGatewayRecordTemp agcfGatewayRecord, out string result)
  336:         {
  337:             bool b;
  338:  
  339:             b = false;
  340:             result = string.Empty;
  341:  
  342:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  343:             {
  344:                 agcfGatewayRecord.Created = agcfGatewayRecord.Updated = DateTime.UtcNow.AddHours(3);
  345:  
  346:                 db.AgcfGatewayRecordTemps.Add(agcfGatewayRecord);
  347:                 db.SaveChanges();
  348:  
  349:                 b = true;
  350:             }
  351:  
  352:             return b;
  353:         }
  354:  
  355:         ////////////////////////////////////////////////////////////////////////////
  356:  
  357:         /// <summary>
  358:         ///
  359:         /// </summary>
  360:         public static AgcfGatewayRecordTemp Read(int id)
  361:         {
  362:             AgcfGatewayRecordTemp agcfGatewayRecord;
  363:  
  364:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  365:             {
  366:                 agcfGatewayRecord = (from gr in db.AgcfGatewayRecordTemps where gr.Id == id select gr).SingleOrDefault();
  367:             }
  368:  
  369:             return agcfGatewayRecord;
  370:         }
  371:  
  372:         ////////////////////////////////////////////////////////////////////////////
  373:  
  374:         /// <summary>
  375:         ///
  376:         /// </summary>
  377:         public static AgcfGatewayRecordTemp Read(string ip)
  378:         {
  379:             AgcfGatewayRecordTemp agcfGatewayRecord;
  380:  
  381:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  382:             {
  383:                 agcfGatewayRecord = (from gr in db.AgcfGatewayRecordTemps where gr.IP1 == ip select gr).SingleOrDefault();
  384:             }
  385:  
  386:             return agcfGatewayRecord;
  387:         }
  388:  
  389:         ////////////////////////////////////////////////////////////////////////////
  390:  
  391:         /// <summary>
  392:         ///
  393:         /// </summary>
  394:         public static List<AgcfGatewayRecordTemp> ReadList()
  395:         {
  396:             List<AgcfGatewayRecordTemp> agcfGatewayRecordList;
  397:  
  398:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  399:             {
  400:                 agcfGatewayRecordList = (from gr in db.AgcfGatewayRecordTemps select gr).ToList();
  401:             }
  402:  
  403:             return agcfGatewayRecordList;
  404:         }
  405:  
  406:         ////////////////////////////////////////////////////////////////////////////
  407:  
  408:         /// <summary>
  409:         ///
  410:         /// </summary>
  411:         public bool Update(AgcfGatewayRecordTemp agcfGatewayRecord, out string result)
  412:         {
  413:             bool b;
  414:  
  415:             b = false;
  416:             result = string.Empty;
  417:  
  418:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  419:             {
  420:                 agcfGatewayRecord = (from gr in db.AgcfGatewayRecordTemps where gr.Id == agcfGatewayRecord.Id select gr).SingleOrDefault();
  421:  
  422:                 agcfGatewayRecord.Updated = DateTime.UtcNow.AddHours(3);
  423:  
  424:                 db.AgcfGatewayRecordTemps.Attach(agcfGatewayRecord);
  425:  
  426:                 db.Entry(agcfGatewayRecord).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
  427:                 db.SaveChanges();
  428:  
  429:                 b = true;
  430:             }
  431:  
  432:             return b;
  433:         }
  434:  
  435:         ////////////////////////////////////////////////////////////////////////////
  436:  
  437:         /// <summary>
  438:         ///
  439:         /// </summary>
  440:         public static bool Delete(int id, out string result)
  441:         {
  442:             bool b;
  443:  
  444:             b = false;
  445:             result = string.Empty;
  446:  
  447:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  448:             {
  449:                 var v = (from gr in db.AgcfGatewayRecordTemps where gr.Id == id select gr).FirstOrDefault();
  450:  
  451:                 db.AgcfGatewayRecordTemps.Remove(v);
  452:                 db.SaveChanges();
  453:  
  454:                 b = true;
  455:             }
  456:  
  457:             return b;
  458:         }
  459:  
  460:         ////////////////////////////////////////////////////////////////////////////
  461:  
  462:         /// <summary>
  463:         ///
  464:         /// </summary>
  465:         public bool Equal(AgcfGatewayRecord b)
  466:         {
  467:             // below: this will not check the Id, Created, Updated fields
  468:             bool areEqual;
  469:  
  470:             //if (this.BatteryBackupAvailable != b.BatteryBackupAvailable) areEqual = false;
  471:             //else areEqual = true;
  472:  
  473:             areEqual = false;
  474:  
  475:             return areEqual;
  476:         }
  477:  
  478:         ////////////////////////////////////////////////////////////////////////////
  479:  
  480:         /// <summary>
  481:         ///
  482:         /// </summary>
  483:         public bool Update(AgcfGatewayRecordTemp updatedAgcfGatewayRecord)
  484:         {
  485:             // below: this will not update Id, Created
  486:             bool updated;
  487:  
  488:             updated = false;
  489:  
  490:             if (this.NgcfAgcfGatewayRecordAid != updatedAgcfGatewayRecord.NgcfAgcfGatewayRecordAid) { this.NgcfAgcfGatewayRecordAid = updatedAgcfGatewayRecord.NgcfAgcfGatewayRecordAid; updated = true; }
  491:             if (this.TableId != updatedAgcfGatewayRecord.TableId) { this.TableId = updatedAgcfGatewayRecord.TableId; updated = true; }
  492:             if (this.GwId != updatedAgcfGatewayRecord.GwId) { this.GwId = updatedAgcfGatewayRecord.GwId; updated = true; }
  493:             if (this.AgcfSipIaPort != updatedAgcfGatewayRecord.AgcfSipIaPort) { this.AgcfSipIaPort = updatedAgcfGatewayRecord.AgcfSipIaPort; updated = true; }
  494:             if (this.ConnectionType != updatedAgcfGatewayRecord.ConnectionType) { this.ConnectionType = updatedAgcfGatewayRecord.ConnectionType; updated = true; }
  495:             if (this.ContextAudits != updatedAgcfGatewayRecord.ContextAudits) { this.ContextAudits = updatedAgcfGatewayRecord.ContextAudits; updated = true; }
  496:             if (this.GwDigitMapId != updatedAgcfGatewayRecord.GwDigitMapId) { this.GwDigitMapId = updatedAgcfGatewayRecord.GwDigitMapId; updated = true; }
  497:             if (this.EnableChannelStatusAudits != updatedAgcfGatewayRecord.EnableChannelStatusAudits) { this.EnableChannelStatusAudits = updatedAgcfGatewayRecord.EnableChannelStatusAudits; updated = true; }
  498:             if (this.GwUserId != updatedAgcfGatewayRecord.GwUserId) { this.GwUserId = updatedAgcfGatewayRecord.GwUserId; updated = true; }
  499:             if (this.GwDomain != updatedAgcfGatewayRecord.GwDomain) { this.GwDomain = updatedAgcfGatewayRecord.GwDomain; updated = true; }
  500:             if (this.GwName != updatedAgcfGatewayRecord.GwName) { this.GwName = updatedAgcfGatewayRecord.GwName; updated = true; }
  501:             if (this.GwPrivId != updatedAgcfGatewayRecord.GwPrivId) { this.GwPrivId = updatedAgcfGatewayRecord.GwPrivId; updated = true; }
  502:             if (this.IP1 != updatedAgcfGatewayRecord.IP1) { this.IP1 = updatedAgcfGatewayRecord.IP1; updated = true; }
  503:             if (this.IP2 != updatedAgcfGatewayRecord.IP2) { this.IP2 = updatedAgcfGatewayRecord.IP2; updated = true; }
  504:             if (this.LocalTermTypePrefix != updatedAgcfGatewayRecord.LocalTermTypePrefix) { this.LocalTermTypePrefix = updatedAgcfGatewayRecord.LocalTermTypePrefix; updated = true; }
  505:             if (this.LocalTermTypeAnalogPrefix != updatedAgcfGatewayRecord.LocalTermTypeAnalogPrefix) { this.LocalTermTypeAnalogPrefix = updatedAgcfGatewayRecord.LocalTermTypeAnalogPrefix; updated = true; }
  506:             if (this.IsLocalTermTypeTDMAnalog != updatedAgcfGatewayRecord.IsLocalTermTypeTDMAnalog) { this.IsLocalTermTypeTDMAnalog = updatedAgcfGatewayRecord.IsLocalTermTypeTDMAnalog; updated = true; }
  507:             if (this.NetTermTypePrefix != updatedAgcfGatewayRecord.NetTermTypePrefix) { this.NetTermTypePrefix = updatedAgcfGatewayRecord.NetTermTypePrefix; updated = true; }
  508:             if (this.IsNetTermTypeRTPUDP != updatedAgcfGatewayRecord.IsNetTermTypeRTPUDP) { this.IsNetTermTypeRTPUDP = updatedAgcfGatewayRecord.IsNetTermTypeRTPUDP; updated = true; }
  509:             if (this.PhysicalTermIdScheme != updatedAgcfGatewayRecord.PhysicalTermIdScheme) { this.PhysicalTermIdScheme = updatedAgcfGatewayRecord.PhysicalTermIdScheme; updated = true; }
  510:             if (this.SendCompactMessages != updatedAgcfGatewayRecord.SendCompactMessages) { this.SendCompactMessages = updatedAgcfGatewayRecord.SendCompactMessages; updated = true; }
  511:             if (this.SendEphemeralPrefix != updatedAgcfGatewayRecord.SendEphemeralPrefix) { this.SendEphemeralPrefix = updatedAgcfGatewayRecord.SendEphemeralPrefix; updated = true; }
  512:             if (this.UdpPort != updatedAgcfGatewayRecord.UdpPort) { this.UdpPort = updatedAgcfGatewayRecord.UdpPort; updated = true; }
  513:             if (this.GwVariantId != updatedAgcfGatewayRecord.GwVariantId) { this.GwVariantId = updatedAgcfGatewayRecord.GwVariantId; updated = true; }
  514:             if (this.AreaId != updatedAgcfGatewayRecord.AreaId) { this.AreaId = updatedAgcfGatewayRecord.AreaId; updated = true; }
  515:             if (this.ComfortNoise != updatedAgcfGatewayRecord.ComfortNoise) { this.ComfortNoise = updatedAgcfGatewayRecord.ComfortNoise; updated = true; }
  516:             if (this.Dtmf != updatedAgcfGatewayRecord.Dtmf) { this.Dtmf = updatedAgcfGatewayRecord.Dtmf; updated = true; }
  517:             if (this.FaxEvents != updatedAgcfGatewayRecord.FaxEvents) { this.FaxEvents = updatedAgcfGatewayRecord.FaxEvents; updated = true; }
  518:             if (this.ModemEvents != updatedAgcfGatewayRecord.ModemEvents) { this.ModemEvents = updatedAgcfGatewayRecord.ModemEvents; updated = true; }
  519:             if (this.TextTelephonyEvents != updatedAgcfGatewayRecord.TextTelephonyEvents) { this.TextTelephonyEvents = updatedAgcfGatewayRecord.TextTelephonyEvents; updated = true; }
  520:             if (this.AllCodecDataStr != updatedAgcfGatewayRecord.AllCodecDataStr) { this.AllCodecDataStr = updatedAgcfGatewayRecord.AllCodecDataStr; updated = true; }
  521:             if (this.AgwIuaIpAddress != updatedAgcfGatewayRecord.AgwIuaIpAddress) { this.AgwIuaIpAddress = updatedAgcfGatewayRecord.AgwIuaIpAddress; updated = true; }
  522:             if (this.AgwIuaSctpPort != updatedAgcfGatewayRecord.AgwIuaSctpPort) { this.AgwIuaSctpPort = updatedAgcfGatewayRecord.AgwIuaSctpPort; updated = true; }
  523:             if (this.AgcfLocalSctpPort != updatedAgcfGatewayRecord.AgcfLocalSctpPort) { this.AgcfLocalSctpPort = updatedAgcfGatewayRecord.AgcfLocalSctpPort; updated = true; }
  524:             if (this.SctpProfile != updatedAgcfGatewayRecord.SctpProfile) { this.SctpProfile = updatedAgcfGatewayRecord.SctpProfile; updated = true; }
  525:             if (this.IuaIIDMapScheme != updatedAgcfGatewayRecord.IuaIIDMapScheme) { this.IuaIIDMapScheme = updatedAgcfGatewayRecord.IuaIIDMapScheme; updated = true; }
  526:             if (this.LocalTermTypeIsdnPrefix != updatedAgcfGatewayRecord.LocalTermTypeIsdnPrefix) { this.LocalTermTypeIsdnPrefix = updatedAgcfGatewayRecord.LocalTermTypeIsdnPrefix; updated = true; }
  527:             if (this.AuditAllActiveIsdnCalls != updatedAgcfGatewayRecord.AuditAllActiveIsdnCalls) { this.AuditAllActiveIsdnCalls = updatedAgcfGatewayRecord.AuditAllActiveIsdnCalls; updated = true; }
  528:             if (this.MateSite != updatedAgcfGatewayRecord.MateSite) { this.MateSite = updatedAgcfGatewayRecord.MateSite; updated = true; }
  529:             if (this.MateExternalIPAddr != updatedAgcfGatewayRecord.MateExternalIPAddr) { this.MateExternalIPAddr = updatedAgcfGatewayRecord.MateExternalIPAddr; updated = true; }
  530:             if (this.IsPrimary != updatedAgcfGatewayRecord.IsPrimary) { this.IsPrimary = updatedAgcfGatewayRecord.IsPrimary; updated = true; }
  531:             if (this.AddtionalDigitMapList != updatedAgcfGatewayRecord.AddtionalDigitMapList) { this.AddtionalDigitMapList = updatedAgcfGatewayRecord.AddtionalDigitMapList; updated = true; }
  532:             if (this.AuthTimer != updatedAgcfGatewayRecord.AuthTimer) { this.AuthTimer = updatedAgcfGatewayRecord.AuthTimer; updated = true; }
  533:             if (this.LocalSecKey != updatedAgcfGatewayRecord.LocalSecKey) { this.LocalSecKey = updatedAgcfGatewayRecord.LocalSecKey; updated = true; }
  534:             if (this.SharedBasNumber != updatedAgcfGatewayRecord.SharedBasNumber) { this.SharedBasNumber = updatedAgcfGatewayRecord.SharedBasNumber; updated = true; }
  535:             if (this.SharedPriNumber != updatedAgcfGatewayRecord.SharedPriNumber) { this.SharedPriNumber = updatedAgcfGatewayRecord.SharedPriNumber; updated = true; }
  536:             if (this.SharedSecKey != updatedAgcfGatewayRecord.SharedSecKey) { this.SharedSecKey = updatedAgcfGatewayRecord.SharedSecKey; updated = true; }
  537:             if (this.MgID != updatedAgcfGatewayRecord.MgID) { this.MgID = updatedAgcfGatewayRecord.MgID; updated = true; }
  538:             if (this.EnnableMD5DigAuteh != updatedAgcfGatewayRecord.EnnableMD5DigAuteh) { this.EnnableMD5DigAuteh = updatedAgcfGatewayRecord.EnnableMD5DigAuteh; updated = true; }
  539:             if (this.ChannelAudits != updatedAgcfGatewayRecord.ChannelAudits) { this.ChannelAudits = updatedAgcfGatewayRecord.ChannelAudits; updated = true; }
  540:             if (this.GroupId != updatedAgcfGatewayRecord.GroupId) { this.GroupId = updatedAgcfGatewayRecord.GroupId; updated = true; }
  541:             if (this.AgcfGateWayType != updatedAgcfGatewayRecord.AgcfGateWayType) { this.AgcfGateWayType = updatedAgcfGatewayRecord.AgcfGateWayType; updated = true; }
  542:             if (this.UserId != updatedAgcfGatewayRecord.UserId) { this.UserId = updatedAgcfGatewayRecord.UserId; updated = true; }
  543:  
  544:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  545:  
  546:             return updated;
  547:         }
  548:  
  549:         ////////////////////////////////////////////////////////////////////////////
  550:         ////////////////////////////////////////////////////////////////////////////
  551:     }
  552:  
  553:     ////////////////////////////////////////////////////////////////////////////
  554:     ////////////////////////////////////////////////////////////////////////////
  555: }