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

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

Default maintenance network information support class for the Fixed Telecommunications Network business model

    1: using System;
    2: using System.Collections.Generic;
    3: using System.Linq;
    4: using System.Text.RegularExpressions;
    5: using System.Threading.Tasks;
    6:  
    7: namespace Ia.Ftn.Cl.Models.Business.Maintenance
    8: {
    9:     ////////////////////////////////////////////////////////////////////////////
   10:  
   11:     /// <summary publish="true">
   12:     /// Default maintenance network information support class for the Fixed Telecommunications Network business model
   13:     /// </summary>
   14:     /// 
   15:     /// <remarks> 
   16:     /// Copyright © 2006-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   17:     /// </remarks> 
   18:     public class Default
   19:     {
   20:         ////////////////////////////////////////////////////////////////////////////
   21:  
   22:         /// <summary>
   23:         ///
   24:         /// </summary>
   25:         public Default() { }
   26:  
   27:         ////////////////////////////////////////////////////////////////////////////
   28:  
   29:         /// <summary>
   30:         ///
   31:         /// </summary>
   32:         public static void BulkQueue(string input, out Ia.Cl.Models.Result result)
   33:         {
   34:             List<string> list;
   35:  
   36:             result = new Ia.Cl.Models.Result();
   37:  
   38:             if (!string.IsNullOrEmpty(input))
   39:             {
   40:                 input = Regex.Replace(input, @"\s+", " "); // to handle any type of space, including newlines
   41:                 input = input.Trim().ToLower();
   42:  
   43:                 if (input.Length > 0)
   44:                 {
   45:                     list = input.Split(new char[] { ',', ' ' }).ToList();
   46:  
   47:                     if (list.Count > 0)
   48:                     {
   49:                         Ia.Ftn.Cl.Models.Business.Maintenance.Default.InsertServiceAccessListIntoQueue(list, out result);
   50:                     }
   51:                     else
   52:                     {
   53:                         result.AddError("List is empty. ");
   54:                     }
   55:                 }
   56:                 else
   57:                 {
   58:                     result.AddError("No input was entered. ");
   59:                 }
   60:             }
   61:             else
   62:             {
   63:                 result.AddError("Input is null or empty. ");
   64:             }
   65:         }
   66:  
   67:         ////////////////////////////////////////////////////////////////////////////
   68:  
   69:         /// <summary>
   70:         ///
   71:         /// </summary>
   72:         public static void InsertServiceAccessListIntoQueue(List<string> list, out Ia.Cl.Models.Result result)
   73:         {
   74:             string service, accessName;
   75:             result = new Ia.Cl.Models.Result();
   76:  
   77:             foreach (string item in list)
   78:             {
   79:                 if (!string.IsNullOrEmpty(item))
   80:                 {
   81:                     service = Ia.Ftn.Cl.Models.Business.NumberFormatConverter.Service(item);
   82:  
   83:                     if (!string.IsNullOrEmpty(service))
   84:                     {
   85:                         if (Ia.Ftn.Cl.Models.Business.Service.ServiceHasEightDigitsAndIsWithinAllowedDomainList(item))
   86:                         {
   87:                             Ia.Ftn.Cl.Models.Data.MessageQueue.SecretaryApplication.Enqueue(Ia.Ftn.Cl.Models.Business.MessageQueue.Application.FtnApplication, Ia.Ftn.Cl.Models.Business.MessageQueue.Process.ReadService, item);
   88:  
   89:                             result.AddSuccess("The number \"" + item + "\" inserted into queue. ");
   90:                         }
   91:                         else
   92:                         {
   93:                             result.AddWarning("The number \"" + item + "\" does not belong to the network. ");
   94:                         }
   95:                     }
   96:                     else
   97:                     {
   98:                         if (Ia.Ftn.Cl.Models.Data.NetworkDesignDocument.AccessNameIsWithinAllowedOntList(item, out accessName))
   99:                         {
  100:                             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);
  101:  
  102:                             result.AddSuccess("The access name \"" + accessName + "\" inserted into queue. ");
  103:                         }
  104:                         else
  105:                         {
  106:                             //result.AddWarning("The access name \"" + item + "\" does not belong to the network. ");
  107:                             result.AddWarning("The number or access name \"" + item + "\" is not recognized or does not belong to the network. ");
  108:                         }
  109:                     }
  110:                 }
  111:                 else
  112:                 {
  113:  
  114:                 }
  115:             }
  116:         }
  117:  
  118:         ////////////////////////////////////////////////////////////////////////////
  119:         ////////////////////////////////////////////////////////////////////////////   
  120:     }
  121:  
  122:     ////////////////////////////////////////////////////////////////////////////
  123:     ////////////////////////////////////////////////////////////////////////////   
  124: }