Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
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;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:  using System.Net;
   5:  using System.Web.Http;
   6:  using System.Runtime.Serialization;
   7:   
   8:  namespace Ia.Ngn.Cl.Model.Api.Controller
   9:  {
  10:      ////////////////////////////////////////////////////////////////////////////
  11:   
  12:      /// <summary publish="true">
  13:      /// Maintenance API Controller class of Next Generation Network'a (NGN's) model.
  14:      /// </summary>
  15:      /// 
  16:      /// <remarks> 
  17:      /// Copyright © 2006-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  18:      ///
  19:      /// 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
  20:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  21:      ///
  22:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  23:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  24:      /// 
  25:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  26:      /// 
  27:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  28:      /// </remarks> 
  29:      public class MaintenanceController : ApiController
  30:      {
  31:          ////////////////////////////////////////////////////////////////////////////
  32:   
  33:          /// <summary>
  34:          /// Find information about input
  35:          /// </summary>
  36:          [HttpGet]
  37:          public Ia.Ngn.Cl.Model.Ui.Maintenance.Find Find(string key, string input)
  38:          {
  39:              Ia.Cl.Model.Result result;
  40:              Ia.Ngn.Cl.Model.Business.Administration.StaffContact staffContact;
  41:              Ia.Ngn.Cl.Model.Ui.Maintenance.Find find;
  42:              List<Ia.Ngn.Cl.Model.Ui.Service2> serviceList;
  43:   
  44:              result = new Ia.Cl.Model.Result();
  45:   
  46:              staffContact = (from s in Ia.Ngn.Cl.Model.Data.Administration.StaffContactList where s.ApiKey == key select s).SingleOrDefault();
  47:   
  48:              find = new Ia.Ngn.Cl.Model.Ui.Maintenance.Find();
  49:              serviceList = new List<Ia.Ngn.Cl.Model.Ui.Service2>();
  50:   
  51:              //if (!string.IsNullOrEmpty(input)) input = Server.HtmlDecode(input);
  52:              //else input = null;
  53:   
  54:              if (Ia.Ngn.Cl.Model.Business.Authority.StaffContactCanCreateReadUpdateDeleteMaintenanceFind(Ia.Ngn.Cl.Model.Business.Authority.PersistentStorageFunction.Read, staffContact))
  55:              {
  56:                  Ia.Ngn.Cl.Model.Ui.Maintenance.Find.SearchForApi(staffContact, input, out serviceList, out result);
  57:   
  58:                  if (serviceList != null)
  59:                  {
  60:                      find.ServiceList = serviceList;
  61:                  }
  62:                  else
  63:                  {
  64:   
  65:                  }
  66:              }
  67:              else
  68:              {
  69:                  result.AddError("You are not authorized to modify this value (لست مخولاً بتعديل هذه القيمة). ");
  70:              }
  71:   
  72:              find.Result = result;
  73:   
  74:              return find;
  75:          }
  76:   
  77:          ////////////////////////////////////////////////////////////////////////////
  78:          ////////////////////////////////////////////////////////////////////////////
  79:      }
  80:  }