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

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