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

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

    1: using Microsoft.AspNetCore.Mvc.Rendering;
    2: using System.Reflection;
    3: using System.Text;
    4: using System.Text.RegularExpressions;
    5:  
    6: namespace Ia.Ftn.Wa.Models.Maintenance
    7: {
    8:     ////////////////////////////////////////////////////////////////////////////
    9:  
   10:     /// <summary publish="true">
   11:     ///
   12:     /// </summary>
   13:     /// 
   14:     /// <remarks> 
   15:     /// Copyright © 2006-2025 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   16:     ///
   17:     /// 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
   18:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   19:     ///
   20:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   21:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   22:     /// 
   23:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   24:     /// 
   25:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   26:     /// </remarks> 
   27:     public static class Script
   28:     {
   29:         ////////////////////////////////////////////////////////////////////////////
   30:  
   31:         /// <summary>
   32:         ///
   33:         /// </summary>
   34:         public static void ViewModel(ref Ia.Ftn.Wa.Models.Maintenance.ScriptViewModel scriptViewModel)
   35:         {
   36:         }
   37:  
   38:         ////////////////////////////////////////////////////////////////////////////
   39:  
   40:         /// <summary>
   41:         ///
   42:         /// </summary>
   43:         public static void Post(ref Ia.Ftn.Wa.Models.Maintenance.ScriptViewModel scriptViewModel, string commandArgument)
   44:         {
   45:             var count = 0;
   46:             var result = string.Empty;
   47:             var sb = new StringBuilder();
   48:  
   49:             if (commandArgument == "11")
   50:             {
   51:                 Ia.Ftn.Cl.Models.Business.Maintenance.Script.InsertMissingAccessEntriesByUsingStatisticalAddressEstimationGeneratedFromServiceRequestOrderAddressesAndCurrentOntAndNetworkDesignDocumentPosition(ref sb, out count, ref result);
   52:             }
   53:             else if (commandArgument == "5")
   54:             {
   55:                 // below: ONTs with no subscriber DNs assigned
   56:                 //Ia.Ftn.Cl.Models.Data.Maintenance.RetrunONTsWithNoSubscriberDnsAssigned(ref sb, ref count);
   57:             }
   58:             else if (commandArgument == "6")
   59:             {
   60:                 // below: Connections with no IP assigned (IP = 0 or IP = null)
   61:                 //Ia.Ftn.Cl.Models.Data.Maintenance.RetrunConnectionsWithNoIPAssigned(ref sb, ref count);
   62:             }
   63:             else if (commandArgument == "8")
   64:             {
   65:                 // below: Numbers that have *disappeared* from Service Request but still have a trace in Service Request Service records
   66:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnNumbersThatHaveDisappearedFromServiceRequestButStillHaveTraceInServiceRequestServiceRecords(ref sb, ref count);
   67:             }
   68:  
   69:             else if (commandArgument == "39")
   70:             {
   71:                 // below: SIP IP range according to OLT as outlined in NDD (Network Design Document)
   72:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnSIPIPRangeAccordingToOLTAsOutlinedInNetworkDesignDocumentNDD(ref sb, ref count);
   73:             }
   74:  
   75:             else if (commandArgument == "43")
   76:             {
   77:                 // below: Different ONTs (according to service requests) connected to same IP
   78:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnListOfDifferentONTsConnectedToSameIPAccordingToServiceRequests(ref sb, ref count);
   79:             }
   80:  
   81:             /////////////////////////////////////////////////////////////////////////////////////
   82:  
   83:             else if (commandArgument == "100")
   84:             {
   85:                 // below: Number, connection, &amp; address information for all numbers in ONTs
   86:  
   87:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnNumberAndConnectionAndAddressInformationForAllNumbersInONTs(ref sb, ref count);
   88:             }
   89:             else if (commandArgument == "101")
   90:             {
   91:                 // below: Non SFU ONTs on the network
   92:  
   93:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnNonSFUONTsOnTheNetwork(ref sb, ref count);
   94:             }
   95:  
   96:             else if (commandArgument == "104")
   97:             {
   98:                 // below: Duplicate addresses within field table
   99:  
  100:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnDuplicateAddressesWithinFieldTable(ref sb, ref count);
  101:             }
  102:  
  103:             else if (commandArgument == "105")
  104:             {
  105:                 // below: Numbers not is the list of officially allowed Dns to be registered: (dn)
  106:  
  107:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnDuplicateAddressesWithinFieldTable(ref sb, ref count);
  108:             }
  109:  
  110:             else if (commandArgument == "106")
  111:             {
  112:                 // below: PBX key numbers from Service Request Service
  113:  
  114:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnPBXKeyNumbersFromServiceRequestService(ref sb, ref count);
  115:             }
  116:  
  117:             else if (commandArgument == "108")
  118:             {
  119:                 // below: Number of Dn records in System, Service, Service_Active, and Service_Request_Service tables
  120:  
  121:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnNumberOfDnRecordsInSystemServiceService_ActiveAndService_Request_ServiceTables(ref sb, ref count);
  122:             }
  123:  
  124:             else if (commandArgument == "109")
  125:             {
  126:                 // below: Dn-Mobile number association from Report records
  127:  
  128:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnDnToMobileNumberAssociationFromReportRecords(ref sb, ref count);
  129:             }
  130:  
  131:             else if (commandArgument == "110")
  132:             {
  133:                 // below: Routing parameters extracted from log file 'sendToS12.history.COMT1'
  134:  
  135:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnRoutingParametersExtractedFromLogFile_sendToS12_history_COMT1(ref sb, ref count);
  136:             }
  137:  
  138:             else if (commandArgument == "111")
  139:             {
  140:                 // below: Number count of ONTs with non-trivial ont_serial numbers (neither 'ALCL00000000' nor NULL) in every PON
  141:  
  142:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnNumberCountOfONTsWithNonTrivialOnt_SerialNumbersInEveryPON(ref sb, ref count);
  143:             }
  144:  
  145:             else if (commandArgument == "112")
  146:             {
  147:                 // below: IPs of ONT Id positions that do not have corresponding field in supplier file
  148:  
  149:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnIPsOfONTIdPositionsThatDoNotHaveCorrespondingFieldInSupplierFile(ref sb, ref count);
  150:             }
  151:  
  152:             else if (commandArgument == "113")
  153:             {
  154:                 // below: Export Important Data to Text
  155:                 string[] sp2 = { "ia_field", "ia_standard", "ia_service_request_service", "ia_system", "ia_protocol" };
  156:  
  157:             }
  158:  
  159:             else if (commandArgument == "201")
  160:             {
  161:                 // below: ONTs with IPs that do not conform to the standard for their ONT ID
  162:  
  163:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnONTsWithIPsThatDoNotConformToTheStandardForTheirONTID(ref sb, ref count);
  164:             }
  165:             else if (commandArgument == "202")
  166:             {
  167:                 // below: Numbers with integrity issues
  168:  
  169:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnNumbersWithIntegrityIssues(ref sb, ref count);
  170:             }
  171:  
  172:             else if (commandArgument == "205")
  173:             {
  174:                 // below: IPs within protocol that belong to the second half of the GPON internal network numbering definition in NDD (Network Design Document)
  175:  
  176:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnIPsWithinProtocolThatBelongToTheSecondHalfOfTheGPONInternalNetworkNumberingDefinitionInTheNetworkDesignDocumentNDD(ref sb, ref count);
  177:             }
  178:  
  179:             else if (commandArgument == "208")
  180:             {
  181:                 // below: ONTs that have not applicable values in database (ont serial, state, or voip state is NULL)
  182:  
  183:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnONTsThatHaveNoApplicableValuesInDatabase(ref sb, ref count);
  184:             }
  185:  
  186:             else if (commandArgument == "209")
  187:             {
  188:                 // below: Numbers within System but not in Service Request Service
  189:  
  190:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnNumbersWithinSystemButNotInServiceRequestService(ref sb, ref count);
  191:             }
  192:  
  193:             else if (commandArgument == "210")
  194:             {
  195:                 // below: Differences between Supplier ONT ID address data and actual customer givin address for provisioned services
  196:  
  197:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnDifferencesBetweenSupplierONTIDAddressDataAndActualCustomerGivinAddressForProvisionedServices(ref sb, ref count);
  198:             }
  199:  
  200:             else if (commandArgument == "211")
  201:             {
  202:                 // below: ONT positions with same IP within AMS
  203:  
  204:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnONTPositionsWithSameIPWithinAMS(ref sb, ref count);
  205:             }
  206:  
  207:             else if (commandArgument == "212")
  208:             {
  209:                 // below: ONT record in Standard but not in Ont
  210:  
  211:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnONTRecordsInStandardButNotInOnt(ref sb, ref count);
  212:             }
  213:  
  214:             else if (commandArgument == "213")
  215:             {
  216:                 // below: ONT record in Ont but not in Standard
  217:  
  218:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnONTRecordsInOntButNotInStandard(ref sb, ref count);
  219:             }
  220:  
  221:             else if (commandArgument == "214")
  222:             {
  223:                 // below: Numbers within System, Service, or Service_Active but not in Service Request Service
  224:  
  225:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnNumbersWithinSystemOrServiceOrService_ActiveButNotInServiceRequestService(ref sb, ref count);
  226:             }
  227:  
  228:             else if (commandArgument == "215")
  229:             {
  230:                 // below: ONT serials within Supplier data that are different from the ONT serials retrieved from AMS for the same ONT positions (excluding 'ALCL00000000' serials)
  231:  
  232:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnONTSerialsWithinSupplierDataThatAreDifferentFromTheONTSerialsRetrievedFromAMSForTheSameONTPositionsExcludingALCL00000000Serials(ref sb, ref count);
  233:             }
  234:  
  235:             else if (commandArgument == "216")
  236:             {
  237:                 // below: ONT records in Ont_Voip but not in Ont
  238:  
  239:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnONTRecordsInOnt_VoipButNotInOnt(ref sb, ref count);
  240:             }
  241:  
  242:             else if (commandArgument == "217")
  243:             {
  244:                 // below: Duplicate ONT serials within Supplier data and the current corresponding AMS ONT serials
  245:  
  246:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnDuplicateONTSerialsWithinSupplierDataAndTheCurrentCorrespondingAMSONTSerials(ref sb, ref count);
  247:             }
  248:  
  249:             else if (commandArgument == "218")
  250:             {
  251:                 // below: Duplicate ONT serials within AMS
  252:  
  253:                 //Ia.Ftn.Cl.Models.Data.Maintenance.ReturnDuplicateONTSerialsWithinAMS(ref sb, ref count);
  254:             }
  255:  
  256:             // below: title of function
  257:             //scriptViewModel.TitleLabel = ((LinkButton)sender).Text;
  258:  
  259:  
  260:             if (result.Length > 0)
  261:             {
  262:                 scriptViewModel.Result.AddError(result);
  263:             }
  264:  
  265:             // below: title of function
  266:             //scriptViewModel.TitleLabel = ((LinkButton)sender).Text;
  267:  
  268:             if (sb != null)
  269:             {
  270:                 // below: remove last ' ' char
  271:                 if (sb.Length > 0)
  272:                 {
  273:                     sb.Remove(sb.Length - 1, 1);
  274:  
  275:                     scriptViewModel.CountLabel = "Total of <u>" + count + "</u> records satisfy process condition.";
  276:  
  277:                     scriptViewModel.ScriptLiteral = sb.ToString();
  278:                 }
  279:                 else
  280:                 {
  281:                     scriptViewModel.CountLabel = "Total of 0 (zero) records satisfy process condition.";
  282:                 }
  283:             }
  284:             else
  285:             {
  286:                 scriptViewModel.Result.AddError("Returned StringBuilder values is null.");
  287:             }
  288:         }
  289:  
  290:         ////////////////////////////////////////////////////////////////////////////
  291:         ////////////////////////////////////////////////////////////////////////////
  292:  
  293:         /// <summary>
  294:         ///
  295:         /// </summary>
  296:         public static void AccessViewModel(ref Ia.Ftn.Wa.Models.Maintenance.ScriptViewModel scriptViewModel)
  297:         {
  298:             var list = Ia.Ftn.Cl.Models.Data.NetworkDesignDocument.OltList;
  299:  
  300:             scriptViewModel.OltSelectList = new SelectList(list, "Id", "AmsName");
  301:         }
  302:  
  303:         ////////////////////////////////////////////////////////////////////////////
  304:  
  305:         /// <summary>
  306:         ///
  307:         /// </summary>
  308:         public static void GenerateScript(ref Ia.Ftn.Wa.Models.Maintenance.ScriptViewModel scriptViewModel)
  309:         {
  310:             bool edServiceVoipIsOos;
  311:             int count, oltId;
  312:             string result;
  313:             StringBuilder sb;
  314:  
  315:             count = 0;
  316:             result = string.Empty;
  317:             sb = null;
  318:  
  319:             oltId = int.Parse(scriptViewModel.OltSelectedValue);
  320:  
  321:             edServiceVoipIsOos = scriptViewModel.SetEdServiceVoipOosSelectedValue == "1";
  322:  
  323:             if (!string.IsNullOrEmpty(scriptViewModel.OltSelectedValue))
  324:             {
  325:                 switch (scriptViewModel.OltSelectedValue)
  326:                 {
  327:                     case "3": Ia.Ftn.Wa.Models.Business.Maintenance.Script.PreprovisionAllOntsAsDefinedInNddDocumentWithinOlt(oltId, edServiceVoipIsOos, ref sb, out count, ref result); break;
  328:                     case "4": Ia.Ftn.Wa.Models.Business.Maintenance.Script.PreprovisionOntThatAreNotProvisionedAsDefinedInNddDocumentWithinAnOlt(oltId, edServiceVoipIsOos, ref sb, out count, ref result); break;
  329:                     case "5": break;
  330:                     case "6": break;
  331:                     case "7": Ia.Ftn.Wa.Models.Business.Maintenance.Script.DeleteAndReCreateVoipsAndOntpotsToHaveErrorsInMgcPrimaryAndOrSecondaryIpValuesWithinAOltToMakeThemMatchTheFtnDocumentMgcIpSpecification(oltId, edServiceVoipIsOos, ref sb, out count, ref result); break;
  332:                     case "8": Ia.Ftn.Wa.Models.Business.Maintenance.Script.DeleteAndReCreateVoipsAndOntpotsForAllPossibleCompleteSetOfOntsInAOltToSetVoipsMgcPrimaryAndSecondaryIpsAccordingToFtnDocument(oltId, edServiceVoipIsOos, ref sb, out count, ref result); break;
  333:                     case "9": Ia.Ftn.Wa.Models.Business.Maintenance.Script.CreateMissingOntpotsForDefinedOntsWithValidAccess(oltId, edServiceVoipIsOos, ref sb, out count, ref result); break;
  334:                     case "10": Ia.Ftn.Wa.Models.Business.Maintenance.Script.CreateOntPotsForAllPossibleCompleteSetOfOntWithValidAccess(oltId, edServiceVoipIsOos, ref sb, out count, ref result); break;
  335:                     case "11": Ia.Ftn.Wa.Models.Business.Maintenance.Script.PreprovisionAllOntsAsDefinedInNddDocumentWithinOltUsingConfigureCommand(oltId, edServiceVoipIsOos, ref sb, out count, ref result); break;
  336:                     default: break;
  337:                 }
  338:             }
  339:             else
  340:             {
  341:             }
  342:  
  343:             // below: title of function
  344:             //scriptViewModel.TitleLabel = ((Button)sender).Text;
  345:  
  346:             if (count > 0)
  347:             {
  348:                 // below: remove last ' ' char
  349:                 sb.Remove(sb.Length - 1, 1);
  350:  
  351:                 scriptViewModel.CountLabel = "Total of <u>" + count + "</u> script lines. ";
  352:  
  353:                 if (scriptViewModel.RemoveCommentSelectedValue == "1") Ia.Ftn.Cl.Models.Ui.Default.RemoveAllComments(ref sb);
  354:  
  355:                 scriptViewModel.ScriptLiteral = sb.ToString().Trim();
  356:             }
  357:             else
  358:             {
  359:                 scriptViewModel.CountLabel = "Total of 0 (zero) script lines. ";
  360:             }
  361:         }
  362:  
  363:         ////////////////////////////////////////////////////////////////////////////
  364:         ////////////////////////////////////////////////////////////////////////////
  365:     }
  366:  
  367:     ////////////////////////////////////////////////////////////////////////////
  368:     ////////////////////////////////////////////////////////////////////////////
  369: }