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

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