)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » Migration (Ia.Ftn.Cl.Models.Business)

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

Migration support class of Fixed Telecommunications Network (FTN) business model.

    1: using Microsoft.AspNetCore.Identity;
    2: using System;
    3: using System.Collections.Generic;
    4: using System.Linq;
    5: using System.Text.RegularExpressions;
    6:  
    7: namespace Ia.Ftn.Cl.Models.Business
    8: {
    9:     ////////////////////////////////////////////////////////////////////////////
   10:  
   11:     /// <summary publish="true">
   12:     /// Migration support class of Fixed Telecommunications Network (FTN) business model.
   13:     /// </summary>
   14:     /// 
   15:     /// <remarks> 
   16:     /// Copyright © 2018-2020 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   17:     /// </remarks> 
   18:     public class Migration
   19:     {
   20:         ////////////////////////////////////////////////////////////////////////////
   21:  
   22:         /// <summary>
   23:         ///
   24:         /// </summary>
   25:         public Migration()
   26:         {
   27:  
   28:         }
   29:  
   30:         ////////////////////////////////////////////////////////////////////////////
   31:  
   32:         /// <summary>
   33:         ///
   34:         /// </summary>
   35:         public static bool ReviewEligibility(Ia.Ftn.Cl.Models.StaffIdentityUser staff, string accessNameTextBoxText, string serviceListTextBoxText, out string accessName, out List<string> migrationService5List, out bool doDisplayReview, out List<string> reviewServiceList, out Ia.Cl.Models.Result reviewEligibilityResult)
   36:         {
   37:             bool ontExists, ontOrMduDevIsOnline;
   38:             string accessNameString;
   39:  
   40:             var isEligibleForMigration = false;
   41:             doDisplayReview = true;
   42:  
   43:             accessName = string.Empty;
   44:  
   45:             var serviceList = new List<string>();
   46:             reviewServiceList = new List<string>();
   47:  
   48:             migrationService5List = new List<string>();
   49:  
   50:             reviewEligibilityResult = new Ia.Cl.Models.Result();
   51:  
   52:             if (!string.IsNullOrEmpty(accessNameTextBoxText) && !string.IsNullOrEmpty(System.Net.WebUtility.HtmlDecode(accessNameTextBoxText)))
   53:             {
   54:                 accessNameString = System.Net.WebUtility.HtmlDecode(accessNameTextBoxText);
   55:  
   56:                 accessNameString = accessNameString.Trim();
   57:  
   58:                 if (accessNameString.Length > 0)
   59:                 {
   60:                     if (Ia.Ftn.Cl.Models.Business.Access.AccessNameIsInAValidFormat(accessNameString))
   61:                     {
   62:                         if (Ia.Ftn.Cl.Models.Data.NetworkDesignDocument.AccessNameIsWithinAllowedOntList(accessNameString, out accessName))
   63:                         {
   64:                             if (Ia.Ftn.Cl.Models.Business.Authority.StaffCanMigratePremisesFromPstnToFiber(staff))
   65:                             {
   66:                                 var access = Ia.Ftn.Cl.Models.Data.Access.ReadByAccessName(accessName);
   67:  
   68:                                 if (access != null)
   69:                                 {
   70:                                     if (Ia.Ftn.Cl.Models.Business.Service.OltIdIsWithinAllowedToBeMigratedOltList(access.Olt))
   71:                                     {
   72:                                         var nddOnt = Ia.Ftn.Cl.Models.Data.NetworkDesignDocument.OntByAccessName(accessName);
   73:  
   74:                                         if (nddOnt != null)
   75:                                         {
   76:                                             var serviceRequestOnt = Ia.Ftn.Cl.Models.Data.ServiceRequestOnt.Read(nddOnt.Access.Id);
   77:  
   78:                                             if (serviceRequestOnt != null)
   79:                                             {
   80:                                                 if (nddOnt.Pon.PonGroup.Olt.Odf.Vendor == Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Vendor.Nokia)
   81:                                                 {
   82:                                                     var ont = Ia.Ftn.Cl.Models.Data.Nokia.Ont.ReadIncludeAccess(nddOnt.Id);
   83:  
   84:                                                     if (ont != null)
   85:                                                     {
   86:                                                         ontExists = true;
   87:  
   88:                                                         if (ont.FamilyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Mdu || ont.FamilyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gmdu)
   89:                                                         {
   90:                                                             ontOrMduDevIsOnline = ont.StateId == (int)Ia.Ftn.Cl.Models.Business.Nokia.Ams.BellcoreState.IsNr;
   91:                                                         }
   92:                                                         else // if (ont.FamilyType ==Ia.Ftn.Cl.Model.Business.Nokia.Ont.FamilyType.Sfu or etc)
   93:                                                         {
   94:                                                             ontOrMduDevIsOnline = ont.StateId == (int)Ia.Ftn.Cl.Models.Business.Nokia.Ams.BellcoreState.IsNr;
   95:                                                         }
   96:                                                     }
   97:                                                     else
   98:                                                     {
   99:                                                         ontExists = false;
  100:                                                         ontOrMduDevIsOnline = false;
  101:                                                     }
  102:                                                 }
  103:                                                 else if (nddOnt.Pon.PonGroup.Olt.Odf.Vendor == Ia.Ftn.Cl.Models.Business.NetworkDesignDocument.Vendor.Huawei)
  104:                                                 {
  105:                                                     var emsOnt = Ia.Ftn.Cl.Models.Data.Huawei.Ont.ReadIncludeAccess(nddOnt.Id);
  106:  
  107:                                                     if (emsOnt != null)
  108:                                                     {
  109:                                                         ontExists = true;
  110:  
  111:                                                         if (emsOnt.FamilyType == Ia.Ftn.Cl.Models.Business.Huawei.Ont.FamilyType.Mdu)
  112:                                                         {
  113:                                                             var emsDev = Ia.Ftn.Cl.Models.Data.Huawei.Dev.ReadByAccessId(emsOnt.Access.Id);
  114:  
  115:                                                             ontOrMduDevIsOnline = !(emsDev.ResultCode == (long)Ia.Ftn.Cl.Models.Client.Huawei.Ems.ResultCode.DeviceOfflineError);
  116:                                                         }
  117:                                                         else // if (emsOnt.FamilyType == Huawei.Ont.FamilyType.Sfu)
  118:                                                         {
  119:                                                             ontOrMduDevIsOnline = !(emsOnt.ResultCode == (long)Ia.Ftn.Cl.Models.Client.Huawei.Ems.ResultCode.OntIsOffline || emsOnt.ResultCode == (long)Ia.Ftn.Cl.Models.Client.Huawei.Ems.ResultCode.DeviceOfflineError);
  120:                                                         }
  121:                                                     }
  122:                                                     else
  123:                                                     {
  124:                                                         ontExists = false;
  125:                                                         ontOrMduDevIsOnline = false;
  126:                                                     }
  127:                                                 }
  128:                                                 else
  129:                                                 {
  130:                                                     throw new Exception("nddOnt.Pon.PonGroup.Olt.Odf.Vendor is neither Nokia nor Huawei. ");
  131:                                                 }
  132:  
  133:                                                 if (ontExists)
  134:                                                 {
  135:                                                     if (ontOrMduDevIsOnline)
  136:                                                     {
  137:                                                         if (Ia.Ftn.Cl.Models.Business.Authority.StaffCanMigratePremisesFromPstnToFiberForNddOnt(staff, nddOnt))
  138:                                                         {
  139:                                                             // var huaweiAccessToPstnServiceListDictionary = Ia.Ftn.Cl.Model.Data.Huawei.GponPhaseIiHomeConnectionAndMigration.AccessToPstnServiceListDictionary;
  140:                                                             // above: I stopped reading file because Huawei do not update it
  141:                                                             var huaweiAccessToPstnServiceListDictionary = new Dictionary<string, List<string>>();
  142:  
  143:                                                             //if (huaweiAccessToPstnServiceListDictionary != null && huaweiAccessToPstnServiceListDictionary.Count > 0)
  144:                                                             //{
  145:                                                             if (!string.IsNullOrEmpty(serviceListTextBoxText) && !string.IsNullOrEmpty(System.Net.WebUtility.HtmlDecode(serviceListTextBoxText)))
  146:                                                             {
  147:                                                                 var serviceListString = System.Net.WebUtility.HtmlDecode(serviceListTextBoxText.Trim());
  148:  
  149:                                                                 if (serviceListString.Length > 0)
  150:                                                                 {
  151:                                                                     var matchCollection = Regex.Matches(serviceListString, @"\b\d{8}\b");
  152:  
  153:                                                                     if (matchCollection.Count > 0)
  154:                                                                     {
  155:                                                                         var service0List = matchCollection.Cast<Match>().Select(m => m.Value).ToList();
  156:  
  157:                                                                         if (service0List.Count > 0)
  158:                                                                         {
  159:                                                                             foreach (var service in service0List)
  160:                                                                             {
  161:                                                                                 if (Ia.Ftn.Cl.Models.Business.Service.ServiceHasEightDigitsAndIsWithinAllowedDomainList(service))
  162:                                                                                 {
  163:                                                                                     if (Ia.Ftn.Cl.Models.Business.Authority.NumberIsWithinFrameworkSiteDomainList(staff.Framework, service))
  164:                                                                                     {
  165:                                                                                         if (Ia.Ftn.Cl.Models.Business.Service.NumberIsWithinAllowedRouterDomainListOrIsWithinSymbolDomainSameSwitchVendorButDifferentSiteExceptionList(nddOnt, service))
  166:                                                                                         {
  167:                                                                                             serviceList.Add(service);
  168:                                                                                         }
  169:                                                                                         else
  170:                                                                                         {
  171:                                                                                             reviewEligibilityResult.AddWarning("Service number " + service + " is not within allowed router domain list for access " + nddOnt.Access.Name + ". To override restrictions contact Fixed Telecommunications Network department (الرقم لا ينتمي لنطاقات المقسم المسموح بها للجهاز. لتجاوز المنع اتصل بإدارة شبكة الألياف الضوئية). ");
  172:                                                                                         }
  173:                                                                                     }
  174:                                                                                     else
  175:                                                                                     {
  176:                                                                                         reviewEligibilityResult.AddWarning("The service number " + service + " is not in staff site domain (الرقم لا ينتمي لنطاقات المستخدم). ");
  177:                                                                                     }
  178:                                                                                 }
  179:                                                                                 else
  180:                                                                                 {
  181:                                                                                     reviewEligibilityResult.AddError("The service number " + service + " does not belong to the network (الرقم لا ينتمي للشبكة).");
  182:                                                                                 }
  183:                                                                             }
  184:                                                                         }
  185:                                                                         else
  186:                                                                         {
  187:                                                                             reviewEligibilityResult.AddWarning("Could not retrieve any service number from the string " + serviceListTextBoxText + " (لم يتم استخراج أي رقم خدمة من النص المعطى). ");
  188:                                                                         }
  189:                                                                     }
  190:                                                                     else
  191:                                                                     {
  192:                                                                         reviewEligibilityResult.AddWarning("Could not retrieve any service number from the string " + serviceListTextBoxText + " (لم يتم استخراج أي رقم خدمة من النص المعطى). ");
  193:                                                                     }
  194:                                                                 }
  195:                                                                 else
  196:                                                                 {
  197:                                                                     // result.AddWarning("");
  198:                                                                 }
  199:                                                             }
  200:                                                             else
  201:                                                             {
  202:                                                                 // result.AddWarning("");
  203:                                                             }
  204:  
  205:                                                             // var accessNameToServiceListWithinAllowedToBeMigratedOltDictionary = Ia.Ftn.Cl.Model.Data.ServiceRequest.AccessNameToServiceListWithinAllowedToBeMigratedOltDictionary;
  206:                                                             // above: I stopped reading file because its too complicated and not accurate
  207:                                                             var accessNameToServiceListWithinAllowedToBeMigratedOltDictionary = new Dictionary<string, List<string>>();
  208:  
  209:                                                             if (huaweiAccessToPstnServiceListDictionary.ContainsKey(accessName) || accessNameToServiceListWithinAllowedToBeMigratedOltDictionary.ContainsKey(accessName) || serviceList.Count > 0)
  210:                                                             {
  211:                                                                 serviceList = serviceList.Distinct().ToList();
  212:  
  213:                                                                 var migrationService1List = new List<string>();
  214:  
  215:                                                                 if (huaweiAccessToPstnServiceListDictionary.ContainsKey(accessName) && accessNameToServiceListWithinAllowedToBeMigratedOltDictionary.ContainsKey(accessName))
  216:                                                                 {
  217:                                                                     migrationService1List.AddRange(huaweiAccessToPstnServiceListDictionary[accessName]);
  218:                                                                     migrationService1List.AddRange(accessNameToServiceListWithinAllowedToBeMigratedOltDictionary[accessName]);
  219:  
  220:                                                                     migrationService1List.AddRange(serviceList);
  221:                                                                 }
  222:                                                                 else if (huaweiAccessToPstnServiceListDictionary.ContainsKey(accessName))
  223:                                                                 {
  224:                                                                     migrationService1List.AddRange(huaweiAccessToPstnServiceListDictionary[accessName]);
  225:  
  226:                                                                     migrationService1List.AddRange(serviceList);
  227:                                                                 }
  228:                                                                 else if (accessNameToServiceListWithinAllowedToBeMigratedOltDictionary.ContainsKey(accessName))
  229:                                                                 {
  230:                                                                     migrationService1List.AddRange(accessNameToServiceListWithinAllowedToBeMigratedOltDictionary[accessName]);
  231:  
  232:                                                                     migrationService1List.AddRange(serviceList);
  233:                                                                 }
  234:                                                                 else // only optional number serviceList.Count > 0 left
  235:                                                                 {
  236:                                                                     migrationService1List.AddRange(serviceList);
  237:                                                                 }
  238:  
  239:                                                                 if (migrationService1List.Count > 0)
  240:                                                                 {
  241:                                                                     migrationService1List = migrationService1List.Distinct().ToList();
  242:  
  243:                                                                     reviewServiceList.AddRange(migrationService1List);
  244:  
  245:                                                                     // get a list of all numbers within DB box as the ones in contactor data
  246:                                                                     // too slow
  247:                                                                     var dbNamePeerServiceList = new List<string>(); // Ia.Ftn.Cl.Model.Data.ServiceRequest.DbPeerServiceList(migrationService1List);
  248:  
  249:                                                                     var migrationService2List = new List<string>();
  250:  
  251:                                                                     migrationService2List.AddRange(migrationService1List);
  252:                                                                     migrationService2List.AddRange(dbNamePeerServiceList);
  253:  
  254:                                                                     migrationService2List = migrationService2List.Distinct().ToList();
  255:  
  256:                                                                     reviewServiceList.AddRange(migrationService2List);
  257:  
  258:                                                                     // check for IMS, MSAN and PSTN numbers in Service2
  259:                                                                     var imsService2List = Ia.Ftn.Cl.Models.Data.Service2.ReadList(migrationService2List);
  260:                                                                     var msanService2List = Ia.Ftn.Cl.Models.Data.Service2.ReadMsanList(migrationService2List);
  261:                                                                     var pstnService2List = Ia.Ftn.Cl.Models.Data.Service2.ReadPstnList(migrationService2List);
  262:  
  263:                                                                     reviewServiceList.AddRange(imsService2List.Select(u => u.Service).ToList());
  264:                                                                     reviewServiceList.AddRange(msanService2List.Select(u => u.Service).ToList());
  265:                                                                     reviewServiceList.AddRange(pstnService2List.Select(u => u.Service).ToList());
  266:  
  267:                                                                     reviewServiceList = reviewServiceList.Distinct().ToList();
  268:  
  269:                                                                     // check the migration state of every service in pstnMigrationServiceList
  270:  
  271:                                                                     var migrationService3List = new List<string>();
  272:  
  273:                                                                     foreach (var migrationService in migrationService2List)
  274:                                                                     {
  275:                                                                         if (imsService2List.Any(u => u.Service == migrationService))
  276:                                                                         {
  277:                                                                             if (msanService2List.Any(u => u.Service == migrationService))
  278:                                                                             {
  279:                                                                                 migrationService3List.Add(migrationService);
  280:                                                                             }
  281:                                                                             else
  282:                                                                             {
  283:                                                                                 reviewEligibilityResult.AddWarning("The service number " + migrationService + " already exists in the IMS network (الرقم يعمل في مقسم الشبكة الرقمية الحديثة). ");
  284:                                                                             }
  285:                                                                         }
  286:                                                                         else
  287:                                                                         {
  288:                                                                             if (pstnService2List.Any(u => u.Service == migrationService))
  289:                                                                             {
  290:                                                                                 migrationService3List.Add(migrationService);
  291:                                                                             }
  292:                                                                             else
  293:                                                                             {
  294:                                                                                 reviewEligibilityResult.AddWarning("The service number " + migrationService + " does not exist in the PSTN exchange (الرقم غير موجود في مقسم النحاس القديم). ");
  295:                                                                             }
  296:                                                                         }
  297:                                                                     }
  298:  
  299:                                                                     if (migrationService3List.Count > 0)
  300:                                                                     {
  301:                                                                         var axeSubsriberList = Ia.Ftn.Cl.Models.Data.Ericsson.Subscriber.List(migrationService3List);
  302:                                                                         var ewsdSubsriberList = Ia.Ftn.Cl.Models.Data.Siemens.Subscriber.List(migrationService3List);
  303:  
  304:                                                                         // check if AXE numbers are PBXs [AxeSubscribers] where SUT = 'PB'. SUT = PB is key, MIS is PNB=25376912 is branch of key
  305:  
  306:                                                                         var migrationService4List = new List<string>();
  307:  
  308:                                                                         foreach (var migrationService in migrationService3List)
  309:                                                                         {
  310:                                                                             if (axeSubsriberList.Any(u => u.SNB.ToString() == migrationService && (u.SUT == "PB" || u.MIS.Contains("PNB"))))
  311:                                                                             {
  312:                                                                                 reviewEligibilityResult.AddWarning("The number " + migrationService + " is a PBX key or branch. You can migrate its as a regular number, but PBX numbers must be handled manually (الرقم عبارة عن مفتاح أو فرع بدالة. يمكن تحويله كرقم عادي لكن ليعمل كجزء من بدالة يجب تركيبه يدويا بواسطة قسم الدعم الفني). ");
  313:                                                                             }
  314:                                                                             /*
  315:                                                                             else if (ewsdSubsriberDnLnattList.Any(u => u.DN.ToString() == migrationService && (u.LNATT == "PB?")))
  316:                                                                             {
  317:                                                                                 reviewEligibilityResult.AddWarning("The number " + migrationService + " is a PBX key or branch. You can migrate its as a regular number, but PBX numbers must be handled manually (الرقم عبارة عن مفتاح أو فرع بدالة. يمكن تحويله كرقم عادي لكن ليعمل كجزء من بدالة يجب تركيبه يدويا بواسطة قسم الدعم الفني). ");
  318:                                                                             }
  319:                                                                             */
  320:                                                                             else
  321:                                                                             {
  322:                                                                             }
  323:  
  324:                                                                             // below: enable the migratio of PBX related numbers
  325:                                                                             migrationService4List.Add(migrationService);
  326:                                                                         }
  327:  
  328:                                                                         if (migrationService4List.Count > 0)
  329:                                                                         {
  330:                                                                             reviewServiceList.AddRange(migrationService4List);
  331:  
  332:                                                                             var serviceRequestServiceIdList = Ia.Ftn.Cl.Models.Data.Maintenance.Find.ServiceRequestServiceIdListFromServiceList(migrationService4List);
  333:                                                                             var serviceRequestServiceList = Ia.Ftn.Cl.Models.Data.Maintenance.Find.ServiceRequestServiceList(serviceRequestServiceIdList);
  334:  
  335:                                                                             if (serviceRequestServiceList.Count > 0)
  336:                                                                             {
  337:                                                                                 foreach (var serviceRequestService in serviceRequestServiceList)
  338:                                                                                 {
  339:                                                                                     if (serviceRequestService.Provisioned)
  340:                                                                                     {
  341:                                                                                         migrationService5List.Add(serviceRequestService.Service);
  342:                                                                                     }
  343:                                                                                     else
  344:                                                                                     {
  345:                                                                                         reviewEligibilityResult.AddWarning("The service number " + serviceRequestService.Service + " is not provisioned in the customer service database and can not be migrated from PSTN or MSAN to Fiber (الرقم مرفوع عن الخدمة بحسب بيانات خدمات المشتركين ولا يمكن ترحيله من مقسم النحاس (القديم) إلى مقسم الشبكة الرقمية). ");
  346:                                                                                     }
  347:                                                                                 }
  348:  
  349:                                                                                 if (migrationService5List.Count > 0)
  350:                                                                                 {
  351:                                                                                     isEligibleForMigration = true;
  352:  
  353:                                                                                     migrationService5List = migrationService5List.Distinct().ToList();
  354:  
  355:                                                                                     reviewEligibilityResult.AddSuccess("The service number(s) " + string.Join(", ", migrationService5List) + " might be good migration candidates and are ready for migration to access " + accessName + " (رقم أو أرقام الخدمة التالية قد تكون صحيحة وجاهزة للترحيل إلى الجهاز الرقمي الجديد). ");
  356:  
  357:                                                                                     reviewServiceList.AddRange(migrationService5List);
  358:                                                                                 }
  359:                                                                                 else reviewEligibilityResult.AddError("Comparing Fiber, MSAN, and PSTN information with contractor data and statistical approximation of access using service requests does not warrant a migration (مقارنة معلومات قائمة المقاول مع معلومات مقسم النحاس (القديم) مع معلومات الشبكة الرقمية مع حالة الأرقام عند خدمات المشتركين مع إحصاءات تقريب عناوين المشتركين من أوامر العمل، لم تنتج عن أي أرقام يمكن ترحيلها). ");
  360:                                                                             }
  361:                                                                             else reviewEligibilityResult.AddError("Comparing Fiber, MSAN, and PSTN information with contractor data and statistical approximation of access using service requests does not warrant a migration (مقارنة معلومات قائمة المقاول مع معلومات مقسم النحاس (القديم) مع معلومات الشبكة الرقمية مع حالة الأرقام عند خدمات المشتركين مع إحصاءات تقريب عناوين المشتركين من أوامر العمل، لم تنتج عن أي أرقام يمكن ترحيلها). ");
  362:                                                                         }
  363:                                                                         else reviewEligibilityResult.AddError("Comparing Fiber, MSAN, and PSTN information with contractor data and statistical approximation of access using service requests does not warrant a migration (مقارنة معلومات قائمة المقاول مع معلومات مقسم النحاس (القديم) مع معلومات الشبكة الرقمية مع حالة الأرقام عند خدمات المشتركين مع إحصاءات تقريب عناوين المشتركين من أوامر العمل، لم تنتج عن أي أرقام يمكن ترحيلها). ");
  364:                                                                     }
  365:                                                                     else reviewEligibilityResult.AddError("Comparing Fiber, MSAN, and PSTN information with contractor data and statistical approximation of access using service requests does not warrant a migration (مقارنة معلومات قائمة المقاول مع معلومات مقسم النحاس (القديم) مع معلومات الشبكة الرقمية مع حالة الأرقام عند خدمات المشتركين مع إحصاءات تقريب عناوين المشتركين من أوامر العمل، لم تنتج عن أي أرقام يمكن ترحيلها). ");
  366:                                                                 }
  367:                                                                 else reviewEligibilityResult.AddError("Could not find any services related to " + accessName + ". Neither contractor data nor statistical approximation of access using service requests could produce related services (لم نتوصل إلى أرقام متعلقة بالجهاز. لا يوجد أثر لأرقام في قائمة المقاول ولا في إحصاءات تقريب عناوين المشتركين من أوامر العمل). ");
  368:                                                             }
  369:                                                             else reviewEligibilityResult.AddError("Contractor data and/or statistical approximation of access from service requests do not have key entries for access " + accessName + " and there was not optional supporting service number to conceder (لا يوجد أثر للجهاز لا في قائمة المقاول ولا في إحصاءات تقريب عناوين المشتركين من أوامر العمل ولا يوجد رقما اختياريا للمساعدة). ");
  370:                                                             //}
  371:                                                             //else reviewEligibilityResult.AddError("Could not read or process contractor data (لم أستطع الوصول إلى قائمة المقاول). ");
  372:  
  373:                                                             reviewServiceList = reviewServiceList.Distinct().ToList();
  374:                                                             doDisplayReview = true;
  375:                                                         }
  376:                                                         else reviewEligibilityResult.AddError("You are not authorized to conduct migrations for " + nddOnt.Pon.PonGroup.Olt.Symbol + " (لست مخولاً بتنفيذ عمليات ترحيل للمنطقة). ");
  377:                                                     }
  378:                                                     else reviewEligibilityResult.AddError("Access " + accessName + " is offline. Ask the subscriber to turn it on. If still offline contact the TNMD department (الجهاز لا يعمل أو خارج الخدمة. أرشد المشترك إلى تشغيل الجهاز وإذا لم يعمل اتصل بإدارة مشاريع الشبكة). ");
  379:                                                 }
  380:                                                 else reviewEligibilityResult.AddError("Access " + accessName + " does not exist (الجهاز غير معرف). ");
  381:                                             }
  382:                                             else reviewEligibilityResult.AddError("Access " + accessName + " is not ready for service. Contact the TNMD department (الجهاز غير جاهز للخدمة. اتصل بإدارة مشاريع الشبكة عن طريق تقديم طلب في قسم الخدمات). ");
  383:                                         }
  384:                                         else throw new Exception("NDD ONT is null. ");
  385:  
  386:                                         if (reviewEligibilityResult.HasError)
  387:                                         {
  388:                                             reviewEligibilityResult.AddWarning("Service and/or ONT information could be missing. Wait a few seconds to allow the system to attempt to collect them then press Review again (قد تكون معلومات الرقم أو الجهاز غير موجودة. امنح النظام بضع ثوان كي يتسنى له جمع المعلومات المفقودة ثم اضغط زر المراجعة)");
  389:                                         }
  390:  
  391:                                         Ia.Ftn.Cl.Models.Data.MessageQueue.SecretaryApplication.Enqueue(Ia.Ftn.Cl.Models.Business.MessageQueue.Application.FtnApplication, Ia.Ftn.Cl.Models.Business.MessageQueue.Process.ReadAccess, accessName);
  392:                                     }
  393:                                     else reviewEligibilityResult.AddError(accessName + @" does not belong to an OLT that is cleared for migration (device must be within " + AllowedToBeMigratedOltListString() + ") (الجهاز لا ينتمي لقائمة النهايات البصرية المعدة للترحيل). ");
  394:                                 }
  395:                                 else reviewEligibilityResult.AddError("Access " + accessName + " does not exist. Contact the TNMD department (الجهاز غير معرف. اتصل بإدارة مشاريع الشبكة عن طريق تقديم طلب في قسم الخدمات). ");
  396:                             }
  397:                             else reviewEligibilityResult.AddError("You are not authorized to conduct migrations (لست مخولاً بتنفيذ عمليات ترحيل). ");
  398:                         }
  399:                         else reviewEligibilityResult.AddError(accessNameString + @" does not belong to the network (الجهاز لا ينتمي للشبكة). ");
  400:                     }
  401:                     else reviewEligibilityResult.AddError(accessNameString + @" format is unknown (قيمة غير مفهومة). ");
  402:                 }
  403:                 else reviewEligibilityResult.AddError("Input format is unknown (قيمة غير مفهومة). ");
  404:             }
  405:             else reviewEligibilityResult.AddError("Input format is unknown (قيمة غير مفهومة). ");
  406:  
  407:             return isEligibleForMigration;
  408:         }
  409:  
  410:         ////////////////////////////////////////////////////////////////////////////
  411:  
  412:         /// <summary>
  413:         ///
  414:         /// </summary>
  415:         public static string AllowedToBeMigratedOltListString()
  416:         {
  417:             var list = Ia.Ftn.Cl.Models.Business.Service.AllowedToBeMigratedOltSymbolList;
  418:  
  419:             list.RemoveAll(u => u == "SSR");
  420:             list = list.Distinct().ToList();
  421:  
  422:             return string.Join(", ", list.ToArray());
  423:         }
  424:  
  425:         ////////////////////////////////////////////////////////////////////////////    
  426:         ////////////////////////////////////////////////////////////////////////////    
  427:     }
  428:  
  429:     ////////////////////////////////////////////////////////////////////////////
  430:     ////////////////////////////////////////////////////////////////////////////   
  431: }