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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Ems

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

Access Management System (AMS) support class for Huawei's Optical Fiber Network (OFN) data model.

   1:  using Ia.Ngn.Cl.Model.Huawei;
   2:  using Microsoft.EntityFrameworkCore;
   3:  using System;
   4:  using System.Collections.Generic;
   5:  using System.Data;
   6:  using System.Linq;
   7:   
   8:  namespace Ia.Ngn.Cl.Model.Data.Huawei
   9:  {
  10:      ////////////////////////////////////////////////////////////////////////////
  11:   
  12:      /// <summary publish="true">
  13:      /// Access Management System (AMS) support class for Huawei's Optical Fiber Network (OFN) data model.
  14:      /// </summary>
  15:   
  16:      /// <remarks> 
  17:      /// Copyright © 2016-2022 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
  18:      ///
  19:      /// 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
  20:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  21:      ///
  22:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  23:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  24:      /// 
  25:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  26:      /// 
  27:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  28:      /// </remarks> 
  29:      public class Ems
  30:      {
  31:          private static Dictionary<string, string> correlationTagDictionary = new Dictionary<string, string>(1000);
  32:   
  33:          /// <summary/>
  34:          public static Dictionary<string, string> CorrelationTagDictionary { get { return correlationTagDictionary; } set { correlationTagDictionary = value; } }
  35:   
  36:          ////////////////////////////////////////////////////////////////////////////
  37:   
  38:          /// <summary>
  39:          ///
  40:          /// </summary>
  41:          public Ems() { }
  42:   
  43:          ////////////////////////////////////////////////////////////////////////////
  44:   
  45:          /// <summary>
  46:          ///
  47:          /// </summary>
  48:          public static string BellcoreStateFromId(int stateId)
  49:          {
  50:              // see: ColoredBellcoreStateFromId()
  51:              string s;
  52:              Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState bellcoreState;
  53:   
  54:              bellcoreState = (Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState)stateId;
  55:   
  56:              /*
  57:               * IS-NR: (In-Service and Normal) The entity is fully operational and will perform as provisioned.
  58:               * OOS-AU: (Out-of-Service and Autonomous) The entity is not operational because of an autonomous event.
  59:               * OOS-AUMA: (Out-of-Service and Autonomous Management) The entity is not operational because of an autonomous event and has also been manually removed from service.
  60:               * OOS-MA: (Out-of-Service and Management) The entity has been manually removed from service.
  61:               */
  62:   
  63:              switch (bellcoreState)
  64:              {
  65:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.IsNr: s = "IS-NR"; break;
  66:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.OosAu: s = "OOS-AU"; break;
  67:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.OosAuma: s = "OOS-AUMA"; break;
  68:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.OosMa: s = "OOS-MA"; break;
  69:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.Unknown: s = "Unknown"; break;
  70:                  default: s = "Unknown"; break;
  71:              }
  72:   
  73:              return s;
  74:          }
  75:   
  76:          ////////////////////////////////////////////////////////////////////////////
  77:   
  78:          /// <summary>
  79:          ///
  80:          /// </summary>
  81:          public static string ColoredBellcoreStateFromId(int stateId)
  82:          {
  83:              // see: BellcoreStateFromId()
  84:              string s;
  85:              Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState bellcoreState;
  86:   
  87:              bellcoreState = (Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState)stateId;
  88:   
  89:              /*
  90:                  if (b) s = "<span style=\"color:Green\">Active</span>";
  91:                  else s = "<span style=\"color:DarkGoldenRod\">Idle</span>";             */
  92:              switch (bellcoreState)
  93:              {
  94:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.IsNr: s = "<span style=\"color:Green\">IS-NR</span>"; break;
  95:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.OosAu: s = "<span style=\"color:Red\">OOS-AU</span>"; break;
  96:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.OosAuma: s = "<span style=\"color:Red\">OOS-AUMA</span>"; break;
  97:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.OosMa: s = "<span style=\"color:Red\">OOS-MA</span>"; break;
  98:                  case Ia.Ngn.Cl.Model.Business.Huawei.Ems.BellcoreState.Unknown: s = "<span style=\"color:Red\">Unknown</span>"; break;
  99:                  default: s = "Unknown"; break;
 100:              }
 101:   
 102:              return s;
 103:          }
 104:   
 105:          ////////////////////////////////////////////////////////////////////////////
 106:   
 107:          /// <summary>
 108:          ///
 109:          /// </summary>
 110:          public static int NextVacantTelForOnt(Ia.Ngn.Cl.Model.Huawei.EmsOnt emsOnt)
 111:          {
 112:              int telPort;
 113:              List<int> list;
 114:   
 115:              list = Ia.Ngn.Cl.Model.Data.Huawei.Ems.UsedTelListForEmsOntId(emsOnt.Id);
 116:   
 117:              if (list.Count == 0) telPort = 1; // this means OntSipInfo does not exist for any number and the box is empty, and we should create number at 1
 118:              else
 119:              {
 120:                  list = Ia.Cl.Model.Default.ExcludedNumberListFromNumberListWithinRange(list, emsOnt.EquipmentType.TelPorts);
 121:   
 122:                  if (list.Count > 0) telPort = list[0];
 123:                  else telPort = Ia.Ngn.Cl.Model.Business.Default.PortUndefinedOrInvalidOrUnknown; // something went wrong
 124:              }
 125:   
 126:              return telPort;
 127:          }
 128:   
 129:          ////////////////////////////////////////////////////////////////////////////
 130:   
 131:          /// <summary>
 132:          ///
 133:          /// </summary>
 134:          private static List<int> UsedTelListForEmsOntId(string emsOntId)
 135:          {
 136:              List<int> list;
 137:   
 138:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
 139:              {
 140:                  list = (from eosi in db.EmsOntSipInfoes
 141:                          where eosi.EmsOnt.Id == emsOntId
 142:                          orderby eosi.TEL ascending
 143:                          select eosi.TEL).ToList<int>();
 144:              }
 145:   
 146:              return list;
 147:          }
 148:   
 149:          ////////////////////////////////////////////////////////////////////////////
 150:   
 151:          /// <summary>
 152:          ///
 153:          /// </summary>
 154:          public static List<int> VacantTelForOntList(Ia.Ngn.Cl.Model.Huawei.EmsOnt emsOnt)
 155:          {
 156:              List<int> usedlist, vacantList;
 157:   
 158:              usedlist = Ia.Ngn.Cl.Model.Data.Huawei.Ems.UsedTelListForEmsOntId(emsOnt.Id);
 159:   
 160:              vacantList = Ia.Cl.Model.Default.ExcludedNumberListFromNumberListWithinRange(usedlist, emsOnt.EquipmentType.TelPorts);
 161:   
 162:              return vacantList;
 163:          }
 164:   
 165:          ////////////////////////////////////////////////////////////////////////////
 166:          ////////////////////////////////////////////////////////////////////////////
 167:   
 168:          /// <summary>
 169:          ///
 170:          /// </summary>
 171:          public static Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort NextVacantMduFnSnPnForOnt(Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mdu, Ia.Ngn.Cl.Model.Huawei.EmsOnt emsOnt)
 172:          {
 173:              Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort fnSnPnPort;
 174:              List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> usedList, possibleList, list;
 175:   
 176:              usedList = Ia.Ngn.Cl.Model.Data.Huawei.Ems.UsedEmsVoipPstnUserFnSnPnListForEmsOntId(emsOnt.Id);
 177:   
 178:              if (usedList.Count == 0)
 179:              {
 180:                  fnSnPnPort = mdu.PossibleFnSnPnPortList[0]; // this means EmsVoipPstnUsers does not exist for any number and the box is empty, and we should create number at 0
 181:              }
 182:              else
 183:              {
 184:                  possibleList = mdu.PossibleFnSnPnPortList;
 185:   
 186:                  list = possibleList.Where(p => !usedList.Any(u => u.Fn == p.Fn && u.Sn == p.Sn && u.Pn == p.Pn)).ToList();
 187:   
 188:                  if (list.Count > 0) fnSnPnPort = list[0];
 189:                  else fnSnPnPort = null; // something went wrong
 190:              }
 191:   
 192:              return fnSnPnPort;
 193:          }
 194:   
 195:          ////////////////////////////////////////////////////////////////////////////
 196:   
 197:          /// <summary>
 198:          ///
 199:          /// </summary>
 200:          public static List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> VacantMduFnSnPnForOntList(Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mdu, Ia.Ngn.Cl.Model.Huawei.EmsOnt emsOnt)
 201:          {
 202:              List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> usedList, possibleList, vacantlist;
 203:   
 204:              usedList = Ia.Ngn.Cl.Model.Data.Huawei.Ems.UsedEmsVoipPstnUserFnSnPnListForEmsOntId(emsOnt.Id);
 205:   
 206:              possibleList = mdu.PossibleFnSnPnPortList;
 207:   
 208:              vacantlist = possibleList.Where(p => !usedList.Any(u => u.Fn == p.Fn && u.Sn == p.Sn && u.Pn == p.Pn)).ToList();
 209:   
 210:              return vacantlist;
 211:          }
 212:   
 213:          ////////////////////////////////////////////////////////////////////////////
 214:   
 215:          /// <summary>
 216:          ///
 217:          /// </summary>
 218:          private static List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> UsedEmsVoipPstnUserFnSnPnListForEmsOntId(string emsOntId)
 219:          {
 220:              List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> list;
 221:   
 222:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
 223:              {
 224:                  list = (from evpu in db.EmsVoipPstnUsers
 225:                          where evpu.EmsOnt != null && evpu.EmsOnt.Id == emsOntId
 226:                          // below select will produce "Exception: System.NotSupportedException: Only parameterless constructors and initializers are supported in LINQ to Entities."
 227:                          // select new Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort(evpu.FN, evpu.SN, evpu.PN)).ToList<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort>();
 228:                          select new Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort { Fn = evpu.FN, Sn = evpu.SN, Pn = evpu.PN }).AsNoTracking().ToList<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort>();
 229:              }
 230:   
 231:              return list;
 232:          }
 233:   
 234:          ////////////////////////////////////////////////////////////////////////////
 235:          ////////////////////////////////////////////////////////////////////////////
 236:   
 237:          /// <summary>
 238:          ///
 239:          /// </summary>
 240:          public static Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort NextVacantMsanFnSnPnForMsanDev(Ia.Ngn.Cl.Model.Business.Huawei.Dev.MsanDev msanDev)
 241:          {
 242:              Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort fnSnPn;
 243:              List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> usedList, possibleList, list;
 244:   
 245:              usedList = Ia.Ngn.Cl.Model.Data.Huawei.Ems.UsedEmsVoipPstnUserFnSnPnListForMsanDevDid(msanDev.Did);
 246:   
 247:              if (usedList.Count == 0)
 248:              {
 249:                  fnSnPn = msanDev.PossibleFnSnPnList[0]; // this means EmsVoipPstnUsers does not exist for any number and the box is empty, and we should create number at 0
 250:              }
 251:              else
 252:              {
 253:                  possibleList = msanDev.PossibleFnSnPnList;
 254:   
 255:                  list = possibleList.Where(p => !usedList.Any(u => u.Fn == p.Fn && u.Sn == p.Sn && u.Pn == p.Pn)).ToList();
 256:   
 257:                  if (list.Count > 0) fnSnPn = list[0];
 258:                  else fnSnPn = null; // something went wrong
 259:              }
 260:   
 261:              return fnSnPn;
 262:          }
 263:   
 264:          ////////////////////////////////////////////////////////////////////////////
 265:   
 266:          /// <summary>
 267:          ///
 268:          /// </summary>
 269:          public static List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> VacantMsanFnSnPnListForMsanDev(Ia.Ngn.Cl.Model.Business.Huawei.Dev.MsanDev msanDev)
 270:          {
 271:              List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> usedList, possibleList, vacantlist;
 272:   
 273:              usedList = Ia.Ngn.Cl.Model.Data.Huawei.Ems.UsedEmsVoipPstnUserFnSnPnListForMsanDevDid(msanDev.Did);
 274:   
 275:              possibleList = msanDev.PossibleFnSnPnList;
 276:   
 277:              vacantlist = possibleList.Where(p => !usedList.Any(u => u.Fn == p.Fn && u.Sn == p.Sn && u.Pn == p.Pn)).ToList();
 278:   
 279:              return vacantlist;
 280:          }
 281:   
 282:          ////////////////////////////////////////////////////////////////////////////
 283:   
 284:          /// <summary>
 285:          ///
 286:          /// </summary>
 287:          private static List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> UsedEmsVoipPstnUserFnSnPnListForMsanDevDid(int msanDevDid)
 288:          {
 289:              List<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort> list;
 290:   
 291:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
 292:              {
 293:                  list = (from evpu in db.EmsVoipPstnUsers
 294:                          where evpu.EmsOnt == null && evpu.DID == msanDevDid
 295:                          select new Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort
 296:                          {
 297:                              Fn = evpu.FN,
 298:                              Sn = evpu.SN,
 299:                              Pn = evpu.PN
 300:                          }).AsNoTracking().ToList<Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPnPort>();
 301:              }
 302:   
 303:              return list;
 304:          }
 305:   
 306:          ////////////////////////////////////////////////////////////////////////////
 307:          ////////////////////////////////////////////////////////////////////////////
 308:   
 309:          /// <summary>
 310:          ///
 311:          /// </summary>
 312:          public static string SendReadDevListByDt(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, string devType)
 313:          {
 314:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadDevListByDtCommand(devType);
 315:   
 316:              ems.SendQueue.Enqueue(command);
 317:   
 318:              return command;
 319:          }
 320:   
 321:          ////////////////////////////////////////////////////////////////////////////
 322:   
 323:          /// <summary>
 324:          ///
 325:          /// </summary>
 326:          public static string SendReadDevListByDev(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, string dev)
 327:          {
 328:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadDevListByDevCommand(dev);
 329:   
 330:              ems.SendQueue.Enqueue(command);
 331:   
 332:              return command;
 333:          }
 334:   
 335:          ////////////////////////////////////////////////////////////////////////////
 336:   
 337:          /// <summary>
 338:          ///
 339:          /// </summary>
 340:          public static string SendSaveDev(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Huawei.EmsDev emsDev)
 341:          {
 342:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.SaveDevCommand(emsDev.DEV);
 343:   
 344:              ems.SendQueue.Enqueue(command);
 345:   
 346:              return command;
 347:          }
 348:   
 349:          ////////////////////////////////////////////////////////////////////////////
 350:   
 351:          /// <summary>
 352:          ///
 353:          /// </summary>
 354:          public static string SendSaveDev(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mduDev)
 355:          {
 356:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.SaveDevCommand(mduDev);
 357:   
 358:              ems.SendQueue.Enqueue(command);
 359:   
 360:              return command;
 361:          }
 362:   
 363:          ////////////////////////////////////////////////////////////////////////////
 364:   
 365:          /// <summary>
 366:          ///
 367:          /// </summary>
 368:          public static string SendSaveDev(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MsanDev msanDev)
 369:          {
 370:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.SaveDevCommand(msanDev);
 371:   
 372:              ems.SendQueue.Enqueue(command);
 373:   
 374:              return command;
 375:          }
 376:   
 377:          ////////////////////////////////////////////////////////////////////////////
 378:   
 379:          /// <summary>
 380:          ///
 381:          /// </summary>
 382:          public static string SendSaveDev(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, string dev)
 383:          {
 384:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.SaveDevCommand(dev);
 385:   
 386:              ems.SendQueue.Enqueue(command);
 387:   
 388:              return command;
 389:          }
 390:   
 391:          ////////////////////////////////////////////////////////////////////////////
 392:          ////////////////////////////////////////////////////////////////////////////
 393:   
 394:          /// <summary>
 395:          ///
 396:          /// </summary>
 397:          public static string SendReadBoardList(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, string dev)
 398:          {
 399:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadBoardListCommand(dev);
 400:   
 401:              ems.SendQueue.Enqueue(command);
 402:   
 403:              return command;
 404:          }
 405:   
 406:          ////////////////////////////////////////////////////////////////////////////
 407:   
 408:          /// <summary>
 409:          ///
 410:          /// </summary>
 411:          public static string SendReadOntList(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, int did)
 412:          {
 413:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadOntListCommand(did);
 414:   
 415:              ems.SendQueue.Enqueue(command);
 416:   
 417:              return command;
 418:          }
 419:   
 420:          ////////////////////////////////////////////////////////////////////////////
 421:   
 422:          /// <summary>
 423:          ///
 424:          /// </summary>
 425:          public static string SendReadOnt(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont ont)
 426:          {
 427:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadOntCommand(ont);
 428:   
 429:              ems.SendQueue.Enqueue(command);
 430:   
 431:              return command;
 432:          }
 433:   
 434:          ////////////////////////////////////////////////////////////////////////////
 435:   
 436:          /// <summary>
 437:          ///
 438:          /// </summary>
 439:          public static string SendUpdateOntFromH248ToSip(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont ont)
 440:          {
 441:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.UpdateOntFromH248ToSipCommand(ont);
 442:   
 443:              ems.SendQueue.Enqueue(command);
 444:   
 445:              return command;
 446:          }
 447:   
 448:          ////////////////////////////////////////////////////////////////////////////
 449:          ////////////////////////////////////////////////////////////////////////////
 450:   
 451:          /// <summary>
 452:          ///
 453:          /// </summary>
 454:          public static string SendReadPortList(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, string dev, int fn, int sn)
 455:          {
 456:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadPortListCommand(dev, fn, sn);
 457:   
 458:              ems.SendQueue.Enqueue(command);
 459:   
 460:              return command;
 461:          }
 462:   
 463:          ////////////////////////////////////////////////////////////////////////////
 464:          ////////////////////////////////////////////////////////////////////////////
 465:   
 466:          /// <summary>
 467:          ///
 468:          /// </summary>
 469:          public static string SendCreateOntSipInfo(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string service, int telPort)
 470:          {
 471:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.CreateOrModifyOntSipInfoCommand(nddOnt, service, telPort);
 472:   
 473:              ems.SendQueue.Enqueue(command);
 474:   
 475:              return command;
 476:          }
 477:   
 478:          ////////////////////////////////////////////////////////////////////////////
 479:   
 480:          /// <summary>
 481:          ///
 482:          /// </summary>
 483:          public static string SendReadOntSipInfo(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt)
 484:          {
 485:              return Ia.Ngn.Cl.Model.Data.Huawei.Ems.SendReadOntSipInfo(ems, nddOnt, false);
 486:          }
 487:   
 488:          ////////////////////////////////////////////////////////////////////////////
 489:   
 490:          /// <summary>
 491:          ///
 492:          /// </summary>
 493:          public static string SendReadOntSipInfo(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, bool sendReadOntSipInfoCommandAgainAfterNSeconds)
 494:          {
 495:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadOntSipInfoCommand(nddOnt);
 496:   
 497:              ems.SendQueue.Enqueue(command);
 498:   
 499:              if (sendReadOntSipInfoCommandAgainAfterNSeconds)
 500:              {
 501:                  var command2 = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadOntSipInfoCommand(nddOnt);
 502:   
 503:                  ems.OntSipInfoCommandAgainAfterNSecondsToDateTimeDictionary[command2] = DateTime.UtcNow.AddHours(3);
 504:              }
 505:   
 506:              return command;
 507:          }
 508:   
 509:          ////////////////////////////////////////////////////////////////////////////
 510:   
 511:          /// <summary>
 512:          ///
 513:          /// </summary>
 514:          public static string SendVacateOntSipInfo(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string service, int telPort)
 515:          {
 516:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.VacateOntSipInfoCommand(nddOnt, service, telPort);
 517:   
 518:              ems.SendQueue.Enqueue(command);
 519:   
 520:              return command;
 521:          }
 522:   
 523:          ////////////////////////////////////////////////////////////////////////////
 524:          ////////////////////////////////////////////////////////////////////////////
 525:   
 526:          /// <summary>
 527:          ///
 528:          /// </summary>
 529:          public static string SendResetOnt(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt)
 530:          {
 531:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ResetOntCommand(nddOnt);
 532:   
 533:              ems.SendQueue.Enqueue(command);
 534:   
 535:              return command;
 536:          }
 537:   
 538:          ////////////////////////////////////////////////////////////////////////////
 539:          ////////////////////////////////////////////////////////////////////////////
 540:   
 541:          /// <summary>
 542:          ///
 543:          /// </summary>
 544:          public static string SendCreateVoipPstnUser(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mduDev, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string service, int sn, int port)
 545:          {
 546:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.CreateOrModifyVoipPstnUserCommand(mduDev, nddOnt, service, sn, port);
 547:   
 548:              ems.SendQueue.Enqueue(command);
 549:   
 550:              return command;
 551:          }
 552:   
 553:          ////////////////////////////////////////////////////////////////////////////
 554:   
 555:          /// <summary>
 556:          ///
 557:          /// </summary>
 558:          public static string SendCreateMsanVoipPstnUser(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MsanDev msanDev, int fn, int sn, int pn, string service)
 559:          {
 560:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.CreateOrModifyMsanVoipPstnUserCommand(msanDev, fn, sn, pn, service);
 561:   
 562:              ems.SendQueue.Enqueue(command);
 563:   
 564:              return command;
 565:          }
 566:   
 567:          ////////////////////////////////////////////////////////////////////////////
 568:   
 569:          /// <summary>
 570:          ///
 571:          /// </summary>
 572:          public static string SendReadVoipPstnUser(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, string dev, int sn, int pn)
 573:          {
 574:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadVoipPstnUserCommand(dev, sn, pn);
 575:   
 576:              ems.SendQueue.Enqueue(command);
 577:   
 578:              return command;
 579:          }
 580:   
 581:          ////////////////////////////////////////////////////////////////////////////
 582:   
 583:          /// <summary>
 584:          ///
 585:          /// </summary>
 586:          public static string SendReadVoipPstnUser(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, string service)
 587:          {
 588:              var list = Ia.Ngn.Cl.Model.Business.Huawei.Ems.EmsCommandsToRetriveOntNetworkElementDataByService(service);
 589:   
 590:              foreach (string s in list) ems.SendQueue.Enqueue(s);
 591:   
 592:              return string.Join(", ", list);
 593:          }
 594:   
 595:          ////////////////////////////////////////////////////////////////////////////
 596:   
 597:          /// <summary>
 598:          ///
 599:          /// </summary>
 600:          public static string SendDeleteVoipPstnUser(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mduDev, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string service, int sn, int telPort)
 601:          {
 602:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.DeleteVoipPstnUserCommand(mduDev, nddOnt, service, sn, telPort);
 603:   
 604:              ems.SendQueue.Enqueue(command);
 605:   
 606:              return command;
 607:          }
 608:   
 609:          ////////////////////////////////////////////////////////////////////////////
 610:   
 611:          /// <summary>
 612:          ///
 613:          /// </summary>
 614:          public static string SendDeleteVoipPstnUser(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, string dev, int fn, int sn, int pn)
 615:          {
 616:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.DeleteVoipPstnUserCommand(dev, fn, sn, pn);
 617:   
 618:              ems.SendQueue.Enqueue(command);
 619:   
 620:              return command;
 621:          }
 622:   
 623:          ////////////////////////////////////////////////////////////////////////////
 624:          ////////////////////////////////////////////////////////////////////////////
 625:   
 626:          /// <summary>
 627:          ///
 628:          /// </summary>
 629:          public static string SendCreateVoipPstnAccount(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mduDev, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string service, int sn, int telPort)
 630:          {
 631:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.CreateOrModifyVoipPstnAccountCommand(mduDev, nddOnt, service, sn, telPort);
 632:   
 633:              ems.SendQueue.Enqueue(command);
 634:   
 635:              return command;
 636:          }
 637:   
 638:          ////////////////////////////////////////////////////////////////////////////
 639:   
 640:          /// <summary>
 641:          ///
 642:          /// </summary>
 643:          public static string SendReadVoipPstnAccount(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt)
 644:          {
 645:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.ReadVoipPstnAccountCommand(nddOnt);
 646:   
 647:              ems.SendQueue.Enqueue(command);
 648:   
 649:              return command;
 650:          }
 651:   
 652:          ////////////////////////////////////////////////////////////////////////////
 653:   
 654:          /// <summary>
 655:          ///
 656:          /// </summary>
 657:          public static string SendVacateVoipPstnAccount(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mduDev, Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt, string service, int sn, int telPort)
 658:          {
 659:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.VacateVoipPstnAccountCommand(mduDev, nddOnt, service, sn, telPort);
 660:   
 661:              ems.SendQueue.Enqueue(command);
 662:   
 663:              return command;
 664:          }
 665:   
 666:          ////////////////////////////////////////////////////////////////////////////
 667:   
 668:          /// <summary>
 669:          ///
 670:          /// </summary>
 671:          public static string SendVacateVoipPstnAccount(Ia.Ngn.Cl.Model.Client.Huawei.Ems ems, string dev, int fn, int sn, int pn)
 672:          {
 673:              var command = Ia.Ngn.Cl.Model.Business.Huawei.Ems.VacateVoipPstnAccountCommand(dev, fn, sn, pn);
 674:   
 675:              ems.SendQueue.Enqueue(command);
 676:   
 677:              return command;
 678:          }
 679:   
 680:          ////////////////////////////////////////////////////////////////////////////
 681:          ////////////////////////////////////////////////////////////////////////////   
 682:      }
 683:   
 684:      ////////////////////////////////////////////////////////////////////////////
 685:      ////////////////////////////////////////////////////////////////////////////   
 686:  }