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

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), Internet 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 Access() { }
  30:   
  31:          ////////////////////////////////////////////////////////////////////////////
  32:   
  33:          /// <summary>
  34:          ///
  35:          /// </summary>
  36:          public static DataTable ReadListWithOntListProvisionedAndReadyButDoNotExistInCustomerDepartmentDatabaseDataTable()
  37:          {
  38:              return ReadListWithOntListProvisionedAndReadyButDoNotExistInCustomerDepartmentDatabaseDataTable(99999);
  39:          }
  40:   
  41:          ////////////////////////////////////////////////////////////////////////////
  42:   
  43:          /// <summary>
  44:          ///
  45:          /// </summary>
  46:          public static DataTable ReadListWithOntListProvisionedAndReadyButDoNotExistInCustomerDepartmentDatabaseDataTable(int numberOfFirstRowsToTake)
  47:          {
  48:              bool familyExists;
  49:              int c, possibleNumberOfTd, possibleNumberOfEthernet;
  50:              string /*accessId, ponNumber, ontNumber,*/ areaSymbol, areaName, accessOntFamilyTypeCapacityString;
  51:              DataRow dr;
  52:              DataTable dt;
  53:              List<Ia.Ngn.Cl.Model.Access> accessList;
  54:              Ia.Ngn.Cl.Model.Business.Service.KuwaitNgnArea kuwaitNgnArea;
  55:   
  56:              familyExists = false;
  57:              c = 0;
  58:              possibleNumberOfTd = possibleNumberOfEthernet = 0;
  59:   
  60:              dt = new DataTable("");
  61:              dt.Columns.Add("Id");
  62:              dt.Columns.Add("Pon");
  63:              dt.Columns.Add("Ont");
  64:              dt.Columns.Add("Name");
  65:              dt.Columns.Add("FamilyType");
  66:              dt.Columns.Add("AreaSymbol");
  67:              dt.Columns.Add("Area");
  68:              dt.Columns.Add("Block");
  69:              dt.Columns.Add("Street");
  70:              dt.Columns.Add("PremisesOld");
  71:              dt.Columns.Add("PremisesNew");
  72:              dt.Columns.Add("Paci");
  73:              dt.Columns.Add("Note");
  74:              dt.Columns.Add("PossibleNumberOfTd");
  75:              dt.Columns.Add("PossibleNumberOfEthernet");
  76:   
  77:              accessList = Ia.Ngn.Cl.Model.Data.Access.ListOfAccessesWithProvisionedAndReadyOntsAndEmsOntsButDoNotExistInCustomerDepartmentDatabase();
  78:   
  79:              accessList = accessList.OrderByDescending(a => a.Created).ToList();
  80:   
  81:              foreach (Ia.Ngn.Cl.Model.Access access in accessList)
  82:              {
  83:                  familyExists = false;
  84:                  possibleNumberOfTd = possibleNumberOfEthernet = 0;
  85:   
  86:                  if (access.Onts != null && access.Onts.Count > 0)
  87:                  {
  88:                      accessOntFamilyTypeCapacityString = Ia.Ngn.Cl.Model.Data.Nokia.Ont.FamilyTypeFromId(access.Onts.FirstOrDefault().FamilyTypeId);
  89:   
  90:                      possibleNumberOfTd = Ia.Ngn.Cl.Model.Business.Nokia.Ams.PossibleNumberOfTdForOntFamilyType(access.Onts.FirstOrDefault().FamilyTypeId);
  91:                      possibleNumberOfEthernet = Ia.Ngn.Cl.Model.Business.Nokia.Ams.PossibleNumberOfHsiCardPortServiceConfigurationForOntFamilyType(access.Onts.FirstOrDefault().FamilyTypeId);
  92:   
  93:                      accessOntFamilyTypeCapacityString += " (" + possibleNumberOfTd + ")";
  94:   
  95:                      familyExists = true;
  96:                  }
  97:                  else if (access.EmsOnts != null && access.EmsOnts.Count > 0)
  98:                  {
  99:                      accessOntFamilyTypeCapacityString = Ia.Ngn.Cl.Model.Business.Huawei.Ont.FamilyTypeStringFromEquipmentType(access.EmsOnts.FirstOrDefault().EquipmentType);
 100:   
 101:                      possibleNumberOfTd = Ia.Ngn.Cl.Model.Business.Huawei.Ems.PossibleNumberOfTdForOntEquipmentType(access.EmsOnts.FirstOrDefault().EquipmentType);
 102:                      possibleNumberOfEthernet = Ia.Ngn.Cl.Model.Business.Huawei.Ems.PossibleNumberOfHsiServiceForOntEquipmentType(access.EmsOnts.FirstOrDefault().EquipmentType);
 103:   
 104:                      accessOntFamilyTypeCapacityString += " (" + possibleNumberOfTd + ")";
 105:   
 106:                      familyExists = true;
 107:                  }
 108:                  else accessOntFamilyTypeCapacityString = "";
 109:   
 110:                  if (familyExists)
 111:                  {
 112:                      c++;
 113:   
 114:                      dr = dt.NewRow();
 115:   
 116:                      dr["Id"] = access.Id;
 117:                      dr["Pon"] = access.Pon;
 118:                      dr["Ont"] = access.Ont;
 119:                      dr["Name"] = access.Name;
 120:                      dr["Paci"] = access.Paci;
 121:                      dr["Note"] = access.Note;
 122:   
 123:                      dr["FamilyType"] = accessOntFamilyTypeCapacityString;
 124:   
 125:                      kuwaitNgnArea = (from kna in Ia.Ngn.Cl.Model.Data.Service.KuwaitNgnAreaList where kna.Id == access.AreaId select kna).SingleOrDefault();
 126:   
 127:                      areaName = kuwaitNgnArea.Name;
 128:                      areaSymbol = kuwaitNgnArea.Symbol;
 129:   
 130:                      dr["AreaSymbol"] = areaSymbol;
 131:                      dr["Area"] = areaName;
 132:   
 133:                      dr["Block"] = access.Block;
 134:                      dr["Street"] = access.Street;
 135:                      dr["PremisesOld"] = access.PremisesOld;
 136:                      dr["PremisesNew"] = access.PremisesNew;
 137:   
 138:                      dr["PossibleNumberOfTd"] = possibleNumberOfTd;
 139:                      dr["PossibleNumberOfEthernet"] = possibleNumberOfEthernet;
 140:   
 141:                      dt.Rows.Add(dr);
 142:   
 143:                      if (c >= numberOfFirstRowsToTake) break;
 144:                  }
 145:                  else
 146:                  {
 147:   
 148:                  }
 149:              }
 150:   
 151:              return dt;
 152:          }
 153:   
 154:          ////////////////////////////////////////////////////////////////////////////
 155:          ////////////////////////////////////////////////////////////////////////////
 156:      }
 157:   
 158:      ////////////////////////////////////////////////////////////////////////////
 159:      ////////////////////////////////////////////////////////////////////////////
 160:  }