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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Provision

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

Provision support class of Next Generation Network'a (NGN's) business model.

   1:  using System;
   2:  using System.Data;
   3:  using System.Collections;
   4:  using System.Collections.Generic;
   5:  using System.Linq;
   6:   
   7:  namespace Ia.Ngn.Cl.Model.Business
   8:  {
   9:      ////////////////////////////////////////////////////////////////////////////
  10:   
  11:      /// <summary publish="true">
  12:      /// Provision support class of Next Generation Network'a (NGN's) business model.
  13:      /// </summary>
  14:      /// 
  15:      /// <remarks> 
  16:      /// Copyright © 2006-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  17:      ///
  18:      /// 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
  19:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  20:      ///
  21:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  22:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  23:      /// 
  24:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  25:      /// 
  26:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  27:      /// </remarks> 
  28:      public class Provision
  29:      {
  30:          private static int serviceSuspensionQueueOriginalCount;
  31:          private static int sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueueOriginalCount;
  32:          private static int sequentialProvisioningWorkflowQueueOriginalCount;
  33:          private static int sequentialProvisioningWorkflowWithIssueQueueOriginalCount;
  34:          private static Queue<string> sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueue = new Queue<string>();
  35:          private static Queue<ProvisioningWorkflow> sequentialProvisioningWorkflowQueue = new Queue<ProvisioningWorkflow>();
  36:          private static Queue<ProvisioningWorkflow> sequentialProvisioningWorkflowWithIssueQueue = new Queue<ProvisioningWorkflow>();
  37:          private static readonly Queue<string> sequentialServiceToAnnulInEmsOntSipInfoOrVoipPstnUserQueue = new Queue<string>();
  38:          private static Queue<string> serviceSuspensionQueue = new Queue<string>();
  39:   
  40:          /// <summary/>
  41:          public enum Procedure { Create, Read, Update, Delete, None };
  42:   
  43:          /// <summary/>
  44:          public struct ProvisioningWorkflow
  45:          {
  46:              /// <summary/>
  47:              public string ServiceId { get; set; }
  48:   
  49:              /// <summary/>
  50:              public Procedure Procedure { get; set; }
  51:   
  52:              /// <summary/>
  53:              public DateTime DateTime { get; set; }
  54:          }
  55:   
  56:          ////////////////////////////////////////////////////////////////////////////
  57:   
  58:          /// <summary>
  59:          ///
  60:          /// </summary>
  61:          public Provision() { }
  62:   
  63:          ////////////////////////////////////////////////////////////////////////////
  64:   
  65:          /// <summary>
  66:          ///
  67:          /// </summary>
  68:          public static bool CreateNokiaSwitchSubscriber(Ia.Ngn.Cl.Model.Client.Nokia.Ims ims, string accessName, string service, int port, bool ignoreAccessRouterRestriction, out string result)
  69:          {
  70:              bool executed;
  71:              int gatewayId;
  72:              string r;
  73:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt;
  74:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor switchVendor, accessVendor;
  75:              Ia.Ngn.Cl.Model.Ont ont;
  76:              Ia.Ngn.Cl.Model.Huawei.EmsOnt emsOnt;
  77:   
  78:              executed = false;
  79:              result = string.Empty;
  80:   
  81:              switchVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.SwitchVendorFromService(service);
  82:   
  83:              if (switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
  84:              {
  85:                  nddOnt = (from n in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where n.Access.Name == accessName select n).SingleOrDefault();
  86:   
  87:                  if (nddOnt != null)
  88:                  {
  89:                      if (ignoreAccessRouterRestriction || Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedRouterDomainList(nddOnt, service))
  90:                      {
  91:                          accessVendor = nddOnt.Pon.PonGroup.Olt.Odf.Vendor;
  92:   
  93:                          if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
  94:                          {
  95:                              ont = Ia.Ngn.Cl.Model.Data.Nokia.Ont.Read(nddOnt.Id);
  96:   
  97:                              if (ont != null)
  98:                              {
  99:                                  if (nddOnt.Pon.PonGroup.Olt.IsSip == false) // if H248
 100:                                  {
 101:                                      gatewayId = Ia.Ngn.Cl.Model.Data.Nokia.AgcfGatewayRecord.GwIdFromIp(nddOnt.Ip);
 102:   
 103:                                      if (gatewayId > 0)
 104:                                      {
 105:                                          port = (port < 1) ? Ia.Ngn.Cl.Model.Data.Nokia.Ams.NextVacantFlatTermIdForOnt(ont.FamilyTypeId, ont) : port;
 106:   
 107:                                          if (port >= 1)
 108:                                          {
 109:                                              Ia.Ngn.Cl.Model.Data.Nokia.Ims.CreateH248SubscriberAndSubPartyAndAgcfEndpoint(ims, gatewayId, service, port, nddOnt, out r);
 110:                                              result += r + ",";
 111:   
 112:                                              Ia.Ngn.Cl.Model.Data.Nokia.Ims.ReadUpdateAgcfGatewayRecordAndAgcfEndpointListAndSubPartyAndSubscriberAndServiceForGwId(ims, gatewayId, out r);
 113:                                              result += r + ",";
 114:   
 115:                                              executed = true;
 116:                                          }
 117:                                          else
 118:                                          {
 119:                                              result += "port is invalid or does not exist,";
 120:                                          }
 121:                                      }
 122:                                      else
 123:                                      {
 124:                                          result += "gatewayId is invalid or does not exist,";
 125:                                      }
 126:                                  }
 127:                                  else // if IsSip == true
 128:                                  {
 129:   
 130:                                  }
 131:                              }
 132:                              else
 133:                              {
 134:                                  result += "ONT is null for access:" + nddOnt.Access.Name + ",";
 135:                              }
 136:                          }
 137:                          else if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 138:                          {
 139:                              emsOnt = Ia.Ngn.Cl.Model.Data.Huawei.Ont.Read(nddOnt.Id);
 140:   
 141:                              if (emsOnt != null)
 142:                              {
 143:                                  //onuFamilyType = Ia.Ngn.Cl.Model.Data.Huawei.Default.HuaweiSpecialOnuFamilyTypesForAccessNames(accessName);
 144:                                  // if (flatTermIdOrTelPort == 0) flatTermIdOrTelPort = Ia.Ngn.Cl.Model.Business.Ims.NextVacantFlatTermIdFromAgcfEndpointUsingGwIdForOnu(onuFamilyType, gatewayId);
 145:   
 146:                                  if (nddOnt.Pon.PonGroup.Olt.IsSip == false) // if H248
 147:                                  {
 148:                                      gatewayId = Ia.Ngn.Cl.Model.Data.Nokia.AgcfGatewayRecord.GwIdFromIp(nddOnt.Ip);
 149:   
 150:                                      if (gatewayId > 0)
 151:                                      {
 152:                                          port = (port < 1) ? Ia.Ngn.Cl.Model.Data.Default.NextVacantFlatTermIdForHuaweiEmsOntEquipmentTypeIdAndNokiaGatewayId(emsOnt.EquipmentType, gatewayId) : port;
 153:   
 154:                                          if (port >= 1)
 155:                                          {
 156:                                              Ia.Ngn.Cl.Model.Data.Nokia.Ims.CreateH248SubscriberAndSubPartyAndAgcfEndpoint(ims, gatewayId, service, port, nddOnt, out r);
 157:                                              result += r + ",";
 158:   
 159:                                              Ia.Ngn.Cl.Model.Data.Nokia.Ims.ReadUpdateAgcfGatewayRecordAndAgcfEndpointListAndSubPartyAndSubscriberAndServiceForGwId(ims, gatewayId, out r);
 160:                                              result += r + ",";
 161:   
 162:                                              executed = true;
 163:                                          }
 164:                                          else
 165:                                          {
 166:                                              result += "port is invalid or does not exist,";
 167:                                          }
 168:                                      }
 169:                                      else
 170:                                      {
 171:                                          result += "gatewayId is invalid or does not exist,";
 172:                                      }
 173:                                  }
 174:                                  else // if IsSip == true
 175:                                  {
 176:                                      Ia.Ngn.Cl.Model.Data.Nokia.Ims.CreateSipSubscriber(ims, service, nddOnt, out r);
 177:                                      result += r + ",";
 178:   
 179:                                      Ia.Ngn.Cl.Model.Data.Nokia.Ims.ReadUpdateSubPartyAndSubscriberAndService(ims, service, nddOnt, out r);
 180:                                      result += r + ",";
 181:   
 182:                                      executed = true;
 183:                                  }
 184:                              }
 185:                              else
 186:                              {
 187:                                  result += "EmsOnt is null, does not exist for access:" + nddOnt.Access.Name + ",";
 188:                              }
 189:                          }
 190:                          else
 191:                          {
 192:                              throw new Exception("accessVendor is unknown. ");
 193:                          }
 194:                      }
 195:                      else
 196:                      {
 197:                          result += "service is not within allowed router domain list. ";
 198:                      }
 199:                  }
 200:                  else
 201:                  {
 202:                      result += "nddOnt is null, does not exist for access:" + accessName + ",";
 203:                  }
 204:              }
 205:              else
 206:              {
 207:                  throw new Exception("switchVendor is null or not Nokia. ");
 208:              }
 209:   
 210:              return executed;
 211:          }
 212:   
 213:          ////////////////////////////////////////////////////////////////////////////
 214:   
 215:          /// <summary>
 216:          ///
 217:          /// </summary>
 218:          public static bool DeleteNokiaSwitchSubscriber(Ia.Ngn.Cl.Model.Client.Nokia.Ims ims, string accessName, string service, bool ignoreAccessRouterRestriction, out string result)
 219:          {
 220:              bool executed;
 221:              int gatewayId;
 222:              string r;
 223:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt;
 224:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor switchVendor, accessVendor;
 225:              Ia.Ngn.Cl.Model.Ont ont;
 226:   
 227:              executed = false;
 228:              result = string.Empty;
 229:   
 230:              switchVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.SwitchVendorFromService(service);
 231:   
 232:              if (switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
 233:              {
 234:                  nddOnt = (from n in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where n.Access.Name == accessName select n).SingleOrDefault();
 235:   
 236:                  if (nddOnt != null)
 237:                  {
 238:                      if (ignoreAccessRouterRestriction || Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedRouterDomainList(nddOnt, service))
 239:                      {
 240:                          accessVendor = nddOnt.Pon.PonGroup.Olt.Odf.Vendor;
 241:   
 242:                          if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
 243:                          {
 244:                              ont = Ia.Ngn.Cl.Model.Data.Nokia.Ont.Read(nddOnt.Id);
 245:   
 246:                              if (ont != null)
 247:                              {
 248:                                  if (nddOnt.Pon.PonGroup.Olt.IsSip == false) // if H248
 249:                                  {
 250:                                      gatewayId = Ia.Ngn.Cl.Model.Data.Nokia.AgcfGatewayRecord.GwIdFromIp(nddOnt.Ip);
 251:   
 252:                                      if (gatewayId > 0)
 253:                                      {
 254:                                          Ia.Ngn.Cl.Model.Data.Nokia.Ims.DeleteAgcfEndpointAndH248SubscriberAndSubParty(ims, service, nddOnt, out r);
 255:                                          result += r + ",";
 256:   
 257:                                          Ia.Ngn.Cl.Model.Data.Nokia.Ims.ReadUpdateAgcfGatewayRecordAndAgcfEndpointListAndSubPartyAndSubscriberAndServiceForGwId(ims, gatewayId, out r);
 258:                                          result += r + ",";
 259:   
 260:                                          executed = true;
 261:                                      }
 262:                                      else
 263:                                      {
 264:                                          result += "gatewayId is invalid or does not exist,";
 265:                                      }
 266:                                  }
 267:                                  else // if IsSip == true
 268:                                  {
 269:   
 270:                                  }
 271:                              }
 272:                              else
 273:                              {
 274:                                  result += "ont is null for access:" + nddOnt.Access.Name + ",";
 275:                              }
 276:                          }
 277:                          else if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 278:                          {
 279:                              if (nddOnt.Pon.PonGroup.Olt.IsSip == false) // if H248
 280:                              {
 281:                                  gatewayId = Ia.Ngn.Cl.Model.Data.Nokia.AgcfGatewayRecord.GwIdFromIp(nddOnt.Ip);
 282:   
 283:                                  if (gatewayId > 0)
 284:                                  {
 285:                                      Ia.Ngn.Cl.Model.Data.Nokia.Ims.DeleteAgcfEndpointAndH248SubscriberAndSubParty(ims, service, nddOnt, out r);
 286:                                      result += r + ",";
 287:   
 288:                                      Ia.Ngn.Cl.Model.Data.Nokia.Ims.ReadUpdateAgcfGatewayRecordAndAgcfEndpointListAndSubPartyAndSubscriberAndServiceForGwId(ims, gatewayId, out r);
 289:                                      result += r + ",";
 290:   
 291:                                      executed = true;
 292:                                  }
 293:                                  else
 294:                                  {
 295:                                      result += "gatewayId is invalid or does not exist,";
 296:                                  }
 297:                              }
 298:                              else // if IsSip == true
 299:                              {
 300:                                  Ia.Ngn.Cl.Model.Data.Nokia.Ims.DeleteSipSubscriber(ims, service, nddOnt, out r);
 301:                                  result += r + ",";
 302:   
 303:                                  Ia.Ngn.Cl.Model.Data.Nokia.Ims.ReadUpdateSubPartyAndSubscriberAndService(ims, service, nddOnt, out r);
 304:                                  result += r + ",";
 305:                              }
 306:                          }
 307:                          else
 308:                          {
 309:                              throw new Exception("accessVendor is unknown. ");
 310:                          }
 311:                      }
 312:                      else
 313:                      {
 314:                          result += "service is not within allowed router domain list. ";
 315:                      }
 316:                  }
 317:                  else
 318:                  {
 319:                      result += "nddOnt is null, does not exist for access:" + accessName + ",";
 320:                  }
 321:              }
 322:              else
 323:              {
 324:                  throw new Exception("switchVendor is null or not Nokia. ");
 325:              }
 326:   
 327:              return executed;
 328:          }
 329:   
 330:          ////////////////////////////////////////////////////////////////////////////
 331:   
 332:          /// <summary>
 333:          ///
 334:          /// </summary>
 335:          public static bool DeleteNokiaSwitchAgcfEndpointAndH248SubscriberAndIgnoreAccess(Ia.Ngn.Cl.Model.Client.Nokia.Ims ims, int gatewayId, string service, bool ignoreAccessRouterRestriction, out string result)
 336:          {
 337:              bool executed;
 338:              string ip;
 339:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt;
 340:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor switchVendor;
 341:   
 342:              executed = false;
 343:              result = string.Empty;
 344:   
 345:              switchVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.SwitchVendorFromService(service);
 346:   
 347:              if (switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
 348:              {
 349:                  ip = Ia.Ngn.Cl.Model.Data.Nokia.AgcfGatewayRecord.IpFromGatewayId(gatewayId);
 350:   
 351:                  if (!string.IsNullOrEmpty(ip))
 352:                  {
 353:                      nddOnt = (from o in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where o.Ip == ip select o).SingleOrDefault();
 354:   
 355:                      if (nddOnt != null)
 356:                      {
 357:                          if (ignoreAccessRouterRestriction || Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedRouterDomainList(nddOnt, service))
 358:                          {
 359:                              Ia.Ngn.Cl.Model.Data.Nokia.Ims.DeleteAgcfEndpointAndH248SubscriberAndSubParty(ims, service, nddOnt, out string r);
 360:                              result += r + ",";
 361:   
 362:                              Ia.Ngn.Cl.Model.Data.Nokia.Ims.ReadUpdateAgcfGatewayRecordAndAgcfEndpointListAndSubPartyAndSubscriberAndServiceForGwId(ims, gatewayId, out r);
 363:                              result += r + ",";
 364:   
 365:                              executed = true;
 366:                          }
 367:                          else
 368:                          {
 369:                              result += "service is not within allowed router domain list. ";
 370:                          }
 371:                      }
 372:                      else
 373:                      {
 374:                          result += "nddOnt is null, does not exist for ip:" + ip + ",";
 375:                      }
 376:                  }
 377:                  else
 378:                  {
 379:                      result += "For gatewayId: " + gatewayId + " ip is null or empty,";
 380:                  }
 381:              }
 382:              else
 383:              {
 384:                  throw new Exception("switchVendor is null or not Nokia. ");
 385:              }
 386:   
 387:              return executed;
 388:          }
 389:   
 390:          ////////////////////////////////////////////////////////////////////////////
 391:   
 392:          /// <summary>
 393:          ///
 394:          /// </summary>
 395:          public static bool DeleteNokiaSwitchAgcfEndpointAndH248SubscriberFromAnyFsdb(Ia.Ngn.Cl.Model.Client.Nokia.Ims ims, string service, out string result)
 396:          {
 397:              bool executed;
 398:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor switchVendor;
 399:   
 400:              executed = false;
 401:              result = string.Empty;
 402:   
 403:              switchVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.SwitchVendorFromService(service);
 404:   
 405:              if (switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
 406:              {
 407:                  foreach (Ia.Ngn.Cl.Model.Business.Nokia.Ims.ImsBasicService ibs in Ia.Ngn.Cl.Model.Business.Nokia.Ims.ImsBasicServiceList)
 408:                  {
 409:                      Ia.Ngn.Cl.Model.Data.Nokia.Ims.DeleteAgcfEndpointAndH248SubscriberAndSubParty(ims, service, ibs.PrimarySwitch, ibs.Fsdb, out string r);
 410:                      result += r + ",";
 411:   
 412:                      Ia.Ngn.Cl.Model.Data.Nokia.Ims.ReadSubPartyAndSubscriber(ims, service, ibs.PrimarySwitch, ibs.Fsdb, ibs.Service, out r);
 413:                      result += r + ",";
 414:                  }
 415:   
 416:                  executed = true;
 417:              }
 418:              else
 419:              {
 420:                  throw new Exception("switchVendor is null or not Nokia. ");
 421:              }
 422:   
 423:              return executed;
 424:          }
 425:   
 426:          ////////////////////////////////////////////////////////////////////////////
 427:          ////////////////////////////////////////////////////////////////////////////
 428:   
 429:          /// <summary>
 430:          ///
 431:          /// </summary>
 432:          public static bool CreateHuaweiSwitchSubscriber(Ia.Ngn.Cl.Model.Client.Huawei.Ims ims, string accessName, string service, int port, bool ignoreAccessRouterRestriction, out string result)
 433:          {
 434:              bool executed, created;
 435:              //int flatTermId, telPort;
 436:              string r;
 437:              Ia.Ngn.Cl.Model.Business.Huawei.Default.FnSnPn fnSnPn;
 438:              Ia.Ngn.Cl.Model.Business.Huawei.Dev.MduDev mdu;
 439:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt;
 440:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor switchVendor, accessVendor;
 441:              Ia.Ngn.Cl.Model.Huawei.EmsOnt emsOnt;
 442:              //Ia.Ngn.Cl.Model.Huawei.EmsOntSipInfo emsOntSipInfo;
 443:              //Ia.Ngn.Cl.Model.Huawei.EmsVoipPstnUser emsVoipPstnUser;
 444:              Ia.Ngn.Cl.Model.Ont ont;
 445:   
 446:              executed = false;
 447:              result = string.Empty;
 448:   
 449:              switchVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.SwitchVendorFromService(service);
 450:   
 451:              if (switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 452:              {
 453:                  nddOnt = (from n in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where n.Access.Name == accessName select n).SingleOrDefault();
 454:   
 455:                  if (nddOnt != null)
 456:                  {
 457:                      if (ignoreAccessRouterRestriction || Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedRouterDomainList(nddOnt, service))
 458:                      {
 459:                          accessVendor = nddOnt.Pon.PonGroup.Olt.Odf.Vendor;
 460:   
 461:                          if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
 462:                          {
 463:                              ont = Ia.Ngn.Cl.Model.Data.Nokia.Ont.Read(nddOnt.Id);
 464:   
 465:                              if (ont != null)
 466:                              {
 467:                                  port = (port < 1) ? Ia.Ngn.Cl.Model.Data.Nokia.Ams.NextVacantFlatTermIdForOnt(ont.FamilyTypeId, ont) : port;
 468:   
 469:                                  if (port >= 1)
 470:                                  {
 471:                                      Ia.Ngn.Cl.Model.Data.Huawei.Ims.CreateSubscriber(ims, service, nddOnt, out r);
 472:                                      result += r + ",";
 473:   
 474:                                      Ia.Ngn.Cl.Model.Business.Huawei.Ims.ReadSbrForService(ims, service, out r);
 475:                                      result += r + ",";
 476:   
 477:                                      // other commands will be issued through U2000 NBI to configure H248 in SKB and TEC softswitch
 478:   
 479:                                      executed = true;
 480:                                  }
 481:                                  else
 482:                                  {
 483:                                      result += "Port is invalid or does not exist,";
 484:                                  }
 485:                              }
 486:                              else
 487:                              {
 488:                                  result += "Ont is null, does not exist for access:" + nddOnt.Access.Name + ",";
 489:                              }
 490:                          }
 491:                          else if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 492:                          {
 493:                              emsOnt = Ia.Ngn.Cl.Model.Data.Huawei.Ont.Read(nddOnt.Id);
 494:   
 495:                              if (emsOnt != null)
 496:                              {
 497:                                  if (nddOnt.Pon.PonGroup.Olt.IsSip == false) // if H248
 498:                                  {
 499:                                  }
 500:                                  else // if IsSip == true
 501:                                  {
 502:                                      if (emsOnt.FamilyType == Ia.Ngn.Cl.Model.Business.Huawei.Ont.FamilyType.Mdu)
 503:                                      {
 504:                                          if (Ia.Ngn.Cl.Model.Data.Huawei.Default.MduDevDictionary.ContainsKey(nddOnt.Access.Name))
 505:                                          {
 506:                                              mdu = Ia.Ngn.Cl.Model.Data.Huawei.Default.MduDevDictionary[nddOnt.Access.Name];
 507:   
 508:                                              fnSnPn = Ia.Ngn.Cl.Model.Data.Huawei.Ems.NextVacantMduFnSnPnForOnt(mdu, emsOnt);
 509:   
 510:                                              if (fnSnPn != null)
 511:                                              {
 512:                                                  port = (port < 0) ? fnSnPn.Pn : port;
 513:   
 514:                                                  created = Ia.Ngn.Cl.Model.Data.Huawei.Ims.CreateSubscriber(ims, service, nddOnt, out r);
 515:   
 516:                                                  result += r + ",";
 517:                                              }
 518:                                              else
 519:                                              {
 520:                                                  result += "MDU sn and/or telPort is invalid or does not exist,";
 521:                                              }
 522:                                          }
 523:                                          else
 524:                                          {
 525:                                              result += "emsOnt.FamilyType == Mdu but MduDictionary does not contain key: " + nddOnt.Access.Name + " for service: " + service + ", and access: " + nddOnt.Access.Name;
 526:                                          }
 527:                                      }
 528:                                      else // if not MDU
 529:                                      {
 530:                                          port = (port < 1) ? Ia.Ngn.Cl.Model.Data.Huawei.Ems.NextVacantTelForOnt(emsOnt) : port;
 531:   
 532:                                          if (port >= 1)
 533:                                          {
 534:                                              created = Ia.Ngn.Cl.Model.Data.Huawei.Ims.CreateSubscriber(ims, service, nddOnt, out r);
 535:                                              result += r + ",";
 536:                                          }
 537:                                          else
 538:                                          {
 539:                                              result += "Port is invalid or does not exist,";
 540:                                          }
 541:                                      }
 542:                                  }
 543:                              }
 544:                              else
 545:                              {
 546:                                  result += "emsOnt is null, does not exist for access:" + nddOnt.Access.Name + ",";
 547:                              }
 548:   
 549:                              Ia.Ngn.Cl.Model.Business.Huawei.Ims.ReadUpdateSbrAndServiceForService(ims, service, nddOnt, out r);
 550:                              result += r + ",";
 551:                          }
 552:                          else
 553:                          {
 554:                              throw new Exception("accessVendor is unknown. ");
 555:                          }
 556:                      }
 557:                      else
 558:                      {
 559:                          result += "service is not within allowed router domain list. ";
 560:                      }
 561:                  }
 562:                  else
 563:                  {
 564:                      result += "nddOnt is null, does not exist for access:" + accessName + ",";
 565:                  }
 566:              }
 567:              else
 568:              {
 569:                  throw new Exception("switchVendor is null or not Huawei. ");
 570:              }
 571:   
 572:              return executed;
 573:          }
 574:   
 575:          ////////////////////////////////////////////////////////////////////////////
 576:   
 577:          /// <summary>
 578:          ///
 579:          /// </summary>
 580:          public static bool DeleteHuaweiSwitchSubscriber(Ia.Ngn.Cl.Model.Client.Huawei.Ims ims, string accessName, string service, bool ignoreAccessRouterRestriction, out string result)
 581:          {
 582:              bool executed;
 583:              string r;
 584:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt;
 585:              Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor switchVendor, accessVendor;
 586:              Ia.Ngn.Cl.Model.Ont ont;
 587:   
 588:              executed = false;
 589:              result = string.Empty;
 590:   
 591:              switchVendor = Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.SwitchVendorFromService(service);
 592:   
 593:              if (switchVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 594:              {
 595:                  nddOnt = (from n in Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.OntList where n.Access.Name == accessName select n).SingleOrDefault();
 596:   
 597:                  if (nddOnt != null)
 598:                  {
 599:                      if (ignoreAccessRouterRestriction || Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedRouterDomainList(nddOnt, service))
 600:                      {
 601:                          accessVendor = nddOnt.Pon.PonGroup.Olt.Odf.Vendor;
 602:   
 603:                          if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia)
 604:                          {
 605:                              ont = Ia.Ngn.Cl.Model.Data.Nokia.Ont.Read(nddOnt.Id);
 606:   
 607:                              if (ont != null)
 608:                              {
 609:                                  Ia.Ngn.Cl.Model.Data.Huawei.Ims.DeleteSubscriber(ims, service, out r);
 610:                                  result += r + ",";
 611:   
 612:                                  Ia.Ngn.Cl.Model.Business.Huawei.Ims.ReadUpdateSbrAndServiceForService(ims, service, nddOnt, out r);
 613:                                  result += r + ",";
 614:   
 615:                                  // other commands will be issued through U2000 NBI to configure H248 in SKB and TEC softswitch
 616:                              }
 617:                              else
 618:                              {
 619:                                  result += "ont is null,";
 620:                              }
 621:                          }
 622:                          else if (accessVendor == Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei)
 623:                          {
 624:                              Ia.Ngn.Cl.Model.Data.Huawei.Ims.DeleteSubscriber(ims, service, out r);
 625:                              result += r + ",";
 626:   
 627:                              Ia.Ngn.Cl.Model.Business.Huawei.Ims.ReadUpdateSbrAndServiceForService(ims, service, nddOnt, out r);
 628:                              result += r + ",";
 629:                          }
 630:                          else
 631:                          {
 632:                              throw new Exception("accessVendor is unknown. ");
 633:                          }
 634:                      }
 635:                      else
 636:                      {
 637:                          result += "service is not within allowed router domain list. ";
 638:                      }
 639:                  }
 640:                  else
 641:                  {
 642:                      result += "nddOnt is null, does not exist for access:" + accessName + ",";
 643:                  }
 644:              }
 645:              else
 646:              {
 647:                  throw new Exception("switchVendor is null or not Huawei. ");
 648:              }
 649:   
 650:              return executed;
 651:          }
 652:   
 653:          ////////////////////////////////////////////////////////////////////////////
 654:          ////////////////////////////////////////////////////////////////////////////
 655:   
 656:          /// <summary>
 657:          ///
 658:          /// </summary>
 659:          public static string SequentialServiceSuspensionMismatchBetweenServiceRequestServiceAndServiceServiceIdList(out int serviceSuspensionQueueCount, out string result)
 660:          {
 661:              string service;
 662:   
 663:              if (serviceSuspensionQueue.Count == 0)
 664:              {
 665:                  serviceSuspensionQueue = new Queue<string>(Ia.Ngn.Cl.Model.Data.Provision.ServiceSuspensionMismatchBetweenServiceRequestServiceAndServiceServiceIdList());
 666:   
 667:                  serviceSuspensionQueueOriginalCount = serviceSuspensionQueue.Count;
 668:              }
 669:   
 670:              if (serviceSuspensionQueue.Count > 0) service = serviceSuspensionQueue.Dequeue();
 671:              else service = null;
 672:   
 673:              result = "(" + serviceSuspensionQueue.Count + "/" + serviceSuspensionQueueOriginalCount + ") ";
 674:   
 675:              serviceSuspensionQueueCount = serviceSuspensionQueue.Count;
 676:   
 677:              return service;
 678:          }
 679:   
 680:          ////////////////////////////////////////////////////////////////////////////
 681:   
 682:          /// <summary>
 683:          ///
 684:          /// </summary>
 685:          public static string SequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceListItem(int provisionWithinLastNDays, out int sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueueCount, out string progressCounterString)
 686:          {
 687:              string service;
 688:   
 689:              if (sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueue.Count == 0)
 690:              {
 691:                  sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueue = new Queue<string>(DiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdTestList(provisionWithinLastNDays).Keys.ToList());
 692:   
 693:                  sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueueOriginalCount = sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueue.Count;
 694:              }
 695:   
 696:              if (sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueue.Count > 0) service = sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueue.Dequeue();
 697:              else service = null;
 698:   
 699:              progressCounterString = "(" + sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueue.Count + "/" + sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueueOriginalCount + ")";
 700:   
 701:              sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueueCount = sequentialDiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdQueue.Count;
 702:   
 703:              return service;
 704:          }
 705:   
 706:          ////////////////////////////////////////////////////////////////////////////
 707:   
 708:          /// <summary>
 709:          ///
 710:          /// </summary>
 711:          public static Dictionary<string, string> DiscrepancyAndComplementaryServiceMismatchBetweenServiceRequestServiceAndServiceServiceIdTestList(int provisionWithinLastNDays)
 712:          {
 713:              Dictionary<string, string> dictionary;
 714:   
 715:              Ia.Ngn.Cl.Model.Data.Provision.ServiceToUpdateServiceIdAccessIdDictionary_ServiceToCreateServiceIdAccessIdDictionary_ServiceToDeleteServiceIdAccessIdDictionary(provisionWithinLastNDays, out Dictionary<string, string> serviceToUpdateIdAccessIdDictionary, out Dictionary<string, string> serviceToCreateServiceIdAccessIdDictionary, out Dictionary<string, string> serviceToDeleteServiceIdAccessIdDictionary);
 716:   
 717:              dictionary = new Dictionary<string, string>(serviceToUpdateIdAccessIdDictionary.Count + serviceToCreateServiceIdAccessIdDictionary.Count + serviceToDeleteServiceIdAccessIdDictionary.Count);
 718:   
 719:              foreach (KeyValuePair<string, string> s in serviceToUpdateIdAccessIdDictionary) dictionary.Add(s.Key, s.Value);
 720:              foreach (KeyValuePair<string, string> s in serviceToCreateServiceIdAccessIdDictionary) dictionary.Add(s.Key, s.Value);
 721:              foreach (KeyValuePair<string, string> s in serviceToDeleteServiceIdAccessIdDictionary) dictionary.Add(s.Key, s.Value);
 722:   
 723:              return dictionary;
 724:          }
 725:   
 726:          ////////////////////////////////////////////////////////////////////////////
 727:          ////////////////////////////////////////////////////////////////////////////
 728:   
 729:          /// <summary>
 730:          ///
 731:          /// </summary>
 732:          public static ProvisioningWorkflow SequentialProvisioningWorkflowOfServiceToCreateAndToDeleteInEmsOntSipInfoOrVoipPstnUserListItem(int provisioningWorkflowWithinPastNHours, out int sequentialProvisioningWorkflowQueueCount, out string progressCounterString)
 733:          {
 734:              ProvisioningWorkflow pw;
 735:   
 736:              if (provisioningWorkflowWithinPastNHours == 0) pw = SequentialProvisioningWorkflowOfServiceToCreateAndToDeleteInEmsOntSipInfoOrVoipPstnUserListWithIssueItem(out sequentialProvisioningWorkflowQueueCount, out progressCounterString);
 737:              else pw = SequentialProvisioningWorkflowOfServiceToCreateAndToDeleteInEmsOntSipInfoOrVoipPstnUserListFromThePastNHoursItem(provisioningWorkflowWithinPastNHours, out sequentialProvisioningWorkflowQueueCount, out progressCounterString);
 738:   
 739:              return pw;
 740:          }
 741:   
 742:          ////////////////////////////////////////////////////////////////////////////
 743:   
 744:          /// <summary>
 745:          ///
 746:          /// </summary>
 747:          private static ProvisioningWorkflow SequentialProvisioningWorkflowOfServiceToCreateAndToDeleteInEmsOntSipInfoOrVoipPstnUserListFromThePastNHoursItem(int provisioningWorkflowWithinPastNHours, out int sequentialProvisioningWorkflowQueueCount, out string progressCounterString)
 748:          {
 749:              ProvisioningWorkflow pw;
 750:              List<ProvisioningWorkflow> list;
 751:   
 752:              if (sequentialProvisioningWorkflowQueue.Count == 0)
 753:              {
 754:                  list = Ia.Ngn.Cl.Model.Business.Provision.ProvisioningWorkflowOfServiceToCreateAndToDeleteInEmsOntSipInfoOrVoipPstnUserListFromThePastNHours(provisioningWorkflowWithinPastNHours);
 755:   
 756:                  sequentialProvisioningWorkflowQueue = new Queue<ProvisioningWorkflow>(list.OrderByDescending(l => l.DateTime)); // don't shuffle
 757:   
 758:                  sequentialProvisioningWorkflowQueueOriginalCount = sequentialProvisioningWorkflowQueue.Count;
 759:              }
 760:   
 761:              if (sequentialProvisioningWorkflowQueue.Count > 0) pw = sequentialProvisioningWorkflowQueue.Dequeue();
 762:              else pw = new ProvisioningWorkflow { Procedure = Procedure.None };
 763:   
 764:              progressCounterString = "(" + sequentialProvisioningWorkflowQueue.Count + "/" + sequentialProvisioningWorkflowQueueOriginalCount + ")";
 765:   
 766:              sequentialProvisioningWorkflowQueueCount = sequentialProvisioningWorkflowQueue.Count;
 767:   
 768:              return pw;
 769:          }
 770:   
 771:          ////////////////////////////////////////////////////////////////////////////
 772:   
 773:          /// <summary>
 774:          ///
 775:          /// </summary>
 776:          private static ProvisioningWorkflow SequentialProvisioningWorkflowOfServiceToCreateAndToDeleteInEmsOntSipInfoOrVoipPstnUserListWithIssueItem(out int sequentialProvisioningWorkflowQueueCount, out string progressCounterString)
 777:          {
 778:              ProvisioningWorkflow pw;
 779:              List<ProvisioningWorkflow> list;
 780:   
 781:              if (sequentialProvisioningWorkflowWithIssueQueue.Count == 0)
 782:              {
 783:                  list = Ia.Ngn.Cl.Model.Business.Provision.ProvisioningWorkflowOfServiceToCreateAndToDeleteInEmsOntSipInfoOrVoipPstnUserListFromThePastNHours(0);
 784:   
 785:                  sequentialProvisioningWorkflowWithIssueQueue = new Queue<ProvisioningWorkflow>(list.OrderByDescending(l => l.DateTime)); // don't shuffle
 786:   
 787:                  sequentialProvisioningWorkflowWithIssueQueueOriginalCount = sequentialProvisioningWorkflowWithIssueQueue.Count;
 788:              }
 789:   
 790:              if (sequentialProvisioningWorkflowWithIssueQueue.Count > 0) pw = sequentialProvisioningWorkflowWithIssueQueue.Dequeue();
 791:              else pw = new ProvisioningWorkflow { Procedure = Procedure.None };
 792:   
 793:              progressCounterString = "(" + sequentialProvisioningWorkflowWithIssueQueue.Count + "/" + sequentialProvisioningWorkflowWithIssueQueueOriginalCount + ")";
 794:   
 795:              sequentialProvisioningWorkflowQueueCount = sequentialProvisioningWorkflowWithIssueQueue.Count;
 796:   
 797:              return pw;
 798:          }
 799:   
 800:          ////////////////////////////////////////////////////////////////////////////
 801:   
 802:          /// <summary>
 803:          ///
 804:          /// </summary>
 805:          private static List<ProvisioningWorkflow> ProvisioningWorkflowOfServiceToCreateAndToDeleteInEmsOntSipInfoOrVoipPstnUserListFromThePastNHours(int provisioningWorkflowWithinPastNHours)
 806:          {
 807:              string serviceId;
 808:              DateTime dateTime, pastNHoursDateTime;
 809:              List<ProvisioningWorkflow> provisioningWorkflowList;
 810:   
 811:              provisioningWorkflowList = new List<ProvisioningWorkflow>();
 812:   
 813:              pastNHoursDateTime = (provisioningWorkflowWithinPastNHours > 0) ? DateTime.UtcNow.AddHours(3).AddHours(-provisioningWorkflowWithinPastNHours) : DateTime.MinValue;
 814:   
 815:              Ia.Ngn.Cl.Model.Business.Provision.ServiceIdToCreateInEmsOntSipInfoOrVoipPstnUserList_ServiceIdToAnnulInEmsOntSipInfoOrVoipPstnUserList(out Dictionary<string, DateTime> serviceToCreateInEmsOntSipInfoOrVoipPstnUserToDateTimeDictionary, out Dictionary<string, DateTime> serviceToAnnulInEmsOntSipInfoOrVoipPstnUseToDateTimeDictionary);
 816:   
 817:              // issue read, execute, then read again commands
 818:              foreach (KeyValuePair<string, DateTime> kvp in serviceToCreateInEmsOntSipInfoOrVoipPstnUserToDateTimeDictionary)
 819:              {
 820:                  serviceId = kvp.Key;
 821:                  dateTime = kvp.Value;
 822:   
 823:                  if (dateTime >= pastNHoursDateTime)
 824:                  {
 825:                      provisioningWorkflowList.Add(new ProvisioningWorkflow { ServiceId = serviceId, Procedure = Procedure.Read, DateTime = dateTime });
 826:                      provisioningWorkflowList.Add(new ProvisioningWorkflow { ServiceId = serviceId, Procedure = Procedure.Create, DateTime = dateTime });
 827:                      provisioningWorkflowList.Add(new ProvisioningWorkflow { ServiceId = serviceId, Procedure = Procedure.Read, DateTime = dateTime });
 828:                  }
 829:              }
 830:   
 831:              foreach (KeyValuePair<string, DateTime> kvp in serviceToAnnulInEmsOntSipInfoOrVoipPstnUseToDateTimeDictionary)
 832:              {
 833:                  serviceId = kvp.Key;
 834:                  dateTime = kvp.Value;
 835:   
 836:                  if (dateTime > pastNHoursDateTime)
 837:                  {
 838:                      provisioningWorkflowList.Add(new ProvisioningWorkflow { ServiceId = serviceId, Procedure = Procedure.Read, DateTime = dateTime });
 839:                      provisioningWorkflowList.Add(new ProvisioningWorkflow { ServiceId = serviceId, Procedure = Procedure.Delete, DateTime = dateTime });
 840:                      provisioningWorkflowList.Add(new ProvisioningWorkflow { ServiceId = serviceId, Procedure = Procedure.Read, DateTime = dateTime });
 841:                  }
 842:              }
 843:   
 844:              return provisioningWorkflowList;
 845:          }
 846:   
 847:          ////////////////////////////////////////////////////////////////////////////
 848:   
 849:          /// <summary>
 850:          /// Find the provisioned services within SIP OLTs that do not have equivalent OntSipInfo or VoipPstnUser records, and all OntSipInfo and VoipPstnUser records that do note have equivalent services within SIP OLTs.
 851:          /// </summary>
 852:          private static void ServiceIdToCreateInEmsOntSipInfoOrVoipPstnUserList_ServiceIdToAnnulInEmsOntSipInfoOrVoipPstnUserList(out Dictionary<string, DateTime> serviceToCreateInEmsOntSipInfoOrVoipPstnUserToDateTimeDictionary, out Dictionary<string, DateTime> serviceToAnnulInEmsOntSipInfoOrVoipPstnUseToDateTimeDictionary)
 853:          {
 854:              string kvpServiceId;
 855:              List<string> serviceIdExemptionList, ontSipInfoServiceIdWithinAllowedToBeProvisionedOrMigratedSipOltList, voipPstnUserServiceIdWithinAllowedToBeProvisionedOrMigratedSipOltList;
 856:              Dictionary<string, DateTime> serviceIdToCreatedDateTimeDictionary, serviceIdWithinAllowedToBeProvisionedOrMigratedSipOltToCreatedDateTimeDictionary;
 857:   
 858:              serviceToCreateInEmsOntSipInfoOrVoipPstnUserToDateTimeDictionary = new Dictionary<string, DateTime>();
 859:              serviceToAnnulInEmsOntSipInfoOrVoipPstnUseToDateTimeDictionary = new Dictionary<string, DateTime>();
 860:   
 861:              serviceIdWithinAllowedToBeProvisionedOrMigratedSipOltToCreatedDateTimeDictionary = Ia.Ngn.Cl.Model.Data.Service2.ServiceIdWithinAllowedSipOltToBeProvisionedOrMigratedToCreatedDateTimeDictionary;
 862:              serviceIdToCreatedDateTimeDictionary = Ia.Ngn.Cl.Model.Data.Service2.ServiceIdToCreatedDateTimeDictionary;
 863:              ontSipInfoServiceIdWithinAllowedToBeProvisionedOrMigratedSipOltList = Ia.Ngn.Cl.Model.Data.Huawei.OntSipInfo.ServiceIdWithinAllowedSipOltToBeProvisionedOrMigratedList();
 864:              voipPstnUserServiceIdWithinAllowedToBeProvisionedOrMigratedSipOltList = Ia.Ngn.Cl.Model.Data.Huawei.VoipPstnUser.ServiceIdWithinAllowedSipOltToBeProvisionedOrMigratedList();
 865:   
 866:              foreach (KeyValuePair<string, DateTime> kvp in serviceIdWithinAllowedToBeProvisionedOrMigratedSipOltToCreatedDateTimeDictionary)
 867:              {
 868:                  kvpServiceId = kvp.Key;
 869:   
 870:                  if (!ontSipInfoServiceIdWithinAllowedToBeProvisionedOrMigratedSipOltList.Contains(kvpServiceId) && !voipPstnUserServiceIdWithinAllowedToBeProvisionedOrMigratedSipOltList.Contains(kvpServiceId))
 871:                  {
 872:                      if (!serviceToCreateInEmsOntSipInfoOrVoipPstnUserToDateTimeDictionary.ContainsKey(kvpServiceId))
 873:                      {
 874:                          serviceToCreateInEmsOntSipInfoOrVoipPstnUserToDateTimeDictionary[kvpServiceId] = serviceIdWithinAllowedToBeProvisionedOrMigratedSipOltToCreatedDateTimeDictionary[kvpServiceId];
 875:                      }
 876:                  }
 877:              }
 878:   
 879:              // In serviceIdToAnnulInEmsOntSipInfoOrVoipPstnUserList I must make sure that serviceId does not belong to any current service in serviceIdWithinHuaweiSwitchDomainList
 880:              // this is to allow MSAN and POTS to GPON migration without interruption or feedback from the vendor. Any number deleted from IMS will be deleted from U2000.
 881:   
 882:              foreach (var serviceId in ontSipInfoServiceIdWithinAllowedToBeProvisionedOrMigratedSipOltList)
 883:              {
 884:                  if (!serviceIdWithinAllowedToBeProvisionedOrMigratedSipOltToCreatedDateTimeDictionary.ContainsKey(serviceId))
 885:                  {
 886:                      if (!serviceIdToCreatedDateTimeDictionary.ContainsKey(serviceId))
 887:                      {
 888:                          if (!serviceToAnnulInEmsOntSipInfoOrVoipPstnUseToDateTimeDictionary.ContainsKey(serviceId))
 889:                          {
 890:                              serviceToAnnulInEmsOntSipInfoOrVoipPstnUseToDateTimeDictionary[serviceId] = DateTime.MinValue;
 891:                          }
 892:                      }
 893:                  }
 894:              }
 895:   
 896:              foreach (var serviceId in voipPstnUserServiceIdWithinAllowedToBeProvisionedOrMigratedSipOltList)
 897:              {
 898:                  if (!serviceIdWithinAllowedToBeProvisionedOrMigratedSipOltToCreatedDateTimeDictionary.ContainsKey(serviceId))
 899:                  {
 900:                      if (!serviceIdToCreatedDateTimeDictionary.ContainsKey(serviceId))
 901:                      {
 902:                          if (!serviceToAnnulInEmsOntSipInfoOrVoipPstnUseToDateTimeDictionary.ContainsKey(serviceId))
 903:                          {
 904:                              serviceToAnnulInEmsOntSipInfoOrVoipPstnUseToDateTimeDictionary[serviceId] = DateTime.MinValue;
 905:                          }
 906:                      }
 907:                  }
 908:              }
 909:   
 910:              // will exclude exempt numbers
 911:              serviceIdExemptionList = Ia.Ngn.Cl.Model.Data.Provision.ServiceIdOfServiceExemptFromProvisionProcessingList();
 912:              foreach (string serviceId in serviceIdExemptionList)
 913:              {
 914:                  serviceToCreateInEmsOntSipInfoOrVoipPstnUserToDateTimeDictionary.Remove(serviceId);
 915:                  serviceToAnnulInEmsOntSipInfoOrVoipPstnUseToDateTimeDictionary.Remove(serviceId);
 916:              }
 917:          }
 918:   
 919:          ////////////////////////////////////////////////////////////////////////////
 920:          ////////////////////////////////////////////////////////////////////////////
 921:   
 922:          /// <summary>
 923:          ///
 924:          /// </summary>
 925:          public static List<string> ServiceSuspendedInServiceRequestServiceButNotInServiceStringNumberList
 926:          {
 927:              get
 928:              {
 929:                  List<string> list, sList, srsList;
 930:                  SortedList sl;
 931:   
 932:                  sList = Ia.Ngn.Cl.Model.Data.Service2.ServiceSuspensionIsTrueStringNumberList;
 933:                  srsList = Ia.Ngn.Cl.Model.Data.ServiceRequestService.ServiceSuspensionIsTrueAndProvisionedIsTrueStringNumberList;
 934:   
 935:                  if (sList != null && sList.Count > 0)
 936:                  {
 937:                      if (srsList != null && srsList.Count > 0)
 938:                      {
 939:                          list = new List<string>(sList.Count);
 940:   
 941:                          sl = new SortedList(sList.ToDictionary(s => s));
 942:   
 943:                          foreach (string s in srsList)
 944:                          {
 945:                              if (!sl.ContainsKey(s)) list.Add(s);
 946:                          }
 947:                      }
 948:                      else
 949:                      {
 950:                          list = new List<string>();
 951:                      }
 952:                  }
 953:                  else
 954:                  {
 955:                      if (srsList != null && srsList.Count > 0) list = sList;
 956:                      else list = new List<string>();
 957:                  }
 958:   
 959:                  return list;
 960:              }
 961:          }
 962:   
 963:          ////////////////////////////////////////////////////////////////////////////
 964:   
 965:          /// <summary>
 966:          ///
 967:          /// </summary>
 968:          public static List<string> ServiceActiveInServiceRequestServiceButNotInServiceStringNumberList
 969:          {
 970:              get
 971:              {
 972:                  List<string> list, sList, srsList;
 973:                  SortedList sl;
 974:   
 975:                  sList = Ia.Ngn.Cl.Model.Data.Service2.ServiceSuspensionIsFalseStringNumberList;
 976:                  srsList = Ia.Ngn.Cl.Model.Data.ServiceRequestService.ServiceSuspensionIsFalseStringNumberList;
 977:   
 978:                  if (sList != null && sList.Count > 0)
 979:                  {
 980:                      if (srsList != null && srsList.Count > 0)
 981:                      {
 982:                          list = new List<string>(sList.Count);
 983:   
 984:                          sl = new SortedList(sList.ToDictionary(s => s));
 985:   
 986:                          foreach (string s in srsList)
 987:                          {
 988:                              if (!sl.ContainsKey(s)) list.Add(s);
 989:                          }
 990:                      }
 991:                      else
 992:                      {
 993:                          list = new List<string>();
 994:                      }
 995:                  }
 996:                  else
 997:                  {
 998:                      if (srsList != null && srsList.Count > 0) list = sList;
 999:                      else list = new List<string>();
1000:                  }
1001:   
1002:                  return list;
1003:              }
1004:          }
1005:   
1006:          ////////////////////////////////////////////////////////////////////////////
1007:          ////////////////////////////////////////////////////////////////////////////    
1008:      }
1009:   
1010:      ////////////////////////////////////////////////////////////////////////////
1011:      ////////////////////////////////////////////////////////////////////////////   
1012:  }