)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Skip Navigation Links

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

Migration support class of Optical Fiber Network (OFN) business model.

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