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 support class for Nokia's Next Generation Network (NGN) business 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.Business.Nokia
  12:  {
  13:      ////////////////////////////////////////////////////////////////////////////
  14:   
  15:      /// <summary publish="true">
  16:      /// AGCF Endpoint support class for Nokia's Next Generation Network (NGN) business 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:          public AgcfEndpoint() { }
  35:   
  36:          ////////////////////////////////////////////////////////////////////////////
  37:   
  38:          /// <summary>
  39:          ///
  40:          /// </summary>
  41:          public static List<Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint> ParseFromDictionary(List<Dictionary<string, string>> parameterDictionaryList)
  42:          {
  43:              int i;
  44:              string prividUser;
  45:              Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint agcfEndpoint;
  46:              List<Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint> agcfEndpointList;
  47:   
  48:              agcfEndpointList = new List<Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint>();
  49:   
  50:              foreach (Dictionary<string, string> parameterDictionary in parameterDictionaryList)
  51:              {
  52:                  agcfEndpoint = new Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint();
  53:   
  54:                  prividUser = parameterDictionary["PrividUser"].ToString();
  55:   
  56:                  agcfEndpoint.Id = Ia.Ngn.Cl.Model.Nokia.AgcfEndpoint.AgcfEndpointId(prividUser);
  57:   
  58:                  agcfEndpoint.PrividUser = prividUser;
  59:                  agcfEndpoint.Slot = int.TryParse(parameterDictionary["Slot"].ToString(), out i) ? i : 0;
  60:                  agcfEndpoint.Port = int.TryParse(parameterDictionary["Port"].ToString(), out i) ? i : 0;
  61:                  agcfEndpoint.GwId = int.TryParse(parameterDictionary["GwId"].ToString(), out i) ? i : 0;
  62:                  agcfEndpoint.Dn = parameterDictionary["Dn"].ToString();
  63:                  agcfEndpoint.AdditionalDNs = parameterDictionary["AdditionalDNs"].ToString();
  64:                  agcfEndpoint.DomainIndex = int.TryParse(parameterDictionary["DomainIndex"].ToString(), out i) ? i : 0;
  65:                  agcfEndpoint.FeatureFlag = int.TryParse(parameterDictionary["FeatureFlag"].ToString(), out i) ? i : 0;
  66:                  agcfEndpoint.DslamId = parameterDictionary["DslamId"].ToString();
  67:                  agcfEndpoint.Rack = int.TryParse(parameterDictionary["Rack"].ToString(), out i) ? i : 0;
  68:                  agcfEndpoint.Shelf = int.TryParse(parameterDictionary["Shelf"].ToString(), out i) ? i : 0;
  69:                  agcfEndpoint.FlatTermID = int.TryParse(parameterDictionary["FlatTermID"].ToString(), out i) ? i : 0;
  70:                  agcfEndpoint.SubscriberType = (parameterDictionary["SubscriberType"].ToString() == "Analog") ? true : false;
  71:                  agcfEndpoint.ReversePolarity = int.TryParse(parameterDictionary["ReversePolarity"].ToString(), out i) ? i : 0;
  72:                  agcfEndpoint.PayphoneMetering = int.TryParse(parameterDictionary["PayphoneMetering"].ToString(), out i) ? i : 0;
  73:                  agcfEndpoint.DigitMap1st = int.TryParse(parameterDictionary["DigitMap1st"].ToString(), out i) ? i : 0;
  74:                  agcfEndpoint.DigitMap2nd = int.TryParse(parameterDictionary["DigitMap2nd"].ToString(), out i) ? i : 0;
  75:                  agcfEndpoint.DialTone2nd = int.TryParse(parameterDictionary["DialTone2nd"].ToString(), out i) ? i : 0;
  76:                  agcfEndpoint.CallHoldLc = Convert.ToBoolean(parameterDictionary["CallHoldLc"].ToString());
  77:                  agcfEndpoint.CallWaitingLc = Convert.ToBoolean(parameterDictionary["CallWaitingLc"].ToString());
  78:                  agcfEndpoint.CallToggleLc = Convert.ToBoolean(parameterDictionary["CallToggleLc"].ToString());
  79:                  agcfEndpoint.ThreeWayCallLc = Convert.ToBoolean(parameterDictionary["ThreeWayCallLc"].ToString());
  80:                  agcfEndpoint.McidLc = Convert.ToBoolean(parameterDictionary["McidLc"].ToString());
  81:                  agcfEndpoint.Password = (parameterDictionary.ContainsKey("Password")) ? parameterDictionary["Password"].ToString() : null;
  82:                  agcfEndpoint.CallTransferLc = Convert.ToBoolean(parameterDictionary["CallTransferLc"].ToString());
  83:   
  84:                  agcfEndpoint.Created = DateTime.UtcNow.AddHours(3);
  85:                  agcfEndpoint.Updated = DateTime.UtcNow.AddHours(3);
  86:                  agcfEndpoint.UserId = Guid.Empty;
  87:   
  88:                  agcfEndpointList.Add(agcfEndpoint);
  89:              }
  90:   
  91:              return agcfEndpointList;
  92:          }
  93:   
  94:          ////////////////////////////////////////////////////////////////////////////
  95:          ////////////////////////////////////////////////////////////////////////////
  96:      }
  97:   
  98:      ////////////////////////////////////////////////////////////////////////////
  99:      ////////////////////////////////////////////////////////////////////////////
 100:  }