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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Default

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

Defaul general support class for Huawei's Next Generation Network (NGN) data model.

   1:  using System.Collections.Generic;
   2:  using System.Linq;
   3:  using System.Data;
   4:  using System.Data.Entity;
   5:  using System.Reflection;
   6:  using System.IO;
   7:  using System;
   8:  using System.Text;
   9:   
  10:  namespace Ia.Ngn.Cl.Model.Data.Huawei
  11:  {
  12:      ////////////////////////////////////////////////////////////////////////////
  13:   
  14:      /// <summary publish="true">
  15:      /// Defaul general support class for Huawei's Next Generation Network (NGN) data model.
  16:      /// </summary>
  17:      /// 
  18:      /// <remarks> 
  19:      /// Copyright © 2014-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  20:      ///
  21:      /// 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
  22:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  23:      ///
  24:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  25:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  26:      /// 
  27:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  28:      /// 
  29:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  30:      /// </remarks> 
  31:      public partial class Default
  32:      {
  33:          private static string[] list;
  34:          private static List<Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev> mduDevList;
  35:          private static Dictionary<string, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev> mduDictionary;
  36:   
  37:          ////////////////////////////////////////////////////////////////////////////
  38:   
  39:          /// <summary>
  40:          ///
  41:          /// </summary>
  42:          public Default() { }
  43:   
  44:          ////////////////////////////////////////////////////////////////////////////
  45:   
  46:          /// <summary>
  47:          ///
  48:          /// </summary>
  49:          public static Dictionary<string, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev> MduDevDictionary
  50:          {
  51:              get
  52:              {
  53:                  if (mduDictionary == null || mduDictionary.Count == 0)
  54:                  {
  55:                      mduDictionary = new Dictionary<string, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev>();
  56:   
  57:                      foreach (Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mdu in Ia.Ngn.Cl.Model.Data.Huawei.Default.MduDevList)
  58:                      {
  59:                          if (!string.IsNullOrEmpty(mdu.AccessName) && !string.IsNullOrEmpty(mdu.NddOntId))
  60:                          {
  61:                              if (!mduDictionary.ContainsKey(mdu.AccessName))
  62:                              {
  63:                                  mduDictionary[mdu.AccessName] = mdu;
  64:                              }
  65:                              else
  66:                              {
  67:   
  68:                              }
  69:                          }
  70:                          else
  71:                          {
  72:   
  73:                          }
  74:                      }
  75:                  }
  76:   
  77:                  return mduDictionary;
  78:              }
  79:          }
  80:   
  81:          ////////////////////////////////////////////////////////////////////////////
  82:   
  83:          /// <summary>
  84:          ///
  85:          /// </summary>
  86:          public static List<Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev> MduDevList
  87:          {
  88:              get
  89:              {
  90:                  int did;
  91:                  Ia.Ngn.Cl.Model.Business.Huawei.Board.MduDevBoard mduDevBoard;
  92:                  Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mduDev;
  93:                  List<Ia.Ngn.Cl.Model.Huawei.EmsBoard> boardList;
  94:   
  95:                  if (mduDevList == null || mduDevList.Count == 0)
  96:                  {
  97:                      mduDevList = new List<Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev>();
  98:   
  99:                      boardList = Ia.Ngn.Cl.Model.Data.Huawei.Default.BoardListByMA5616OrMA5878DevType();
 100:   
 101:                      foreach (var board in boardList)
 102:                      {
 103:                          did = board.EmsDev.DID;
 104:   
 105:                          mduDev = (from m in mduDevList where m.Did == did select m).SingleOrDefault();
 106:   
 107:                          if (mduDev != null)
 108:                          {
 109:                              mduDevBoard = new Ia.Ngn.Cl.Model.Business.Huawei.Board.MduDevBoard(board.BT, board.BVER, board.FN, board.SN);
 110:                              mduDev.MduDevBoardList.Add(mduDevBoard);
 111:                          }
 112:                          else
 113:                          {
 114:                              mduDev = new Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev(did)
 115:                              {
 116:                                  // ed.DT == "MA5616" && eb.BT == "PSTN" && (eb.BVER.Contains("H838ASRB") 
 117:                                  DevType = board.EmsDev.DT,
 118:                                  DevIp = board.EmsDev.DEVIP
 119:                              };
 120:   
 121:                              mduDev.MduDevBoardList = new List<Ia.Ngn.Cl.Model.Business.Huawei.Board.MduDevBoard>();
 122:                              mduDevBoard = new Ia.Ngn.Cl.Model.Business.Huawei.Board.MduDevBoard(board.BT, board.BVER, board.FN, board.SN);
 123:                              mduDev.MduDevBoardList.Add(mduDevBoard);
 124:   
 125:                              mduDevList.Add(mduDev);
 126:                          }
 127:                      }
 128:                  }
 129:   
 130:                  return mduDevList;
 131:              }
 132:          }
 133:   
 134:          ////////////////////////////////////////////////////////////////////////////
 135:   
 136:          /// <summary>
 137:          ///
 138:          /// </summary>
 139:          public static List<Ia.Ngn.Cl.Model.Huawei.EmsBoard> BoardListByMA5616OrMA5878DevType()
 140:          {
 141:              List<Ia.Ngn.Cl.Model.Huawei.EmsBoard> list;
 142:   
 143:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
 144:              {
 145:                  list = (from ed in db.EmsDevs
 146:                          join eb in db.EmsBoards on ed.Id equals eb.EmsDev.Id
 147:                          where ed.DT == "MA5616" && eb.BT == "PSTN" && (eb.BVER.Contains("H838ASRB") || eb.BVER.Contains("H838ASPB"))
 148:                          || ed.DT == "MA5878" && eb.BT == "PSTN" && eb.BVER.Contains("H848ASNB")
 149:                          select eb).Include(x => x.EmsDev).ToList();
 150:   
 151:                  /*
 152:                  select * from EmsDevs ed
 153:                  left outer join EmsBoards eb on ed.Id = eb.EmsDev_Id
 154:                  where ed.DT='MA5616' and eb.BT = 'PSTN'
 155:                  and (eb.BVER like '%H838ASRB%' or eb.BVER like '%H838ASPB%')
 156:                  and ed.DEV = 'MDU-MAH-1518-004'--'MDU-SDQ-904-001'
 157:                  */
 158:              }
 159:   
 160:              return list;
 161:          }
 162:   
 163:          ////////////////////////////////////////////////////////////////////////////
 164:   
 165:          /// <summary>
 166:          ///
 167:          /// </summary>
 168:          public static List<Ia.Ngn.Cl.Model.Access> AccessListBy5616Or5878OntEquipmentId()
 169:          {
 170:              List<Ia.Ngn.Cl.Model.Access> list;
 171:   
 172:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
 173:              {
 174:                  list = (from a in db.Accesses
 175:                          join eo in db.EmsOnts on a equals eo.Access
 176:                          join ed in db.EmsDevs on eo.NAME equals ed.DEVIP into gj
 177:                          from sgj in gj.DefaultIfEmpty()
 178:                          where eo.EQUIPMENTID == "5616" || eo.EQUIPMENTID == "5878"
 179:                          select a).ToList(); //.Include(x => x.EmsDev).ToList();
 180:                  /*
 181:                  select a.Id, eo.NAME, eo.ALIAS, eo.EQUIPMENTID, ed.DEVIP, ed.DEV from Accesses a
 182:                  inner join EmsOnts eo on a.Id = eo.Access_Id
 183:                  left outer join EmsDevs ed on ed.DEVIP = eo.NAME 
 184:                  where eo.EQUIPMENTID = '5616' or eo.EQUIPMENTID = '5878'
 185:                  */
 186:              }
 187:   
 188:              return list;
 189:          }
 190:   
 191:          ////////////////////////////////////////////////////////////////////////////
 192:   
 193:          /// <summary>
 194:          ///
 195:          /// </summary>
 196:          public static string[] ListOfHuaweiOntThatWereIntiallyInstalledAndProvisionedWithNokiaMgcIp10_16_5_37BeforeNewMgcIpToCableDistributionAgreement
 197:          {
 198:              get
 199:              {
 200:                  if (list == null || list.Length == 0)
 201:                  {
 202:                      list = new string[] { "SAA.501.2","SAA.501.10","SAA.501.11","SAA.501.13","SAA.501.19","SAA.501.20","SAA.501.21","SAA.501.22","SAA.502.1","SAA.502.7","SAA.502.8","SAA.502.11","SAA.502.12","SAA.502.14","SAA.502.16","SAA.502.18","SAA.502.19","SAA.502.22","SAA.503.1","SAA.503.2","SAA.504.4","SAA.504.6","SAA.504.10","SAA.504.11","SAA.504.12","SAA.504.13","SAA.504.15","SAA.504.17","SAA.504.18","SAA.504.24","SAA.505.2","SAA.506.8","SAA.506.10","SAA.506.16","SAA.506.18","SAA.507.16","SAA.508.3","SAA.508.8","SAA.508.16","SAA.508.17","SAA.508.18","SAA.508.20","SAA.508.21","SAA.509.5","SAA.509.7","SAA.509.8","SAA.509.12","SAA.509.13","SAA.509.14","SAA.509.17","SAA.509.19","SAA.509.20","SAA.510.4","SAA.510.5","SAA.510.14","SAA.511.3","SAA.511.4","SAA.511.9","SAA.511.10","SAA.511.13","SAA.511.16","SAA.512.2","SAA.512.13","SAA.512.14","SAA.512.15","SAA.514.1","SAA.514.2","SAA.514.5","SAA.514.6","SAA.514.8","SAA.514.11","SAA.514.12","SAA.514.13","SAA.514.14","SAA.514.15","SAA.514.16","SAA.514.22","SAA.517.7","SAA.517.8","SAA.517.9","SAA.517.10","SAA.517.12","SAA.517.15","SAA.517.16","SAA.518.2","SAA.518.3","SAA.518.5","SAA.518.11","SAA.518.14","SAA.518.16","SAA.519.1","SAA.519.2","SAA.519.6","SAA.519.10","SAA.519.15","SAA.519.16","SAA.519.17","SAA.519.18","SAA.519.23","SAA.521.4","SAA.521.10",
 203:                          "SAA.521.20","SAA.521.23","SAA.522.1","SAA.522.6","SAA.522.9","SAA.522.10","SAA.522.11","SAA.522.13","SAA.522.16","SAA.523.1","SAA.523.2","SAA.523.3","SAA.523.5","SAA.523.7","SAA.523.9","SAA.523.10","SAA.523.12","SAA.523.13","SAA.523.14","SAA.523.15","SAA.523.16","SAA.523.18","SAA.523.19","SAA.524.1","SAA.524.3","SAA.524.6","SAA.524.8","SAA.524.9","SAA.524.10","SAA.524.11","SAA.524.12","SAA.524.14","SAA.524.17","SAA.524.18","SAA.528.3","SAA.528.5","SAA.528.6","SAA.528.7","SAA.528.10","SAA.528.11","SAA.528.15","SAA.528.17","SAA.528.19","SAA.528.20","SAA.528.21","SAA.530.1","SAA.530.5","SAA.530.6","SAA.530.7","SAA.530.8","SAA.530.9","SAA.530.10","SAA.530.11","SAA.530.12","SAA.530.13","SAA.530.16","SAA.530.17","SAA.530.19","SAA.531.1","SAA.531.4","SAA.531.6","SAA.531.7","SAA.531.15","SAA.531.17","SAA.531.19","SAA.531.20","SAA.531.22","SAA.531.23","SAA.533.2","SAA.533.8","SAA.533.9","SAA.533.17","SAA.533.19","SAA.533.20","SAA.533.21","SAA.533.23","SAA.534.1","SAA.534.2","SAA.534.3","SAA.534.4","SAA.534.10","SAA.534.12","SAA.534.18","SAA.534.20","SAA.534.21","SAA.535.1","SAA.535.15","SAA.535.16","SAA.535.17","SAA.535.18",
 204:                          "SAA.536.1","SAA.536.2","SAA.536.3","SAA.536.4","SAA.536.6","SAA.536.9","SAA.536.13","SAA.536.15","SAA.537.1","SAA.537.4","SAA.537.6","SAA.537.7","SAA.537.8","SAA.537.9","SAA.537.10","SAA.537.13","SAA.537.14","SAA.537.15","SAA.537.16","SAA.537.22","SAA.538.1","SAA.538.4","SAA.538.9","SAA.538.10","SAA.538.14","SAA.538.15","SAA.538.17","SAA.538.18","SAA.538.19","SAA.539.2","SAA.539.3","SAA.539.5","SAA.539.6","SAA.539.7","SAA.539.8","SAA.539.9","SAA.539.18","SAA.539.19","SAA.539.20","SAA.541.2","SAA.541.6","SAA.541.7","SAA.541.9","SAA.541.10","SAA.541.13","SAA.541.15","SAA.541.21","SAA.541.23","SAA.541.24","SAA.542.1","SAA.542.3","SAA.542.6","SAA.542.7","SAA.542.8","SAA.542.9","SAA.542.21","SAA.543.5","SAA.543.9","SAA.543.10","SAA.543.16","SAA.544.4","SAA.544.10","SAA.544.11","SAA.544.12","SAA.544.15","SAA.544.22","SAA.544.23","SAA.545.9","SAA.701.1","SAA.701.2","SAA.701.3","SAA.701.4","SAA.701.5","SAA.701.6","SAA.701.7","SAA.701.9","SAA.701.10","SAA.701.11","SAA.701.13","SAA.701.14","SAA.701.15","SAA.701.16","SAA.701.17","SAA.702.1","SAA.702.2","SAA.702.3","SAA.702.4","SAA.702.5","SAA.702.8","SAA.702.9","SAA.702.10","SAA.702.12","SAA.702.14","SAA.702.16","SAA.702.17","SAA.702.21","SAA.702.22","SAA.702.23","SAA.702.24","SAA.703.2","SAA.703.3","SAA.703.11","SAA.703.14","SAA.703.15",
 205:                          "SAA.703.17","SAA.703.19","SAA.703.20","SAA.703.23","SAA.704.3","SAA.704.4","SAA.704.6","SAA.704.7","SAA.704.9","SAA.704.10","SAA.704.13","SAA.704.15","SAA.704.16","SAA.704.17","SAA.704.18","SAA.706.5","SAA.706.6","SAA.706.7","SAA.706.8","SAA.706.11","SAA.706.12","SAA.706.15","SAA.706.16","SAA.706.17","SAA.706.20","SAA.706.21","SAA.706.23","SAA.706.24","SAA.707.2","SAA.707.5","SAA.707.7","SAA.707.10","SAA.707.12","SAA.707.13","SAA.707.15","SAA.707.17","SAA.707.19","SAA.707.20","SAA.707.21","SAA.707.22","SAA.709.1","SAA.709.3","SAA.709.7","SAA.709.8","SAA.709.14","SAA.709.15","SAA.709.18","SAA.709.19","SAA.709.23","SAA.709.24","SAA.710.3","SAA.710.4","SAA.710.12","SAA.710.15","SAA.710.16","SAA.710.19","SAA.710.21","SAA.710.22","SAA.710.24","SAA.711.1","SAA.711.3","SAA.711.5","SAA.711.9","SAA.711.11","SAA.711.12","SAA.711.13","SAA.711.14","SAA.711.16","SAA.711.18","SAA.711.19","SAA.711.20","SAA.711.23","SAA.711.24","SAA.712.2","SAA.712.3","SAA.712.4","SAA.712.6","SAA.712.7","SAA.712.9","SAA.712.12",
 206:                          "SAA.712.16","SAA.712.18","SAA.712.19","SAA.712.20","SAA.712.21","SAA.712.26","SAA.712.27","SAA.714.2","SAA.714.3","SAA.714.8","SAA.714.11","SAA.715.5","SAA.715.7","SAA.715.8","SAA.715.9","SAA.715.10","SAA.715.11","SAA.715.12","SAA.715.15","SAA.715.18","SAA.715.19","SAA.716.2","SAA.716.3","SAA.716.4","SAA.716.6","SAA.716.8","SAA.716.11","SAA.716.12","SAA.716.15","SAA.716.17","SAA.716.20","SAA.716.21","SAA.717.3","SAA.717.5","SAA.717.7","SAA.717.10","SAA.717.13","SAA.717.14","SAA.717.15","SAA.717.18","SAA.717.20","SAA.717.21","SAA.717.22","SAA.718.1","SAA.718.2","SAA.718.3","SAA.718.5","SAA.718.6","SAA.718.7","SAA.718.11","SAA.718.22","SAA.718.23","SAA.718.24","SAA.718.25","SAA.719.2","SAA.719.4","SAA.719.8","SAA.719.9","SAA.719.10","SAA.719.11","SAA.719.12","SAA.719.14","SAA.719.17","SAA.719.20","SAA.719.23","SAA.720.3","SAA.720.4","SAA.720.6","SAA.720.7","SAA.720.10","SAA.720.13","SAA.720.14","SAA.721.2","SAA.721.3","SAA.721.4","SAA.721.7","SAA.721.8","SAA.721.10","SAA.721.11","SAA.721.12","SAA.721.13","SAA.721.14","SAA.721.18","SAA.721.19","SAA.721.20","SAA.721.23","SAA.722.11","SAA.722.12","SAA.722.13","SAA.722.16","SAA.722.17","SAA.722.18","SAA.722.19","SAA.722.22","SAA.722.24","SAA.723.2","SAA.723.3","SAA.723.4","SAA.723.7","SAA.723.9","SAA.723.13","SAA.723.15","SAA.723.17",
 207:                          "SAA.723.19","SAA.723.20","SAA.723.22","SAA.723.23","SAA.724.5","SAA.724.6","SAA.724.8","SAA.724.11","SAA.724.14","SAA.724.15","SAA.724.16","SAA.724.17","SAA.724.18","SAA.726.2","SAA.726.7","SAA.726.8","SAA.726.9","SAA.726.10","SAA.726.11","SAA.726.12","SAA.726.13","SAA.726.14","SAA.726.17","SAA.726.20","SAA.726.21","SAA.726.22","SAA.726.23","SAA.729.2","SAA.729.3","SAA.729.4","SAA.729.5","SAA.729.6","SAA.729.10","SAA.729.11","SAA.729.14","SAA.729.17","SAA.729.18","SAA.729.19","SAA.729.20","SAA.729.21","SAA.730.4","SAA.730.5","SAA.730.8","SAA.730.9","SAA.730.11","SAA.730.12","SAA.730.13","SAA.730.14","SAA.730.22","SAA.733.2","SAA.733.3","SAA.733.5","SAA.733.6","SAA.733.9","SAA.733.10","SAA.734.1","SAA.734.2","SAA.734.3","SAA.734.4","SAA.734.5","SAA.734.6","SAA.734.7","SAA.734.11","SAA.734.12","SAA.734.13","SAA.734.15","SAA.734.17","SAA.734.19","SAA.734.20","SAA.735.7","SAA.735.8","SAA.735.10","SAA.735.12","SAA.735.14","SAA.735.19","SAA.735.22","SAA.736.3","SAA.736.4","SAA.736.7","SAA.736.8","SAA.736.9","SAA.736.10","SAA.736.17","SAA.736.18","SAA.736.21","SAA.736.22","SAA.736.23","SAA.737.5","SAA.737.6","SAA.737.8",
 208:                          "SAA.737.11","SAA.737.13","SAA.737.15","SAA.737.16","SAA.737.18","SAA.738.4","SAA.738.7","SAA.738.8","SAA.738.11","SAA.738.13","SAA.738.14","SAA.738.16","SAA.738.18","SAA.739.1","SAA.739.2","SAA.739.3","SAA.739.13","SAA.739.14","SAA.739.15","SAA.739.18","SAA.739.19","SAA.739.20","SAA.740.7","SAA.740.20","SAA.742.2","SAA.742.3","SAA.742.5","SAA.742.6","SAA.742.7","SAA.742.11","SAA.742.12","SAA.742.14","SAA.742.15","SAA.742.17","SAA.742.18","SAA.742.20","SAA.742.21","SAA.742.23","SAA.742.25","SAA.743.4","SAA.743.7","SAA.743.9","SAA.743.10","SAA.743.13","SAA.743.16","SAA.743.19","SAA.743.21","SAA.743.22","SAA.743.23","SAA.743.24","SAA.744.5","SAA.744.6","SAA.744.7","SAA.744.22","SAA.745.12","SAA.746.12","SAA.747.2","SAA.747.4","SAA.750.1","SAA.750.6","SAA.750.7","SAA.750.12","SAA.750.16","SAA.750.19","SAA.750.20","SAA.750.26","SAA.751.1","SAA.751.2","SAA.751.3","SAA.751.7","SAA.751.8","SAA.751.13","SAA.751.16","SAA.751.17","SAA.751.18","SAA.751.22","SAA.752.1","SAA.752.3","SAA.752.5","SAA.752.11","SAA.752.13","SAA.752.14","SAA.752.15","SAA.752.17","SAA.752.18","SAA.752.21","SAA.802.6","SAA.802.8","SAA.802.10","SAA.802.11","SAA.802.12","SAA.802.13","SAA.802.16","SAA.802.17","SAA.802.20","SAA.804.3","SAA.804.4","SAA.804.5","SAA.804.6","SAA.804.11","SAA.805.21","SAA.806.24","SAA.807.1",
 209:                          "SAA.807.7","SAA.807.16","SAA.807.17","SAA.807.20","SAA.808.2","SAA.808.4","SAA.808.5","SAA.808.8","SAA.808.9","SAA.808.13","SAA.811.3","SAA.813.1","SAA.813.3","SAA.813.4","SAA.813.5","SAA.813.10","SAA.813.12","SAA.813.15","SAA.813.16","SAA.814.2","SAA.814.3","SAA.814.5","SAA.814.9","SAA.814.11","SAA.814.16","SAA.814.18","SAA.814.19","SAA.814.23","SAA.814.24","SAA.815.1","SAA.815.2","SAA.815.7","SAA.815.9","SAA.815.10","SAA.815.11","SAA.815.12","SAA.815.13","SAA.815.14","SAA.815.15","SAA.815.16","SAA.815.18","SAA.815.19","SAA.815.20","SAA.815.21","SAA.815.26","SAA.819.1","SAA.819.2","SAA.819.4","SAA.819.5","SAA.819.6","SAA.819.8","SAA.819.13","SAA.819.17","SAA.822.9","SAA.826.18","SAA.827.13","SAA.827.14","SAA.837.21","SAA.846.4","SAA.846.10"
 210:                      };
 211:                  }
 212:   
 213:                  return list;
 214:              }
 215:          }
 216:   
 217:          ////////////////////////////////////////////////////////////////////////////
 218:          ////////////////////////////////////////////////////////////////////////////   
 219:      }
 220:   
 221:      ////////////////////////////////////////////////////////////////////////////
 222:      ////////////////////////////////////////////////////////////////////////////   
 223:  }