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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » ServiceAccessNameGatewayIdController

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

Service, Access, and GatewayId API Controller class of Next Generation Network'a (NGN's) model.

   1:  using System.Web.Http;
   2:   
   3:  namespace Ia.Ngn.Cl.Model.Api.Controller
   4:  {
   5:      ////////////////////////////////////////////////////////////////////////////
   6:   
   7:      /// <summary publish="true">
   8:      /// Service, Access, and GatewayId API Controller class of Next Generation Network'a (NGN's) model.
   9:      /// </summary>
  10:      /// 
  11:      /// <remarks> 
  12:      /// Copyright © 2006-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  13:      ///
  14:      /// 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
  15:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  16:      ///
  17:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  18:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  19:      /// 
  20:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  21:      /// 
  22:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  23:      /// </remarks> 
  24:      public class ServiceAccessNameGatewayIdController : ApiController
  25:      {
  26:          ////////////////////////////////////////////////////////////////////////////
  27:   
  28:          /// <summary>
  29:          ///
  30:          /// </summary>
  31:          [HttpGet]
  32:          public bool ServiceEnqueue(string service)
  33:          {
  34:              bool isSuccessful;
  35:              int number;
  36:              //Guid userId;
  37:              //Ia.Cl.Model.Result result;
  38:   
  39:              //result = new Ia.Cl.Model.Result();
  40:              //userId = Ia.Ngn.Cl.Model.Business.Contact.GetStaffOrContactUserIdFromKey(key);
  41:   
  42:              if (int.TryParse(service, out number))
  43:              {
  44:                  if (Ia.Ngn.Cl.Model.Business.Service.NumberIsWithinAllowedDomainList(number))
  45:                  {
  46:                      Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.Enqueue(service);
  47:   
  48:                      isSuccessful = true;
  49:                  }
  50:                  else isSuccessful = false;
  51:              }
  52:              else isSuccessful = false;
  53:   
  54:              return isSuccessful;
  55:          }
  56:   
  57:          /*
  58:          ////////////////////////////////////////////////////////////////////////////
  59:  
  60:          /// <summary>
  61:          ///
  62:          /// </summary>
  63:          [HttpGet]
  64:          public string ServiceDequeue()
  65:          {
  66:              string service;
  67:  
  68:              if (Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.Count > 0) service = Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.Dequeue;
  69:              else service = null;
  70:  
  71:              return service;
  72:          }
  73:  
  74:          ////////////////////////////////////////////////////////////////////////////
  75:  
  76:          /// <summary>
  77:          ///
  78:          /// </summary>
  79:          [HttpGet]
  80:          public long ServiceCount()
  81:          {
  82:              //Guid userId;
  83:              //Ia.Cl.Model.Result result;
  84:  
  85:              //result = new Ia.Cl.Model.Result();
  86:              //userId = Ia.Ngn.Cl.Model.Business.Contact.GetStaffOrContactUserIdFromKey(key);
  87:  
  88:              return Ia.Ngn.Cl.Model.Data.Msmq.ServiceQueue.Count;
  89:          }
  90:          */
  91:   
  92:          ////////////////////////////////////////////////////////////////////////////
  93:          ////////////////////////////////////////////////////////////////////////////
  94:   
  95:          /// <summary>
  96:          ///
  97:          /// </summary>
  98:          [HttpGet]
  99:          public bool AccessNameEnqueue(string input)
 100:          {
 101:              bool isSuccessful;
 102:              string accessName;
 103:              //Guid userId;
 104:              //Ia.Cl.Model.Result result;
 105:   
 106:              //result = new Ia.Cl.Model.Result();
 107:              //userId = Ia.Ngn.Cl.Model.Business.Contact.GetStaffOrContactUserIdFromKey(key);
 108:   
 109:              if (Ia.Ngn.Cl.Model.Data.NetworkDesignDocument.AccessNameIsWithinAllowedOntList(input, out accessName))
 110:              {
 111:                  Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.Enqueue(accessName);
 112:   
 113:                  isSuccessful = true;
 114:              }
 115:              else isSuccessful = false;
 116:   
 117:              return isSuccessful;
 118:          }
 119:   
 120:          /*
 121:          ////////////////////////////////////////////////////////////////////////////
 122:  
 123:          /// <summary>
 124:          ///
 125:          /// </summary>
 126:          [HttpGet]
 127:          public string AccessNameDequeue()
 128:          {
 129:              string accessName;
 130:              //Guid userId;
 131:              //Ia.Cl.Model.Result result;
 132:  
 133:              //result = new Ia.Cl.Model.Result();
 134:              //userId = Ia.Ngn.Cl.Model.Business.Contact.GetStaffOrContactUserIdFromKey(key);
 135:  
 136:              if (Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.Count > 0) accessName = Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.Dequeue;
 137:              else accessName = null;
 138:  
 139:              return accessName;
 140:          }
 141:  
 142:          ////////////////////////////////////////////////////////////////////////////
 143:  
 144:          /// <summary>
 145:          ///
 146:          /// </summary>
 147:          [HttpGet]
 148:          public long AccessNameCount()
 149:          {
 150:              //Guid userId;
 151:              //Ia.Cl.Model.Result result;
 152:  
 153:              //result = new Ia.Cl.Model.Result();
 154:              //userId = Ia.Ngn.Cl.Model.Business.Contact.GetStaffOrContactUserIdFromKey(key);
 155:  
 156:              return Ia.Ngn.Cl.Model.Data.Msmq.AccessNameQueue.Count;
 157:          }
 158:          */
 159:   
 160:          ////////////////////////////////////////////////////////////////////////////
 161:          ////////////////////////////////////////////////////////////////////////////
 162:   
 163:          /// <summary>
 164:          ///
 165:          /// </summary>
 166:          [HttpGet]
 167:          public bool GatewayIdEnqueue(int gatewayId)
 168:          {
 169:              bool isSuccessful;
 170:              //Guid userId;
 171:              //Ia.Cl.Model.Result result;
 172:   
 173:              //result = new Ia.Cl.Model.Result();
 174:              //userId = Ia.Ngn.Cl.Model.Business.Contact.GetStaffOrContactUserIdFromKey(key);
 175:   
 176:              if (gatewayId >= Ia.Ngn.Cl.Model.Business.Nokia.Ims.FirstGatewayId && gatewayId <= Ia.Ngn.Cl.Model.Business.Nokia.Ims.LastGatewayId)
 177:              {
 178:                  Ia.Ngn.Cl.Model.Data.Msmq.GatewayIdQueue.Enqueue(gatewayId);
 179:   
 180:                  isSuccessful = true;
 181:              }
 182:              else isSuccessful = false;
 183:   
 184:              return isSuccessful;
 185:          }
 186:   
 187:          /*
 188:          ////////////////////////////////////////////////////////////////////////////
 189:  
 190:          /// <summary>
 191:          ///
 192:          /// </summary>
 193:          [HttpGet]
 194:          public int GatewayIdDequeue()
 195:          {
 196:              int gatewayId;
 197:              //Guid userId;
 198:              //Ia.Cl.Model.Result result;
 199:  
 200:              //result = new Ia.Cl.Model.Result();
 201:              //userId = Ia.Ngn.Cl.Model.Business.Contact.GetStaffOrContactUserIdFromKey(key);
 202:  
 203:              if (Ia.Ngn.Cl.Model.Data.Msmq.GatewayIdQueue.Count > 0) gatewayId = Ia.Ngn.Cl.Model.Data.Msmq.GatewayIdQueue.Dequeue;
 204:              else gatewayId = 0;
 205:  
 206:              return gatewayId;
 207:          }
 208:  
 209:          ////////////////////////////////////////////////////////////////////////////
 210:  
 211:          /// <summary>
 212:          ///
 213:          /// </summary>
 214:          [HttpGet]
 215:          public long GatewayIdCount()
 216:          {
 217:              //Guid userId;
 218:              //Ia.Cl.Model.Result result;
 219:  
 220:              //result = new Ia.Cl.Model.Result();
 221:              //userId = Ia.Ngn.Cl.Model.Business.Contact.GetStaffOrContactUserIdFromKey(key);
 222:  
 223:              return Ia.Ngn.Cl.Model.Data.Msmq.GatewayIdQueue.Count;
 224:          }
 225:          */
 226:   
 227:          ////////////////////////////////////////////////////////////////////////////
 228:          ////////////////////////////////////////////////////////////////////////////
 229:      }
 230:  }