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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » ServiceRequestService

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

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

   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.Data;
   4:  using System.Linq;
   5:  using System.Text;
   6:   
   7:  namespace Ia.Ngn.Cl.Model.Business
   8:  {
   9:      ////////////////////////////////////////////////////////////////////////////
  10:   
  11:      /// <summary publish="true">
  12:      /// Service Request Service 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), Integrated 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 partial class ServiceRequestService
  29:      {
  30:          private static StringBuilder log = new StringBuilder();
  31:   
  32:          ////////////////////////////////////////////////////////////////////////////
  33:   
  34:          /// <summary>
  35:          ///
  36:          /// </summary>
  37:          public enum ServiceRequestServiceType { Create = 1, Read, Update, Delete };
  38:   
  39:          ////////////////////////////////////////////////////////////////////////////
  40:   
  41:          /// <summary>
  42:          ///
  43:          /// </summary>
  44:          public ServiceRequestService() { }
  45:   
  46:          ////////////////////////////////////////////////////////////////////////////
  47:   
  48:          /// <summary>
  49:          ///
  50:          /// </summary>
  51:          public static string ServiceIdToService(string service)
  52:          {
  53:              return Ia.Ngn.Cl.Model.Business.Service.ServiceIdToService(service);
  54:          }
  55:   
  56:          ////////////////////////////////////////////////////////////////////////////
  57:   
  58:          /// <summary>
  59:          ///
  60:          /// </summary>
  61:          public static string ServiceRequestServiceId(string service, int serviceType)
  62:          {
  63:              // below:
  64:              string id;
  65:   
  66:              id = Ia.Ngn.Cl.Model.Business.Service2.ServiceId(service, serviceType);
  67:   
  68:              return id;
  69:          }
  70:   
  71:          ////////////////////////////////////////////////////////////////////////////
  72:   
  73:          /// <summary>
  74:          ///
  75:          /// </summary>
  76:          public static void UpdateServiceSuspension(string service, bool serviceSuspensionState, Ia.Ngn.Cl.Model.Business.Administration.StaffContact staffContact, out Ia.Cl.Model.Result result)
  77:          {
  78:              result = new Ia.Cl.Model.Result();
  79:   
  80:              if (Ia.Ngn.Cl.Model.Business.Authority.StaffContactCanReadUpdateServiceSuspension(Ia.Ngn.Cl.Model.Business.Authority.PersistentStorageFunction.Update, staffContact))
  81:              {
  82:                  if (Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedDomainList(service))
  83:                  {
  84:                      Ia.Ngn.Cl.Model.Data.ServiceRequestService.UpdateServiceSuspension(service, serviceSuspensionState, staffContact.UserId, out result);
  85:   
  86:                      Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.ServiceSuspensionQueue.Enqueue(service);
  87:   
  88:                      if (result.IsSuccessful)
  89:                      {
  90:                          result.AddSuccess("Service record '" + service + "' has its service suspension value updated to '" + serviceSuspensionState.ToString().ToLower() + "'");
  91:                      }
  92:                      else
  93:                      {
  94:                      }
  95:                  }
  96:                  else
  97:                  {
  98:                      result.AddError(@"The number '" + service + @"' does not belong to the network (الرقم لا ينتمي للشبكة). ");
  99:                  }
 100:              }
 101:              else
 102:              {
 103:                  result.AddError("You are not authorized to modify this value (لست مخولاً بتعديل هذه القيمة). ");
 104:              }
 105:          }
 106:   
 107:          ////////////////////////////////////////////////////////////////////////////
 108:   
 109:          /// <summary>
 110:          ///
 111:          /// </summary>
 112:          public static void ReadServiceSuspension(string service, Ia.Ngn.Cl.Model.Business.Administration.StaffContact staffContact, string key, out bool isSuspended, out DateTime serviceLastUpdated, out Ia.Cl.Model.Result result)
 113:          {
 114:              DateTime now;
 115:              Ia.Ngn.Cl.Model.Service2 service2;
 116:              Ia.Ngn.Cl.Model.ServiceRequestService serviceRequestService;
 117:   
 118:              result = new Ia.Cl.Model.Result();
 119:   
 120:              isSuspended = false;
 121:              serviceLastUpdated = DateTime.MinValue;
 122:   
 123:              now = DateTime.UtcNow.AddHours(3);
 124:   
 125:              if (Ia.Ngn.Cl.Model.Business.Authority.StaffContactCanReadUpdateServiceSuspension(Ia.Ngn.Cl.Model.Business.Authority.PersistentStorageFunction.Read, staffContact))
 126:              {
 127:                  if (Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedDomainList(service))
 128:                  {
 129:                      serviceRequestService = Ia.Ngn.Cl.Model.Data.ServiceRequestService.Read(service);
 130:                      service2 = Ia.Ngn.Cl.Model.Data.Service2.Read(service);
 131:   
 132:                      if (serviceRequestService != null && service2 != null)
 133:                      {
 134:                          result.AddSuccess("Pending service suspension value is '" + serviceRequestService.ServiceSuspension.ToString().ToLower() + "' (updated: " + serviceRequestService.Updated + "). System service suspension value is '" + service2.ServiceSuspension.ToString().ToLower() + "' (updated: " + service2.Updated + "). ");
 135:   
 136:                          isSuspended = service2.ServiceSuspension;
 137:                          serviceLastUpdated = service2.Updated;
 138:                      }
 139:                      else
 140:                      {
 141:                          result.AddError("Service and/or service request service record for '" + service + "' does not exist. ");
 142:                      }
 143:                  }
 144:                  else
 145:                  {
 146:                      result.AddError(@"The number '" + service + @"' does not belong to the network (الرقم لا ينتمي للشبكة). ");
 147:                  }
 148:              }
 149:              else
 150:              {
 151:                  result.AddError("You are not authorized to read this value (لست مخولاً بقراءة هذه القيمة). ");
 152:              }
 153:          }
 154:   
 155:          ////////////////////////////////////////////////////////////////////////////
 156:   
 157:          /// <summary>
 158:          /// Update service-request-service table with data from service requests
 159:          /// </summary>
 160:          public static void UpdateForServiceRequestIdRange(Tuple<int, int> startEndRange, out string result)
 161:          {
 162:              List<int> numberList;
 163:              List<Ia.Ngn.Cl.Model.ServiceRequest> serviceRequestList;
 164:   
 165:              // 1. Read all SRs for this range
 166:              serviceRequestList = Ia.Ngn.Cl.Model.Data.ServiceRequest.ListWithinIdRange(startEndRange.Item1, startEndRange.Item2);
 167:   
 168:              // 2. Collect numbers in int format into int list
 169:              numberList = serviceRequestList.NumberList();
 170:   
 171:              UpdateForServiceList(numberList, out result);
 172:          }
 173:   
 174:          ////////////////////////////////////////////////////////////////////////////
 175:   
 176:          /// <summary>
 177:          ///
 178:          /// </summary>
 179:          public static void UpdateForService(string service, out string result)
 180:          {
 181:              List<int> numberList;
 182:   
 183:              numberList = new List<int>();
 184:   
 185:              if (int.TryParse(service, out int i))
 186:              {
 187:                  numberList.Add(i);
 188:   
 189:                  UpdateForServiceList(numberList, out result);
 190:              }
 191:              else
 192:              {
 193:                  result = "Error: service: " + service + " is not in integer format. ";
 194:              }
 195:          }
 196:   
 197:          ////////////////////////////////////////////////////////////////////////////
 198:   
 199:          /// <summary>
 200:          /// Update service-request-service table with service list
 201:          /// </summary>
 202:          public static void UpdateForServiceList(List<int> numberList, out string result)
 203:          {
 204:              string r0, r1, r2;
 205:              List<int> number1List;
 206:              List<string> serviceList, service1List, service2List;
 207:              List<Ia.Ngn.Cl.Model.ServiceRequestType> serviceRequestTypeList;
 208:              List<Ia.Ngn.Cl.Model.ServiceRequest> serviceRequestList;
 209:              List<Ia.Ngn.Cl.Model.ServiceRequestHistory> serviceRequestHistoryList;
 210:              List<Ia.Ngn.Cl.Model.ServiceRequestService> serviceRequestServiceList, serviceRequestService1List, serviceRequestService2List;
 211:   
 212:              r0 = r1 = r2 = string.Empty;
 213:   
 214:              using (var db = new Ia.Ngn.Cl.Model.Ngn()) // important to enable usage of Include from different functions
 215:              {
 216:                  // SR
 217:                  // 3. Collect numbers in int format into int list
 218:                  number1List = Ia.Ngn.Cl.Model.Data.ServiceRequest.NumberAndChangedAndChangedToList(numberList);
 219:   
 220:                  if (number1List.Count > 0)
 221:                  {
 222:                      // 6 Read all SRs related to collected numbers
 223:                      serviceRequestList = Ia.Ngn.Cl.Model.Data.ServiceRequest.List(number1List);
 224:   
 225:                      // 7. Read all SRTs related to collected numbers
 226:                      serviceRequestTypeList = Ia.Ngn.Cl.Model.Data.ServiceRequestType.List(number1List);
 227:   
 228:                      // 8. Collect numbers in string format into int list
 229:                      service1List = (from n in number1List select n.ToString()).ToList<string>();
 230:   
 231:                      serviceRequestService1List = ServiceRequestServiceFromServiceRequest(serviceRequestList, serviceRequestTypeList);
 232:   
 233:                      // 12. Remove duplicates (Linq orderyby boolean See http://stackoverflow.com/questions/9481054/linq-orderyby-boolean)
 234:                      serviceRequestService1List = serviceRequestService1List.OrderByDescending(u => u.Serial).OrderByDescending(u => u.Provisioned).OrderByDescending(u => u.LastRequestDateTime).GroupBy(u => u.Id).Select(u => u.First()).ToList();
 235:                  }
 236:                  else
 237:                  {
 238:                      serviceRequestList = new List<Ia.Ngn.Cl.Model.ServiceRequest>();
 239:                      serviceRequestTypeList = new List<Ia.Ngn.Cl.Model.ServiceRequestType>();
 240:                      service1List = new List<string>();
 241:   
 242:                      serviceRequestService1List = new List<Ia.Ngn.Cl.Model.ServiceRequestService>();
 243:                  }
 244:   
 245:                  // SRH
 246:                  // 9. Read all SRHs related to collected numbers
 247:                  serviceRequestHistoryList = Ia.Ngn.Cl.Model.Data.ServiceRequestHistory.List(numberList);
 248:   
 249:                  // 8. Collect numbers in string format into int list
 250:                  service2List = (from n in numberList select n.ToString()).ToList<string>();
 251:   
 252:                  if (serviceRequestHistoryList.Count > 0)
 253:                  {
 254:                      serviceRequestService2List = ServiceRequestServiceFromServiceRequestHistory(serviceRequestHistoryList);
 255:   
 256:                      // 12. Remove duplicates (Linq orderyby boolean See http://stackoverflow.com/questions/9481054/linq-orderyby-boolean)
 257:                      serviceRequestService2List = serviceRequestService2List.OrderByDescending(u => u.Serial).OrderByDescending(u => u.Provisioned).OrderByDescending(u => u.LastRequestDateTime).GroupBy(u => u.Id).Select(u => u.First()).ToList();
 258:                  }
 259:                  else
 260:                  {
 261:                      serviceRequestService2List = new List<Ia.Ngn.Cl.Model.ServiceRequestService>();
 262:                  }
 263:   
 264:                  if (serviceRequestService1List.Count > 0)
 265:                  {
 266:                      serviceRequestServiceList = serviceRequestService1List;
 267:                      serviceList = service1List;
 268:   
 269:                      /*
 270:                      serviceRequestServiceList = new List<Ia.Ngn.Cl.Model.ServiceRequestService>();
 271:  
 272:                      foreach (var v in serviceRequestService1List) serviceRequestServiceList.Add(v);
 273:  
 274:                      if (serviceRequestService2List.Count > 0)
 275:                      {
 276:                          serviceList = service1List.Union(service2List).ToList();
 277:  
 278:                          foreach (var v in serviceRequestService2List)
 279:                          {
 280:                              if (!serviceRequestServiceList.Any(u => u.Id == v.Id))
 281:                              {
 282:                                  serviceRequestServiceList.Add(v);
 283:                              }
 284:                          }
 285:                      }
 286:                      else
 287:                      {
 288:                          serviceList = service1List;
 289:                      }
 290:                      */
 291:                  }
 292:                  else
 293:                  {
 294:                      serviceRequestServiceList = serviceRequestService2List;
 295:                      serviceList = service2List;
 296:                  }
 297:   
 298:                  // 13. Update service request services
 299:                  Ia.Ngn.Cl.Model.Data.ServiceRequestService.UpdateWithServiceList(serviceList, serviceRequestServiceList, out r1);
 300:   
 301:                  // 14. Update service requests with SRS foreign keys
 302:                  Ia.Ngn.Cl.Model.Data.ServiceRequest.UpdateWithServiceList(serviceList, serviceRequestList, out r2);
 303:              }
 304:   
 305:              result = r1 + " " + r2;
 306:          }
 307:   
 308:          ////////////////////////////////////////////////////////////////////////////
 309:   
 310:          /// <summary>
 311:          ///
 312:          /// </summary>
 313:          public static List<Ia.Ngn.Cl.Model.ServiceRequestService> ServiceRequestServiceFromServiceRequest(List<Ia.Ngn.Cl.Model.ServiceRequest> serviceRequestList, List<Ia.Ngn.Cl.Model.ServiceRequestType> serviceRequestTypeList)
 314:          {
 315:              int serial, serviceType, serviceId;
 316:              string service, serviceSerial, serviceRequestServiceId, changedToServiceNumber;
 317:              DateTime lastRequestDateTime;
 318:              Ia.Ngn.Cl.Model.ServiceRequestService serviceRequestService;
 319:              Dictionary<string, int> serviceToSerialDictionary;
 320:              List<Ia.Ngn.Cl.Model.ServiceRequestService> serviceRequestServiceList;
 321:   
 322:              serviceType = Ia.Ngn.Cl.Model.Business.Service.ServiceType.GponService;
 323:              lastRequestDateTime = DateTime.MinValue;
 324:              serviceRequestServiceList = new List<Ia.Ngn.Cl.Model.ServiceRequestService>(serviceRequestList.Count);
 325:              serviceToSerialDictionary = new Dictionary<string, int>();
 326:   
 327:              // 11. Loop through all sr records by request id ascending
 328:              var list = serviceRequestList.OrderBy(p => p.RequestDateTime.Date).ThenBy(p => p.ServiceId == 38).ThenBy(p => p.Id); // <service id="38" arabicName="مجموعة الخدمات" />
 329:              foreach (Ia.Ngn.Cl.Model.ServiceRequest serviceRequest in list) // serviceRequestList.OrderBy(p => p.Id))
 330:              {
 331:                  if (Ia.Ngn.Cl.Model.Business.Authority.ServiceRequestIsAllowedProcessing(serviceRequest))
 332:                  {
 333:                      if (serviceRequest.ServiceCategoryId == 3)
 334:                      {
 335:                          // <category id="3" arabicName="هاتف" />
 336:   
 337:                          if (serviceRequest.Status == 2003 || serviceRequest.Status == 2005)
 338:                          {
 339:                              // <status id="2003" arabicName="قيد التنفيذ" />
 340:                              // <status id="2005" arabicName="تم التنفيذ" />
 341:   
 342:                              service = serviceRequest.Number.ToString();
 343:                              serial = serviceRequest.Serial;
 344:                              serviceId = serviceRequest.ServiceId;
 345:                              serviceSerial = service + ":" + serial;
 346:   
 347:                              serviceRequestServiceId = Ia.Ngn.Cl.Model.Business.ServiceRequestService.ServiceRequestServiceId(service, serviceType);
 348:   
 349:                              serviceRequestService = (from srs in serviceRequestServiceList where srs.Id == serviceRequestServiceId select srs).OrderByDescending(u => u.Serial).OrderByDescending(u => u.LastRequestDateTime).GroupBy(u => u.Id).Select(u => u.First()).FirstOrDefault(); //.SingleOrDefault();
 350:   
 351:                              if (serviceRequestService == null || serviceRequestService.Provisioned == false)
 352:                              {
 353:                                  if (serviceId == 1 || serviceId == 129 || serviceId == 54)
 354:                                  {
 355:                                      // <service id="1" arabicName="خط هاتف" />
 356:                                      // <service id="129" arabicName="خط هاتف مع نداء آلي"/>
 357:                                      // <service id="54" arabicName="اعادة تركيب" />
 358:   
 359:                                      serviceRequestService = new Ia.Ngn.Cl.Model.ServiceRequestService();
 360:   
 361:                                      serviceRequestService.Id = serviceRequestServiceId;
 362:                                      serviceRequestService.Service = service;
 363:                                      serviceRequestService.Serial = serial;
 364:                                      serviceRequestService.AreaCode = Ia.Ngn.Cl.Model.Business.Service.CountryCode;
 365:                                      serviceRequestService.ServiceType = serviceType;
 366:                                      serviceRequestService.Provisioned = true;
 367:   
 368:                                      TelephonyService(serviceRequest, serviceRequestTypeList, ref serviceRequestService);
 369:   
 370:                                      serviceRequestServiceList.Add(serviceRequestService);
 371:                                      serviceRequest.ServiceRequestService = serviceRequestService;
 372:   
 373:                                      lastRequestDateTime = serviceRequest.RequestDateTime;
 374:                                      if (serviceRequestService.LastRequestDateTime < lastRequestDateTime) serviceRequestService.LastRequestDateTime = lastRequestDateTime;
 375:                                  }
 376:                                  else
 377:                                  {
 378:                                      // incomplete service request list for serial
 379:                                  }
 380:                              }
 381:                              else
 382:                              {
 383:                                  if (serviceRequestService.Provisioned && serviceRequestService.Serial == serial)
 384:                                  {
 385:                                      if (serviceRequest.ServiceId == 41)
 386:                                      {
 387:                                          // <service id="41" arabicName="تغيير رقم" />
 388:   
 389:                                          // below: <type id="11" name="dn" arabicName="dn" oracleFieldName="الرقم الجديد"/>
 390:                                          changedToServiceNumber = (from srt in serviceRequestTypeList where srt.ServiceRequest.Id == serviceRequest.Id && srt.TypeId == 11 && srt.Value != null select srt.Value).SingleOrDefault();
 391:   
 392:                                          if (Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedDomainList(changedToServiceNumber)) // important because some numbers are null
 393:                                          {
 394:                                              serviceRequestService.Id = Ia.Ngn.Cl.Model.Business.ServiceRequestService.ServiceRequestServiceId(changedToServiceNumber, serviceType);
 395:                                              serviceRequestService.Service = changedToServiceNumber;
 396:   
 397:                                              // below: you must assign a serial that is an increment of any previously existing serial for the changed-to number, or 0 of non
 398:                                              serviceRequestService.Serial = serviceToSerialDictionary.ContainsKey(changedToServiceNumber) ? serviceToSerialDictionary[changedToServiceNumber] + 1 : 0;
 399:                                          }
 400:                                          else
 401:                                          {
 402:   
 403:                                          }
 404:                                      }
 405:                                      else
 406:                                      {
 407:                                          TelephonyService(serviceRequest, serviceRequestTypeList, ref serviceRequestService);
 408:                                      }
 409:   
 410:                                      lastRequestDateTime = serviceRequest.RequestDateTime;
 411:                                      if (serviceRequestService.LastRequestDateTime < lastRequestDateTime) serviceRequestService.LastRequestDateTime = lastRequestDateTime;
 412:                                  }
 413:   
 414:                                  serviceRequest.ServiceRequestService = serviceRequestService;
 415:                              }
 416:   
 417:                              if(serviceRequestService != null) serviceToSerialDictionary[serviceRequestService.Service] = serviceRequestService.Serial;
 418:                          }
 419:                          else
 420:                          {
 421:                          }
 422:                      }
 423:                  }
 424:              }
 425:   
 426:              return serviceRequestServiceList;
 427:          }
 428:   
 429:          ////////////////////////////////////////////////////////////////////////////
 430:   
 431:          /// <summary>
 432:          ///
 433:          /// </summary>
 434:          public static List<Ia.Ngn.Cl.Model.ServiceRequestService> ServiceRequestServiceFromServiceRequestHistory(List<Ia.Ngn.Cl.Model.ServiceRequestHistory> serviceRequestHistoryList)
 435:          {
 436:              int serial, status, serviceType, serviceId;
 437:              string service, serviceSerial, serviceIdIssue;
 438:              DateTime lastRequestDateTime;
 439:              Ia.Ngn.Cl.Model.ServiceRequestService serviceRequestService;
 440:              Ia.Ngn.Cl.Model.Business.ServiceSerialRequestService serviceSerialRequestService;
 441:              List<string> serviceSerialsToRemoveList;
 442:              List<Ia.Ngn.Cl.Model.Business.ServiceSerialRequestService> serviceSerialRequestServiceList;
 443:              List<Ia.Ngn.Cl.Model.ServiceRequestService> serviceRequestServiceList;
 444:              Dictionary<string, int> serviceToLastSerialDictionary;
 445:              Dictionary<string, Ia.Ngn.Cl.Model.Business.ServiceSerialRequestService> serviceRequestHistoryNumberSerialComplementaryServiceDictionary;
 446:   
 447:              serviceType = Ia.Ngn.Cl.Model.Business.Service.ServiceType.GponService;
 448:              serviceIdIssue = string.Empty;
 449:              lastRequestDateTime = DateTime.MinValue;
 450:              serviceSerialsToRemoveList = new List<string>();
 451:              serviceSerialRequestServiceList = new List<Ia.Ngn.Cl.Model.Business.ServiceSerialRequestService>(serviceRequestHistoryList.Count);
 452:   
 453:              serviceToLastSerialDictionary = new Dictionary<string, int>(serviceRequestHistoryList.Count);
 454:   
 455:              serviceRequestHistoryNumberSerialComplementaryServiceDictionary = new Dictionary<string, Ia.Ngn.Cl.Model.Business.ServiceSerialRequestService>(serviceRequestHistoryList.Count);
 456:   
 457:   
 458:              // 11. Loop through all srh records by request id ascending
 459:   
 460:              // build service request service from service request histories.
 461:              var list2 = serviceRequestHistoryList.OrderBy(p => p.ServiceDateTime.Date).ThenBy(p => p.ServiceId == 38); // <service id="38" arabicName="مجموعة الخدمات" />
 462:              foreach (var serviceRequestHistory in list2)
 463:              {
 464:                  if (serviceRequestHistory.ServiceCategoryId == 3)
 465:                  {
 466:                      // <category id="3" arabicName="هاتف" />
 467:                      service = serviceRequestHistory.Number.ToString();
 468:                      serial = serviceRequestHistory.Serial;
 469:                      serviceId = serviceRequestHistory.ServiceId;
 470:                      status = serviceRequestHistory.Status;
 471:   
 472:                      serviceSerial = service + ":" + serial;
 473:   
 474:                      if (serviceToLastSerialDictionary.ContainsKey(service))
 475:                      {
 476:                          if (serviceToLastSerialDictionary[service] < serial) serviceToLastSerialDictionary[service] = serial;
 477:                      }
 478:                      else serviceToLastSerialDictionary[service] = serial;
 479:   
 480:                      if (!serviceRequestHistoryNumberSerialComplementaryServiceDictionary.ContainsKey(serviceSerial) || serviceRequestHistoryNumberSerialComplementaryServiceDictionary.ContainsKey(serviceSerial) && serviceRequestHistoryNumberSerialComplementaryServiceDictionary[serviceSerial].Provisioned == false)
 481:                      {
 482:                          if (serviceId == 1 || serviceId == 129 || serviceId == 54)
 483:                          {
 484:                              // <service id="1" arabicName="خط هاتف" />
 485:                              // <service id="129" arabicName="خط هاتف مع نداء آلي"/>
 486:                              // <service id="54" arabicName="اعادة تركيب" />
 487:   
 488:                              serviceSerialRequestService = new Ia.Ngn.Cl.Model.Business.ServiceSerialRequestService();
 489:   
 490:                              serviceSerialRequestService.Id = serviceSerial;
 491:                              serviceSerialRequestService.Service = service;
 492:                              serviceSerialRequestService.Serial = serial;
 493:                              serviceSerialRequestService.Provisioned = true;
 494:   
 495:                              serviceRequestHistoryNumberSerialComplementaryServiceDictionary[serviceSerial] = serviceSerialRequestService;
 496:   
 497:                              lastRequestDateTime = serviceRequestHistory.ServiceDateTime;
 498:                          }
 499:                          else
 500:                          {
 501:                              // incomplete service request list for serial
 502:                          }
 503:                      }
 504:                      else
 505:                      {
 506:                          if (serviceRequestHistoryNumberSerialComplementaryServiceDictionary[serviceSerial].Provisioned && serviceRequestHistoryNumberSerialComplementaryServiceDictionary[serviceSerial].Serial == serial)
 507:                          {
 508:                              if (serviceId == 41)
 509:                              {
 510:                                  // <service id="41" arabicName="تغيير رقم" />
 511:                              }
 512:                              else
 513:                              {
 514:                                  Ia.Ngn.Cl.Model.Business.ServiceRequestService.TelephonyService2(ref serviceRequestHistoryNumberSerialComplementaryServiceDictionary, serviceSerial, status, serviceId, ref serviceIdIssue);
 515:                              }
 516:   
 517:                              lastRequestDateTime = serviceRequestHistory.ServiceDateTime;
 518:                          }
 519:                      }
 520:                  }
 521:              }
 522:   
 523:              // collect all numbers serials that are not the last in their serial series:
 524:              foreach (KeyValuePair<string, Ia.Ngn.Cl.Model.Business.ServiceSerialRequestService> kvp in serviceRequestHistoryNumberSerialComplementaryServiceDictionary)
 525:              {
 526:                  if (serviceToLastSerialDictionary.ContainsKey(kvp.Value.Service))
 527:                  {
 528:                      if (serviceToLastSerialDictionary[kvp.Value.Service] > kvp.Value.Serial) serviceSerialsToRemoveList.Add(kvp.Key);
 529:                  }
 530:                  else
 531:                  {
 532:                      serviceIdIssue += "Error: serviceToLastSerialDictionary does not contain kvp.Value.Service: " + kvp.Value.Service + "\r\n";
 533:                  }
 534:              }
 535:   
 536:              // remove previous service-serials
 537:              foreach (string s in serviceSerialsToRemoveList)
 538:              {
 539:                  serviceRequestHistoryNumberSerialComplementaryServiceDictionary.Remove(s);
 540:              }
 541:   
 542:              // construct serviceRequestServiceList from dictionary
 543:              serviceRequestServiceList = new List<Ia.Ngn.Cl.Model.ServiceRequestService>();
 544:   
 545:              foreach (KeyValuePair<string, Ia.Ngn.Cl.Model.Business.ServiceSerialRequestService> kvp in serviceRequestHistoryNumberSerialComplementaryServiceDictionary)
 546:              {
 547:                  serviceRequestService = new Model.ServiceRequestService()
 548:                  {
 549:                      Id = kvp.Value.Service + ":1:965",
 550:                      Service = kvp.Value.Service,
 551:                      Serial = kvp.Value.Serial,
 552:                      Provisioned = kvp.Value.Provisioned,
 553:                      CallWaiting = kvp.Value.CallWaiting,
 554:                      InternationalCallingUserControlled = kvp.Value.InternationalCallingUserControlled,
 555:                      CallerId = kvp.Value.CallerId,
 556:                      CallForwarding = kvp.Value.CallForwarding,
 557:                      CallBarring = kvp.Value.CallBarring,
 558:                      ConferenceCall = kvp.Value.ConferenceCall,
 559:                      AbbriviatedCalling = kvp.Value.AbbriviatedCalling,
 560:                      InternationalCalling = kvp.Value.InternationalCalling,
 561:                      AlarmCall = kvp.Value.AlarmCall,
 562:                      WakeupCall = kvp.Value.WakeupCall,
 563:                      BarringOfAllOutgoingCalls = kvp.Value.BarringOfAllOutgoingCalls,
 564:                      BarringOfAllIncomingCalls = kvp.Value.BarringOfAllIncomingCalls,
 565:                      LastRequestDateTime = lastRequestDateTime
 566:                  };
 567:   
 568:                  serviceRequestServiceList.Add(serviceRequestService);
 569:              }
 570:   
 571:              return serviceRequestServiceList;
 572:          }
 573:   
 574:          ////////////////////////////////////////////////////////////////////////////
 575:   
 576:          /// <summary>
 577:          ///
 578:          /// </summary>
 579:          private static void TelephonyService(Ia.Ngn.Cl.Model.ServiceRequest serviceRequest, List<Ia.Ngn.Cl.Model.ServiceRequestType> serviceRequestTypeList, ref Ia.Ngn.Cl.Model.ServiceRequestService serviceRequestService)
 580:          {
 581:              Ia.Ngn.Cl.Model.Access access;
 582:   
 583:              if (serviceRequest.ServiceId == 1 || serviceRequest.ServiceId == 129 || serviceRequest.ServiceId == 39 || serviceRequest.ServiceId == 54)
 584:              {
 585:                  // <service id="1" arabicName="خط هاتف" />
 586:                  // <service id="129" arabicName="خط هاتف مع نداء آلي"/>
 587:                  // <service id="39" arabicName="نقل خارجى" />
 588:                  // <service id="54" arabicName="اعادة تركيب" />
 589:   
 590:                  if (serviceRequest.ServiceId == 1 || serviceRequest.ServiceId == 129 || serviceRequest.ServiceId == 54)
 591:                  {
 592:                      // <service id="1" arabicName="خط هاتف" />
 593:                      // <service id="129" arabicName="خط هاتف مع نداء آلي"/>
 594:                      // <service id="54" arabicName="اعادة تركيب" />
 595:   
 596:                      // below: keep this here and don't move it out to accommodate 39
 597:                      using (var db = new Ia.Ngn.Cl.Model.Ngn())
 598:                      {
 599:                          // important: ServiceRequestService.Update() will only update stored.Access if it is null, or (stored.userId == Guid.Empty && update.Id > stored.Id)
 600:                          access = Ia.Ngn.Cl.Model.Business.ServiceRequestType.ExtractAccess(serviceRequest.Id, serviceRequestTypeList);
 601:   
 602:                          if (access != null) serviceRequestService.Access = (from a in db.Accesses where a.Id == access.Id select a).SingleOrDefault();
 603:                          else serviceRequestService.Access = null;
 604:                          /*
 605:                           * I will not use statistical estimation for incomplete workorders
 606:                          else
 607:                          {
 608:                              serviceAddress = Ia.Ngn.Cl.Model.Business.ServiceRequest.StatisticalServiceAddress(serviceRequestService.Service, serviceRequest.CustomerAddress, out level);
 609:  
 610:                              if (serviceAddress != null)
 611:                              {
 612:                                  accessList = (from a in db.Accesses where a.AreaId == serviceAddress.AreaId select a).ToList();
 613:  
 614:                                  access = Ia.Ngn.Cl.Model.Data.Access.StatisticalAccess(serviceAddress, ref accessList);
 615:  
 616:                                  if (access != null)
 617:                                  {
 618:                                      serviceRequestService.Access = (from a in db.Accesses where a.Id == access.Id select a).SingleOrDefault();
 619:                                  }
 620:                                  else serviceRequestService.Access = null;
 621:                              }
 622:                              else serviceRequestService.Access = null;
 623:                          }
 624:                          */
 625:                      }
 626:   
 627:                      serviceRequestService.CallerId = false;
 628:   
 629:                      serviceRequestService.AlarmCall = false;
 630:                      serviceRequestService.WakeupCall = false;
 631:   
 632:                      ///serviceRequestService.InternationalCallingUserControlled = true; // as requested by MOC NGN management
 633:                      serviceRequestService.CallWaiting = false;
 634:                      serviceRequestService.CallForwarding = false;
 635:                      serviceRequestService.ConferenceCall = false;
 636:                      serviceRequestService.CallBarring = false;
 637:   
 638:                      if (serviceRequest.ServiceId == 1 || serviceRequest.ServiceId == 54) serviceRequestService.InternationalCalling = false;
 639:                      else if (serviceRequest.ServiceId == 129) serviceRequestService.InternationalCalling = true;
 640:                  }
 641:                  else if (serviceRequest.ServiceId == 39)
 642:                  {
 643:                      // <service id="39" arabicName="نقل خارجى" />
 644:   
 645:                      using (var db = new Ia.Ngn.Cl.Model.Ngn())
 646:                      {
 647:                          // important: ServiceRequestService.Update() will only update stored.Access if it is null, or (stored.userId == Guid.Empty && update.Id > stored.Id)
 648:                          access = Ia.Ngn.Cl.Model.Business.ServiceRequestType.ExtractAccess(serviceRequest.Id, serviceRequestTypeList);
 649:   
 650:                          if (access != null) serviceRequestService.Access = (from a in db.Accesses where a.Id == access.Id select a).SingleOrDefault();
 651:                          //else serviceRequestService.Access = null;
 652:                      }
 653:                  }
 654:              }
 655:              else
 656:              {
 657:                  switch (serviceRequest.ServiceId)
 658:                  {
 659:                      // below: <service id="40" arabicName="رفع خط" />
 660:                      case 40:
 661:                          {
 662:                              // will reset all to false
 663:   
 664:                              serviceRequestService.Provisioned = false;
 665:   
 666:                              serviceRequestService.CallerId = false;
 667:                              serviceRequestService.AlarmCall = false;
 668:                              serviceRequestService.WakeupCall = false;
 669:                              serviceRequestService.InternationalCallingUserControlled = false;
 670:                              serviceRequestService.CallWaiting = false;
 671:                              serviceRequestService.CallForwarding = false;
 672:                              serviceRequestService.ConferenceCall = false;
 673:                              serviceRequestService.CallBarring = false;
 674:                              serviceRequestService.InternationalCalling = false;
 675:   
 676:                              break;
 677:                          }
 678:   
 679:                      // below: <service id="131" arabicName="خط ذهبي"/>
 680:                      case 131: { break; }
 681:   
 682:                      // below: <service id="132" arabicName="خط فضي"/>
 683:                      case 132: { break; }
 684:   
 685:                      // below: <service id="133" arabicName="خط برونزي"/>
 686:                      case 133: { break; }
 687:   
 688:                      // below: <service id="12" arabicName="خدمة الإنتظار" />
 689:                      case 12: { serviceRequestService.CallWaiting = true; break; }
 690:   
 691:                      // below: <service id="68" arabicName="إيقاف خدمة الإنتظار" />
 692:                      case 68: { serviceRequestService.CallWaiting = false; break; }
 693:   
 694:                      // below: <service id="13" arabicName="التحكم بالصفر الدولي" />
 695:                      case 13: { serviceRequestService.InternationalCallingUserControlled = true; break; }
 696:   
 697:                      // below: <service id="67" arabicName="وقف التحكم بالصفر" />
 698:                      case 67: { serviceRequestService.InternationalCallingUserControlled = false; break; }
 699:   
 700:                      // below: <service id="14" arabicName="كاشف رقم" />
 701:                      case 14: { serviceRequestService.CallerId = true; break; }
 702:   
 703:                      // below: <service id="66" arabicName="إيقاف كاشف" />
 704:                      case 66: { serviceRequestService.CallerId = false; break; }
 705:   
 706:                      // below: <service id="5" arabicName="تحويل مكالمات" />
 707:                      case 5: { serviceRequestService.CallForwarding = true; break; }
 708:   
 709:                      // below: <service id="75" arabicName="إيقاف التحويل" />
 710:                      case 75: { serviceRequestService.CallForwarding = false; break; }
 711:   
 712:                      // below: <service id="20" arabicName="النداء الآلي" />
 713:                      case 20: { serviceRequestService.InternationalCalling = true; break; }
 714:   
 715:                      // below: <service id="19" arabicName="قطع النداء الآلي" />
 716:                      case 19: { serviceRequestService.InternationalCalling = false; break; }
 717:   
 718:                      // below: <service id="38" arabicName="مجموعة الخدمات" />
 719:                      case 38:
 720:                          {
 721:                              serviceRequestService.CallerId = true;
 722:   
 723:                              serviceRequestService.AlarmCall = true;
 724:                              serviceRequestService.WakeupCall = true;
 725:   
 726:                              //serviceRequestService.InternationalCallingUserControlled = true;
 727:                              serviceRequestService.CallWaiting = true;
 728:                              serviceRequestService.CallForwarding = true;
 729:                              serviceRequestService.ConferenceCall = true;
 730:                              break;
 731:                          }
 732:   
 733:                      // below: <service id="62" arabicName="إيقاف مجموعة الخدمات" />
 734:                      case 62:
 735:                          {
 736:                              serviceRequestService.CallerId = false;
 737:   
 738:                              serviceRequestService.AlarmCall = false;
 739:                              serviceRequestService.WakeupCall = false;
 740:   
 741:                              //serviceRequestService.InternationalCallingUserControlled = false;
 742:                              serviceRequestService.CallWaiting = false;
 743:                              serviceRequestService.CallForwarding = false;
 744:                              serviceRequestService.ConferenceCall = false;
 745:                              break;
 746:                          }
 747:   
 748:                      // below: <service id="52" arabicName="قطع حرارة" />
 749:                      case 52: { serviceRequestService.CallBarring = true; break; }
 750:   
 751:                      // below: <service id="53" arabicName="اعادة حرارة" />
 752:                      case 53: { serviceRequestService.CallBarring = false; break; }
 753:   
 754:                      // below: <service id="7" arabicName="منع الإتصال" />
 755:                      case 7: { serviceRequestService.BarringOfAllOutgoingCalls = true; break; }
 756:   
 757:                      // below: <service id="73" arabicName="إيقاف منع الإتصال" />
 758:                      case 73: { serviceRequestService.BarringOfAllOutgoingCalls = false; break; }
 759:   
 760:                      // below: <service id="8" arabicName="ايقاف استقبال" />
 761:                      case 8: { serviceRequestService.BarringOfAllIncomingCalls = true; break; }
 762:   
 763:                      // below: <service id="72" arabicName="رد استقبال" />
 764:                      case 72: { serviceRequestService.BarringOfAllIncomingCalls = false; break; }
 765:   
 766:                      // below: <service id="10" arabicName="خدمة الإيقاظ" />
 767:                      case 10:
 768:                          {
 769:                              serviceRequestService.AlarmCall = true;
 770:                              serviceRequestService.WakeupCall = true;
 771:                              break;
 772:                          }
 773:   
 774:                      // below: <service id="70" arabicName="إيقاف خدمة الإيقاظ" />
 775:                      case 70:
 776:                          {
 777:                              serviceRequestService.AlarmCall = false;
 778:                              serviceRequestService.WakeupCall = false;
 779:                              break;
 780:                          }
 781:   
 782:                      // below: <service id="6" arabicName="استشارة" />
 783:                      case 6: { serviceRequestService.ConferenceCall = true; break; }
 784:   
 785:                      // below: <service id="74" arabicName="إيقاف استشارة" />
 786:                      case 74: { serviceRequestService.ConferenceCall = false; break; }
 787:   
 788:                      // below: <service id="11" arabicName="إختصار الرقم" />
 789:                      case 11: { serviceRequestService.AbbriviatedCalling = true; break; }
 790:   
 791:                      // below: <service id="69" arabicName="إيقاف إختصار الرقم" />
 792:                      case 69: { serviceRequestService.AbbriviatedCalling = false; break; }
 793:   
 794:                      // below: <service id="55" arabicName="مفتاح بدالة" />
 795:                      case 55: { break; }
 796:   
 797:                      // below: <if id="60" name_ar="إيقاف مفتاح بدالة"...
 798:                      case 60: { break; }
 799:   
 800:                      // below: <if id="56" name_ar="فرع بدالة"...
 801:                      case 56: { break; }
 802:   
 803:                      // below: <if id="59" name_ar="إيقاف فرع بدالة"...
 804:                      case 59: { break; }
 805:   
 806:                      // below: <service id="64" arabicName="ايقاف التحويل الآلي/بدالة رئيس" />
 807:                      case 64: { break; }
 808:   
 809:                      // below: <service id="63" arabicName="ايقاف التحويل الآلي/بدالة فرع" />
 810:                      case 63: { break; }
 811:   
 812:                      // below: <service id="608" arabicName="خط رقمي دسل"/>
 813:                      case 608: { break; }
 814:   
 815:                      // below: <service id="609" arabicName="قطع خط رقمي دسل"/>
 816:                      case 609: { break; }
 817:   
 818:                      // below: <service id="15" arabicName="خدمة المحاسبة" />
 819:                      case 15: { break; }
 820:   
 821:                      // below: <service id="65" arabicName="إيقاف المحاسبة الذاتية" />
 822:                      case 65: { break; }
 823:   
 824:                      // below: <service id="271" arabicName="تغيير اسم"/>
 825:                      case 271: { break; }
 826:   
 827:                      // below: <service id="44" arabicName="تغيير نوع إشتراك" />
 828:                      case 44: { break; }
 829:   
 830:                      // below: <service id="42" arabicName="نقل داخلي" />
 831:                      case 42: { break; }
 832:   
 833:                      // below: <service id="46" arabicName="جهاز كاشف" />
 834:                      case 46: { break; }
 835:   
 836:                      // below: <service id="45" arabicName="تعديل اسم" />
 837:                      case 45: { break; }
 838:   
 839:                      // below: <service id="47" arabicName="جهاز تلفون" />
 840:                      case 47: { break; }
 841:   
 842:                      // below: <service id="49" arabicName="رسوم مودم" />
 843:                      case 49: { break; }
 844:   
 845:                      // below: <service id="37" arabicName="برقية" />
 846:                      case 37: { break; }
 847:   
 848:                      // below: <service id="23" arabicName="مكالمات مصلحية -دفع" />
 849:                      case 23: { break; }
 850:   
 851:                      // below: <service id="17" arabicName="نظام التحويل الآلي/بدالة رئيس" />
 852:                      case 17: { break; }
 853:   
 854:                      // below: <service id="18" arabicName="نظام التحويل الآلي/بدالة فرع" />
 855:                      case 18: { break; }
 856:   
 857:                      // below: <service id="3" arabicName="نداء عاجل" />
 858:                      case 3: { break; }
 859:   
 860:                      // below: <service id="22" arabicName="رسوم كابل" />
 861:                      case 22: { break; }
 862:   
 863:                      // below: <service id="61" arabicName="إيقاف إعادة تركيب" />
 864:                      case 61: { break; }
 865:   
 866:                      // below: <service id="43" arabicName="تنازل" />
 867:                      case 43:
 868:                          {
 869:                              serviceRequestService.Serial++;
 870:                              break;
 871:                          }
 872:   
 873:                      default:
 874:                          {
 875:                              log.AppendLine("TelephonyService(): For ServiceRequest.Number=" + serviceRequest.Number + " ServiceId=" + serviceRequest.ServiceId + " was not recognized. ");
 876:                              break;
 877:                          }
 878:                  }
 879:              }
 880:          }
 881:   
 882:          ////////////////////////////////////////////////////////////////////////////
 883:   
 884:          /// <summary>
 885:          /// 
 886:          /// </summary>
 887:          public static void TelephonyService2(ref Dictionary<string, Ia.Ngn.Cl.Model.Business.ServiceSerialRequestService> serviceRequestNumberSerialComplementaryServiceDictionary, string serviceSerial, int status, int serviceId, ref string serviceIdIssue)
 888:          {
 889:              if (serviceId == 1 || serviceId == 129 || serviceId == 39 || serviceId == 54)
 890:              {
 891:                  // <service id="1" arabicName="خط هاتف" />
 892:                  // <service id="129" arabicName="خط هاتف مع نداء آلي"/>
 893:                  // <service id="39" arabicName="نقل خارجى" />
 894:                  // <service id="54" arabicName="اعادة تركيب" />
 895:   
 896:                  if (serviceId == 1 || serviceId == 129 || serviceId == 54)
 897:                  {
 898:                      // <service id="1" arabicName="خط هاتف" />
 899:                      // <service id="129" arabicName="خط هاتف مع نداء آلي"/>
 900:                      // <service id="54" arabicName="اعادة تركيب" />
 901:   
 902:                      serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallerId = false;
 903:   
 904:                      serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].AlarmCall = false;
 905:                      serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].WakeupCall = false;
 906:   
 907:                      ///dic[id].InternationalCallingUserControlled = true; // as requested by NGN management
 908:                      serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallWaiting = false;
 909:                      serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallForwarding = false;
 910:                      serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].ConferenceCall = false;
 911:                      serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallBarring = false;
 912:   
 913:                      if (serviceId == 1 || serviceId == 54) serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCalling = false;
 914:                      else if (serviceId == 129) serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCalling = true;
 915:                  }
 916:                  else if (serviceId == 39)
 917:                  {
 918:                      // <service id="39" arabicName="نقل خارجى" />
 919:                  }
 920:              }
 921:              else
 922:              {
 923:                  switch (serviceId)
 924:                  {
 925:                      // below: <service id="40" arabicName="رفع خط" />
 926:                      case 40:
 927:                          {
 928:                              // - For SRH issues, I will ignore the service رفع خط (<service id="40" arabicName="رفع خط" />) if the number is يعمل (systemCode[7001] = "يعمل") (e.g. 25426947) or number is قطع مبرمج (systemCode[7003] = "قطع مبرمج") (e.g. 25417139)
 929:                              // - Note that status is specific to SRH
 930:   
 931:                              if (status == 7001 || status == 7003) { }
 932:                              else
 933:                              {
 934:                                  // - Will reset all to false
 935:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].Provisioned = false;
 936:   
 937:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallerId = false;
 938:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].AlarmCall = false;
 939:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].WakeupCall = false;
 940:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCallingUserControlled = false;
 941:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallWaiting = false;
 942:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallForwarding = false;
 943:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].ConferenceCall = false;
 944:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallBarring = false;
 945:                                  serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCalling = false;
 946:                              }
 947:                              break;
 948:                          }
 949:   
 950:                      // below: <service id="131" arabicName="خط ذهبي"/>
 951:                      case 131: { break; }
 952:   
 953:                      // below: <service id="132" arabicName="خط فضي"/>
 954:                      case 132: { break; }
 955:   
 956:                      // below: <service id="133" arabicName="خط برونزي"/>
 957:                      case 133: { break; }
 958:   
 959:                      // below: <service id="12" arabicName="خدمة الإنتظار" />
 960:                      case 12: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallWaiting = true; break; }
 961:   
 962:                      // below: <service id="68" arabicName="إيقاف خدمة الإنتظار" />
 963:                      case 68: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallWaiting = false; break; }
 964:   
 965:                      // below: <service id="13" arabicName="التحكم بالصفر الدولي" />
 966:                      case 13: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCallingUserControlled = true; break; }
 967:   
 968:                      // below: <service id="67" arabicName="وقف التحكم بالصفر" />
 969:                      case 67: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCallingUserControlled = false; break; }
 970:   
 971:                      // below: <service id="14" arabicName="كاشف رقم" />
 972:                      case 14: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallerId = true; break; }
 973:   
 974:                      // below: <service id="66" arabicName="إيقاف كاشف" />
 975:                      case 66: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallerId = false; break; }
 976:   
 977:                      // below: <service id="5" arabicName="تحويل مكالمات" />
 978:                      case 5: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallForwarding = true; break; }
 979:   
 980:                      // below: <service id="75" arabicName="إيقاف التحويل" />
 981:                      case 75: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallForwarding = false; break; }
 982:   
 983:                      // below: <service id="20" arabicName="النداء الآلي" />
 984:                      case 20: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCalling = true; break; }
 985:   
 986:                      // below: <service id="19" arabicName="قطع النداء الآلي" />
 987:                      case 19: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCalling = false; break; }
 988:   
 989:                      // below: <service id="38" arabicName="مجموعة الخدمات" />
 990:                      case 38:
 991:                          {
 992:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallerId = true;
 993:   
 994:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].AlarmCall = true;
 995:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].WakeupCall = true;
 996:   
 997:                              // serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCallingUserControlled = true;
 998:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallWaiting = true;
 999:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallForwarding = true;
1000:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].ConferenceCall = true;
1001:   
1002:                              break;
1003:                          }
1004:   
1005:                      // below: <service id="62" arabicName="إيقاف مجموعة الخدمات" />
1006:                      case 62:
1007:                          {
1008:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallerId = false;
1009:   
1010:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].AlarmCall = false;
1011:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].WakeupCall = false;
1012:   
1013:                              //serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].InternationalCallingUserControlled = false;
1014:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallWaiting = false;
1015:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallForwarding = false;
1016:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].ConferenceCall = false;
1017:   
1018:                              break;
1019:                          }
1020:   
1021:                      // below: <service id="52" arabicName="قطع حرارة" />
1022:                      case 52: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallBarring = true; break; }
1023:   
1024:                      // below: <service id="53" arabicName="اعادة حرارة" />
1025:                      case 53: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].CallBarring = false; break; }
1026:   
1027:                      // below: <service id="7" arabicName="منع الإتصال" />
1028:                      case 7: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].BarringOfAllOutgoingCalls = true; break; }
1029:   
1030:                      // below: <service id="73" arabicName="إيقاف منع الإتصال" />
1031:                      case 73: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].BarringOfAllOutgoingCalls = false; break; }
1032:   
1033:                      // below: <service id="8" arabicName="ايقاف استقبال" />
1034:                      case 8: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].BarringOfAllIncomingCalls = true; break; }
1035:   
1036:                      // below: <service id="72" arabicName="رد استقبال" />
1037:                      case 72: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].BarringOfAllIncomingCalls = false; break; }
1038:   
1039:                      // below: <service id="10" arabicName="خدمة الإيقاظ" />
1040:                      case 10:
1041:                          {
1042:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].AlarmCall = true;
1043:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].WakeupCall = true;
1044:                              break;
1045:                          }
1046:   
1047:                      // below: <service id="70" arabicName="إيقاف خدمة الإيقاظ" />
1048:                      case 70:
1049:                          {
1050:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].AlarmCall = false;
1051:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].WakeupCall = false;
1052:                              break;
1053:                          }
1054:   
1055:                      // below: <service id="6" arabicName="استشارة" />
1056:                      case 6: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].ConferenceCall = true; break; }
1057:   
1058:                      // below: <service id="74" arabicName="إيقاف استشارة" />
1059:                      case 74: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].ConferenceCall = false; break; }
1060:   
1061:                      // below: <service id="11" arabicName="إختصار الرقم" />
1062:                      case 11: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].AbbriviatedCalling = true; break; }
1063:   
1064:                      // below: <service id="69" arabicName="إيقاف إختصار الرقم" />
1065:                      case 69: { serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].AbbriviatedCalling = false; break; }
1066:   
1067:                      // below: <service id="55" arabicName="مفتاح بدالة" />
1068:                      case 55: { break; }
1069:   
1070:                      // below: <if id="60" name_ar="إيقاف مفتاح بدالة"...
1071:                      case 60: { break; }
1072:   
1073:                      // below: <if id="56" name_ar="فرع بدالة"...
1074:                      case 56: { break; }
1075:   
1076:                      // below: <if id="59" name_ar="إيقاف فرع بدالة"...
1077:                      case 59: { break; }
1078:   
1079:                      // below: <service id="64" arabicName="ايقاف التحويل الآلي/بدالة رئيس" />
1080:                      case 64: { break; }
1081:   
1082:                      // below: <service id="63" arabicName="ايقاف التحويل الآلي/بدالة فرع" />
1083:                      case 63: { break; }
1084:   
1085:                      // below: <service id="608" arabicName="خط رقمي دسل"/>
1086:                      case 608: { break; }
1087:   
1088:                      // below: <service id="609" arabicName="قطع خط رقمي دسل"/>
1089:                      case 609: { break; }
1090:   
1091:                      // below: <service id="15" arabicName="خدمة المحاسبة" />
1092:                      case 15: { break; }
1093:   
1094:                      // below: <service id="65" arabicName="إيقاف المحاسبة الذاتية" />
1095:                      case 65: { break; }
1096:   
1097:                      // below: <service id="271" arabicName="تغيير اسم"/>
1098:                      case 271: { break; }
1099:   
1100:                      // below: <service id="44" arabicName="تغيير نوع إشتراك" />
1101:                      case 44: { break; }
1102:   
1103:                      // below: <service id="42" arabicName="نقل داخلي" />
1104:                      case 42: { break; }
1105:   
1106:                      // below: <service id="46" arabicName="جهاز كاشف" />
1107:                      case 46: { break; }
1108:   
1109:                      // below: <service id="45" arabicName="تعديل اسم" />
1110:                      case 45: { break; }
1111:   
1112:                      // below: <service id="47" arabicName="جهاز تلفون" />
1113:                      case 47: { break; }
1114:   
1115:                      // below: <service id="49" arabicName="رسوم مودم" />
1116:                      case 49: { break; }
1117:   
1118:                      // below: <service id="37" arabicName="برقية" />
1119:                      case 37: { break; }
1120:   
1121:                      // below: <service id="23" arabicName="مكالمات مصلحية -دفع" />
1122:                      case 23: { break; }
1123:   
1124:                      // below: <service id="17" arabicName="نظام التحويل الآلي/بدالة رئيس" />
1125:                      case 17: { break; }
1126:   
1127:                      // below: <service id="18" arabicName="نظام التحويل الآلي/بدالة فرع" />
1128:                      case 18: { break; }
1129:   
1130:                      // below: <service id="3" arabicName="نداء عاجل" />
1131:                      case 3: { break; }
1132:   
1133:                      // below: <service id="22" arabicName="رسوم كابل" />
1134:                      case 22: { break; }
1135:   
1136:                      // below: <service id="61" arabicName="إيقاف إعادة تركيب" />
1137:                      case 61: { break; }
1138:   
1139:                      // below: <service id="43" arabicName="تنازل" />
1140:                      case 43:
1141:                          {
1142:                              serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].Serial++;
1143:                              break;
1144:                          }
1145:   
1146:                      default:
1147:                          {
1148:                              serviceIdIssue += "SrsTest(): Service=" + serviceRequestNumberSerialComplementaryServiceDictionary[serviceSerial].Service + " ServiceId=" + serviceId + " was not recognized. " + "\r\n";
1149:                              break;
1150:                          }
1151:                  }
1152:              }
1153:          }
1154:   
1155:          ////////////////////////////////////////////////////////////////////////////
1156:          ////////////////////////////////////////////////////////////////////////////
1157:      }
1158:   
1159:      ////////////////////////////////////////////////////////////////////////////
1160:      ////////////////////////////////////////////////////////////////////////////
1161:  }