شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » Service2

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

Service Entity Framework class for Next Generation Network (NGN) business model.

   1:  using System.Collections.Generic;
   2:  using System.Linq;
   3:   
   4:  namespace Ia.Ngn.Cl.Model.Business
   5:  {
   6:      ////////////////////////////////////////////////////////////////////////////
   7:   
   8:      /// <summary publish="true">
   9:      /// Service Entity Framework class for Next Generation Network (NGN) business model.
  10:      /// </summary>
  11:      /// 
  12:      /// <remarks> 
  13:      /// Copyright © 2006-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  14:      ///
  15:      /// 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
  16:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  17:      ///
  18:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  19:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  20:      /// 
  21:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  22:      /// 
  23:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  24:      /// </remarks> 
  25:      public partial class Service2
  26:      {
  27:          private static int sequentialQueueOriginalCount;
  28:          private static Queue<string> sequentialQueue = new Queue<string>();
  29:   
  30:          /// <summary/>
  31:          public Service2() { }
  32:   
  33:          ////////////////////////////////////////////////////////////////////////////
  34:   
  35:          /// <summary>
  36:          ///
  37:          /// </summary>
  38:          public static string ServiceId(string service, int serviceType)
  39:          {
  40:              string id;
  41:   
  42:              id = Ia.Ngn.Cl.Model.Business.Service.ServiceToServiceId(service, serviceType);
  43:   
  44:              return id;
  45:          }
  46:   
  47:          ////////////////////////////////////////////////////////////////////////////
  48:   
  49:          /// <summary>
  50:          ///
  51:          /// </summary>
  52:          public static string ServiceIdToService(string serviceId)
  53:          {
  54:              string service;
  55:   
  56:              service = Ia.Ngn.Cl.Model.Business.Service.ServiceIdToService(serviceId);
  57:   
  58:              return service;
  59:          }
  60:   
  61:          ////////////////////////////////////////////////////////////////////////////    
  62:   
  63:          /// <summary>
  64:          ///
  65:          /// </summary>
  66:          public static string SequentialServiceNotInServiceRequestServiceManager(out int sequentialQueueCount, out string progressCounterString)
  67:          {
  68:              string service;
  69:              Dictionary<string, string> dictionary;
  70:   
  71:              if (sequentialQueue.Count == 0)
  72:              {
  73:                  dictionary = Ia.Ngn.Cl.Model.Data.Service2.ServiceNotInServiceRequestServiceToSiteDictionary;
  74:   
  75:                  sequentialQueue = new Queue<string>(dictionary.Keys);
  76:   
  77:                  sequentialQueueOriginalCount = sequentialQueue.Count;
  78:              }
  79:   
  80:              if (sequentialQueue.Count > 0) service = sequentialQueue.Dequeue();
  81:              else service = string.Empty;
  82:   
  83:              progressCounterString = "(" + sequentialQueue.Count + "/" + sequentialQueueOriginalCount + ")";
  84:   
  85:              sequentialQueueCount = sequentialQueue.Count;
  86:   
  87:              return service;
  88:          }
  89:   
  90:          ////////////////////////////////////////////////////////////////////////////
  91:          ////////////////////////////////////////////////////////////////////////////
  92:      }
  93:   
  94:      ////////////////////////////////////////////////////////////////////////////
  95:      ////////////////////////////////////////////////////////////////////////////
  96:  }