Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
Skip Navigation LinksHome » Code Library » Default

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 Next Generation Network business model

   1:  using System.Text.RegularExpressions;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:   
   5:  namespace Ia.Ngn.Cl.Model.Business.Maintenance
   6:  {
   7:      ////////////////////////////////////////////////////////////////////////////
   8:   
   9:      /// <summary publish="true">
  10:      /// Default maintenance network information support class for the Next Generation Network business model
  11:      /// </summary>
  12:      /// 
  13:      /// <remarks> 
  14:      /// Copyright © 2006-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  15:      ///
  16:      /// 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
  17:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  18:      ///
  19:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  20:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  21:      /// 
  22:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  23:      /// 
  24:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  25:      /// </remarks> 
  26:      public class Default
  27:      {
  28:          ////////////////////////////////////////////////////////////////////////////
  29:   
  30:          /// <summary>
  31:          ///
  32:          /// </summary>
  33:          public Default() { }
  34:   
  35:          ////////////////////////////////////////////////////////////////////////////
  36:   
  37:          /// <summary>
  38:          ///
  39:          /// </summary>
  40:          public static void BulkQueue(string rowInput, out List<string> list, out Ia.Cl.Model.Result result)
  41:          {
  42:              string input;
  43:   
  44:              result = null;
  45:   
  46:              result = new Ia.Cl.Model.Result();
  47:              list = new List<string>();
  48:   
  49:              if (!string.IsNullOrEmpty(rowInput))
  50:              {
  51:                  rowInput = rowInput.Trim();
  52:                  input = rowInput.ToLower();
  53:   
  54:                  if (input.Length > 0)
  55:                  {
  56:                      Ia.Ngn.Cl.Model.Business.Maintenance.Default.InsertServiceListIntoQueue(rowInput, out list, out result);
  57:   
  58:                      result.AddSuccess("List of service numbers was inserted into queue. ");
  59:   
  60:                      // Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.Enqueue(v);
  61:                      // Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.Enqueue(v.Access.Name);
  62:                  }
  63:                  else
  64:                  {
  65:                      result.AddError("No input was entered. ");
  66:                  }
  67:              }
  68:              else
  69:              {
  70:                  result.AddError("Input is null or empty. ");
  71:              }
  72:          }
  73:   
  74:          ////////////////////////////////////////////////////////////////////////////
  75:   
  76:          /// <summary>
  77:          ///
  78:          /// </summary>
  79:          public static void InsertServiceListIntoQueue(string rowInput, out List<string> list, out Ia.Cl.Model.Result result)
  80:          {
  81:              string input, service;
  82:              MatchCollection matchCollection;
  83:   
  84:              result = new Ia.Cl.Model.Result();
  85:   
  86:              list = new List<string>();
  87:   
  88:              input = rowInput.ToLower();
  89:   
  90:              matchCollection = Regex.Matches(input, @"\d{8}");
  91:   
  92:              if (matchCollection.Count > 0)
  93:              {
  94:                  foreach (Match match in matchCollection)
  95:                  {
  96:                      service = match.Value;
  97:   
  98:                      if (Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedDomainList(service))
  99:                      {
 100:                          list.Add(service);
 101:   
 102:                          Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.Enqueue(service);
 103:                      }
 104:                      else
 105:                      {
 106:                          result.AddWarning("The number \"" + service + "\" does not belong to the network (الرقم لا ينتمي للشبكة). ");
 107:                      }
 108:                  }
 109:              }
 110:              else
 111:              {
 112:                  result.AddError("No input was entered (لم يتم إدخال أي شيء). ");
 113:              }
 114:          }
 115:   
 116:          ////////////////////////////////////////////////////////////////////////////
 117:          ////////////////////////////////////////////////////////////////////////////   
 118:      }
 119:   
 120:      ////////////////////////////////////////////////////////////////////////////
 121:      ////////////////////////////////////////////////////////////////////////////   
 122:  }