)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » AccessController (Ia.Ftn.Api.Wa.Controllers)

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

Access API Controller class of Fixed Telecommunications Network (FTN) model.

    1: using Microsoft.AspNetCore.Authorization;
    2: using Microsoft.AspNetCore.Mvc;
    3: using System.Runtime.Serialization;
    4:  
    5: namespace Ia.Ftn.Api.Wa.Controllers
    6: {
    7:     ////////////////////////////////////////////////////////////////////////////
    8:  
    9:     /// <summary publish="true">
   10:     /// Access API Controller class of Fixed Telecommunications Network (FTN) model.
   11:     /// </summary>
   12:     /// 
   13:     /// <remarks> 
   14:     /// Copyright © 2006-2024 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated 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:     [ApiController]
   27:     //[Authorize]
   28:     public class AccessController : ControllerBase
   29:     {
   30:         private static readonly object objectLock = new object();
   31:  
   32:         ////////////////////////////////////////////////////////////////////////////
   33:  
   34:         /// <summary>
   35:         /// AccessResponse
   36:         /// </summary>
   37:         [DataContract(IsReference = true, Namespace = "kw.com.ia.ofn.api.access", Name = "AccessResponse")]
   38:         public class AccessResponse
   39:         {
   40:             /// <summary/>
   41:             [DataMember]
   42:             public string Id { get; set; }
   43:  
   44:             /// <summary/>
   45:             [DataMember]
   46:             public int Olt { get; set; }
   47:  
   48:             /// <summary/>
   49:             [DataMember]
   50:             public int Pon { get; set; }
   51:  
   52:             /// <summary/>
   53:             [DataMember]
   54:             public int Ont { get; set; }
   55:  
   56:             /// <summary/>
   57:             [DataMember]
   58:             public string Odf { get; set; }
   59:  
   60:             /// <summary/>
   61:             [DataMember]
   62:             public int AreaId { get; set; }
   63:  
   64:             /// <summary/>
   65:             [DataMember]
   66:             public string Block { get; set; }
   67:  
   68:             /// <summary/>
   69:             [DataMember]
   70:             public string Street { get; set; }
   71:  
   72:             /// <summary/>
   73:             [DataMember]
   74:             public string PremisesOld { get; set; }
   75:  
   76:             /// <summary/>
   77:             [DataMember]
   78:             public string PremisesNew { get; set; }
   79:  
   80:             /// <summary/>
   81:             [DataMember]
   82:             public string Paci { get; set; }
   83:  
   84:             /// <summary/>
   85:             [DataMember]
   86:             public string Note { get; set; }
   87:  
   88:             /// <summary/>
   89:             [DataMember]
   90:             public DateTime Created { get; set; }
   91:  
   92:             /// <summary/>
   93:             [DataMember]
   94:             public DateTime Updated { get; set; }
   95:  
   96:             /// <summary/>
   97:             [DataMember]
   98:             public Ia.Ftn.Cl.Models.StaffIdentityUser StaffIdentityUser { get; set; }
   99:         }
  100:  
  101:         ////////////////////////////////////////////////////////////////////////////
  102:  
  103:         /// <summary>
  104:         /// List of Accesses
  105:         /// </summary>
  106:         [HttpGet]
  107:         [Route("api/v1/accesses")]
  108:         public List<AccessResponse> List()
  109:         {
  110:             var list0 = Ia.Ftn.Cl.Models.Data.Access.List();
  111:  
  112:             var list = new List<AccessResponse>();
  113:  
  114:             foreach (var l in list0)
  115:             {
  116:                 list.Add(new AccessResponse
  117:                 {
  118:                     Id = l.Id,
  119:                     Olt = l.Olt,
  120:                     Pon = l.Pon,
  121:                     Ont = l.Ont,
  122:                     Odf = l.Odf,
  123:                     AreaId = l.AreaId,
  124:                     Block = l.Block,
  125:                     Street = l.Street,
  126:                     PremisesOld = l.PremisesOld,
  127:                     PremisesNew = l.PremisesNew,
  128:                     Paci = l.Paci,
  129:                     Note = l.Note,
  130:                     Created = l.Created,
  131:                     Updated = l.Updated,
  132:                     StaffIdentityUser = l.StaffIdentityUser
  133:                 });
  134:             }
  135:  
  136:             return list;
  137:         }
  138:  
  139:         ////////////////////////////////////////////////////////////////////////////
  140:         ////////////////////////////////////////////////////////////////////////////
  141:     }
  142: }