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

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » MaintenanceController

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

Maintenance API Controller class of Next Generation Network'a (NGN's) model.

   1:  using System.Collections.Generic;
   2:  using System.Linq;
   3:  using System.Web.Http;
   4:   
   5:  namespace Ia.Ngn.Cl.Model.Api.Controller
   6:  {
   7:      ////////////////////////////////////////////////////////////////////////////
   8:   
   9:      /// <summary publish="true">
  10:      /// Maintenance API Controller class of Next Generation Network'a (NGN's) model.
  11:      /// </summary>
  12:      /// 
  13:      /// <remarks> 
  14:      /// Copyright © 2006-2017 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 MaintenanceController : ApiController
  27:      {
  28:          ////////////////////////////////////////////////////////////////////////////
  29:   
  30:          /// <summary>
  31:          /// Find information about input
  32:          /// </summary>
  33:          [HttpGet]
  34:          public Ia.Ngn.Cl.Model.Ui.Maintenance.Find Find(string key, string input)
  35:          {
  36:              Ia.Cl.Model.Result result;
  37:              Ia.Ngn.Cl.Model.Business.Administration.StaffContact staffContact;
  38:              Ia.Ngn.Cl.Model.Ui.Maintenance.Find find;
  39:              List<Ia.Ngn.Cl.Model.Ui.Service2> serviceList;
  40:   
  41:              result = new Ia.Cl.Model.Result();
  42:   
  43:              staffContact = (from s in Ia.Ngn.Cl.Model.Data.Administration.StaffContactList where s.ApiKey == key select s).SingleOrDefault();
  44:   
  45:              find = new Ia.Ngn.Cl.Model.Ui.Maintenance.Find();
  46:              serviceList = new List<Ia.Ngn.Cl.Model.Ui.Service2>();
  47:   
  48:              //if (!string.IsNullOrEmpty(input)) input = Server.HtmlDecode(input);
  49:              //else input = null;
  50:   
  51:              if (Ia.Ngn.Cl.Model.Business.Authority.StaffContactCanCreateReadUpdateDeleteMaintenanceFind(Ia.Ngn.Cl.Model.Business.Authority.PersistentStorageFunction.Read, staffContact))
  52:              {
  53:                  Ia.Ngn.Cl.Model.Ui.Maintenance.Find.SearchForApi(staffContact.Staff.Framework, input, out serviceList, out result);
  54:   
  55:                  if (serviceList != null)
  56:                  {
  57:                      find.ServiceList = serviceList;
  58:                  }
  59:                  else
  60:                  {
  61:   
  62:                  }
  63:              }
  64:              else
  65:              {
  66:                  result.AddError("You are not authorized to modify this value (لست مخولاً بتعديل هذه القيمة). ");
  67:              }
  68:   
  69:              find.Result = result;
  70:   
  71:              return find;
  72:          }
  73:   
  74:          ////////////////////////////////////////////////////////////////////////////
  75:          ////////////////////////////////////////////////////////////////////////////
  76:      }
  77:  }