شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة ش.ش.و.

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Access

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

Access support class for Next Generation Network (NGN) ui model.

   1:  using System.Collections.Generic;
   2:  using System.Data;
   3:  using System.Linq;
   4:   
   5:  namespace Ia.Ngn.Cl.Model.Ui
   6:  {
   7:      ////////////////////////////////////////////////////////////////////////////
   8:   
   9:      /// <summary publish="true">
  10:      /// Access support class for Next Generation Network (NGN) ui model.
  11:      /// </summary>
  12:      /// 
  13:      /// <remarks> 
  14:      /// Copyright © 2006-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
  15:      ///
  16:      /// 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
  17:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  18:      ///
  19:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  20:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  21:      /// 
  22:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  23:      /// 
  24:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  25:      /// </remarks> 
  26:      public partial class Access
  27:      {
  28:          /// <summary/>
  29:          public string Id { get; set; }
  30:   
  31:          /// <summary/>
  32:          public int AreaId { get; set; }
  33:          /// <summary/>
  34:          public string Block { get; set; }
  35:          /// <summary/>
  36:          public string Street { get; set; }
  37:          /// <summary/>
  38:          public string Boulevard { get; set; }
  39:          /// <summary/>
  40:          public string PremisesOld { get; set; }
  41:          /// <summary/>
  42:          public string PremisesNew { get; set; }
  43:          /// <summary/>
  44:          public string Name { get; set; }
  45:   
  46:          /// <summary/>
  47:          public int NumberOfTrials { get; set; }
  48:   
  49:          /// <summary/>
  50:          public string Note { get; set; }
  51:   
  52:          /// <summary/>
  53:          public Access() { }
  54:   
  55:          ////////////////////////////////////////////////////////////////////////////
  56:   
  57:          /// <summary>
  58:          ///
  59:          /// </summary>
  60:          public static DataTable ReadListWithOntListProvisionedAndReadyButDoNotExistInCustomerDepartmentDatabaseDataTable()
  61:          {
  62:              return ReadListWithOntListProvisionedAndReadyButDoNotExistInCustomerDepartmentDatabaseDataTable(99999);
  63:          }
  64:   
  65:          ////////////////////////////////////////////////////////////////////////////
  66:   
  67:          /// <summary>
  68:          ///
  69:          /// </summary>
  70:          public static DataTable ReadListWithOntListProvisionedAndReadyButDoNotExistInCustomerDepartmentDatabaseDataTable(int numberOfFirstRowsToTake)
  71:          {
  72:              bool familyExists;
  73:              int c, possibleNumberOfTd, possibleNumberOfEthernet;
  74:              string /*accessId, ponNumber, ontNumber,*/ areaSymbol, areaName, accessOntFamilyTypeCapacityString;
  75:              DataRow dr;
  76:              DataTable dt;
  77:              List<Ia.Ngn.Cl.Model.Access> accessList;
  78:              Ia.Ngn.Cl.Model.Business.Service.KuwaitNgnArea kuwaitNgnArea;
  79:   
  80:              familyExists = false;
  81:              c = 0;
  82:              possibleNumberOfTd = possibleNumberOfEthernet = 0;
  83:   
  84:              dt = new DataTable("");
  85:              dt.Columns.Add("Id");
  86:              dt.Columns.Add("Pon");
  87:              dt.Columns.Add("Ont");
  88:              dt.Columns.Add("Name");
  89:              dt.Columns.Add("FamilyType");
  90:              dt.Columns.Add("AreaSymbol");
  91:              dt.Columns.Add("Area");
  92:              dt.Columns.Add("Block");
  93:              dt.Columns.Add("Street");
  94:              dt.Columns.Add("PremisesOld");
  95:              dt.Columns.Add("PremisesNew");
  96:              dt.Columns.Add("Paci");
  97:              dt.Columns.Add("Note");
  98:              dt.Columns.Add("PossibleNumberOfTd");
  99:              dt.Columns.Add("PossibleNumberOfEthernet");
 100:   
 101:              accessList = Ia.Ngn.Cl.Model.Data.Access.ListOfAccessesWithProvisionedAndReadyOntsAndEmsOntsButDoNotExistInCustomerDepartmentDatabase();
 102:   
 103:              accessList = accessList.OrderByDescending(a => a.Created).ToList();
 104:   
 105:              foreach (Ia.Ngn.Cl.Model.Access access in accessList)
 106:              {
 107:                  familyExists = false;
 108:                  possibleNumberOfTd = possibleNumberOfEthernet = 0;
 109:   
 110:                  if (access.Onts != null && access.Onts.Count > 0)
 111:                  {
 112:                      accessOntFamilyTypeCapacityString = Ia.Ngn.Cl.Model.Data.Nokia.Ont.FamilyTypeFromId(access.Onts.FirstOrDefault().FamilyTypeId);
 113:   
 114:                      possibleNumberOfTd = Ia.Ngn.Cl.Model.Business.Nokia.Ams.PossibleNumberOfTdForOntFamilyType(access.Onts.FirstOrDefault().FamilyTypeId);
 115:                      possibleNumberOfEthernet = Ia.Ngn.Cl.Model.Business.Nokia.Ams.PossibleNumberOfHsiCardPortServiceConfigurationForOntFamilyType(access.Onts.FirstOrDefault().FamilyTypeId);
 116:   
 117:                      accessOntFamilyTypeCapacityString += " (" + possibleNumberOfTd + ")";
 118:   
 119:                      familyExists = true;
 120:                  }
 121:                  else if (access.EmsOnts != null && access.EmsOnts.Count > 0)
 122:                  {
 123:                      accessOntFamilyTypeCapacityString = access.EmsOnts.FirstOrDefault().FamilyType.ToString().ToUpper();
 124:   
 125:                      possibleNumberOfTd = access.EmsOnts.FirstOrDefault().EquipmentType.TelPorts;
 126:                      possibleNumberOfEthernet = access.EmsOnts.FirstOrDefault().EquipmentType.EthernetPorts;
 127:   
 128:                      accessOntFamilyTypeCapacityString += " (" + possibleNumberOfTd + ")";
 129:   
 130:                      familyExists = true;
 131:                  }
 132:                  else accessOntFamilyTypeCapacityString = string.Empty;
 133:   
 134:                  if (familyExists)
 135:                  {
 136:                      c++;
 137:   
 138:                      dr = dt.NewRow();
 139:   
 140:                      dr["Id"] = access.Id;
 141:                      dr["Pon"] = access.Pon;
 142:                      dr["Ont"] = access.Ont;
 143:                      dr["Name"] = access.Name;
 144:                      dr["Paci"] = access.Paci;
 145:                      dr["Note"] = access.Note;
 146:   
 147:                      dr["FamilyType"] = accessOntFamilyTypeCapacityString;
 148:   
 149:                      kuwaitNgnArea = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == access.AreaId select kna).SingleOrDefault();
 150:   
 151:                      areaName = kuwaitNgnArea.Name;
 152:                      areaSymbol = kuwaitNgnArea.Symbol;
 153:   
 154:                      dr["AreaSymbol"] = areaSymbol;
 155:                      dr["Area"] = areaName;
 156:   
 157:                      dr["Block"] = access.Block;
 158:                      dr["Street"] = access.Street;
 159:                      dr["PremisesOld"] = access.PremisesOld;
 160:                      dr["PremisesNew"] = access.PremisesNew;
 161:   
 162:                      dr["PossibleNumberOfTd"] = possibleNumberOfTd;
 163:                      dr["PossibleNumberOfEthernet"] = possibleNumberOfEthernet;
 164:   
 165:                      dt.Rows.Add(dr);
 166:   
 167:                      if (c >= numberOfFirstRowsToTake) break;
 168:                  }
 169:                  else
 170:                  {
 171:   
 172:                  }
 173:              }
 174:   
 175:              return dt;
 176:          }
 177:   
 178:          ////////////////////////////////////////////////////////////////////////////
 179:          ////////////////////////////////////////////////////////////////////////////
 180:      }
 181:   
 182:      ////////////////////////////////////////////////////////////////////////////
 183:      ////////////////////////////////////////////////////////////////////////////
 184:  }