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

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

Service Request Ont Entity Framework class for Fixed Telecommunications Network (FTN) entity model.

    1: using System;
    2: using System.Collections.Generic;
    3: using System.ComponentModel.DataAnnotations;
    4: using System.ComponentModel.DataAnnotations.Schema;
    5: using System.Linq;
    6: using System.Threading;
    7: using System.Threading.Tasks;
    8:  
    9: namespace Ia.Ftn.Cl.Models
   10: {
   11:     ////////////////////////////////////////////////////////////////////////////
   12:  
   13:     /// <summary publish="true">
   14:     /// Service Request Ont Entity Framework class for Fixed Telecommunications Network (FTN) entity model.
   15:     /// </summary>
   16:     /// 
   17:     /// <remarks> 
   18:     /// Copyright © 2006-2021 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   19:     /// </remarks> 
   20:     public class ServiceRequestOnt
   21:     {
   22:         /// <summary/>
   23:         public ServiceRequestOnt()
   24:         {
   25:         }
   26:  
   27:         /// <summary/>
   28:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   29:         public string Id { get; set; }
   30:  
   31:         /// <summary/>
   32:         public int Pon { get; set; }
   33:  
   34:         /// <summary/>
   35:         public int Ont { get; set; }
   36:  
   37:         /// <summary/>
   38:         public string AreaSymbol { get; set; }
   39:  
   40:         /// <summary/>
   41:         public string Block { get; set; }
   42:  
   43:         /// <summary/>
   44:         public string Street { get; set; }
   45:  
   46:         /// <summary/>
   47:         public string PremisesOld { get; set; }
   48:  
   49:         /// <summary/>
   50:         public string PremisesNew { get; set; }
   51:  
   52:         /// <summary/>
   53:         public string Paci { get; set; }
   54:  
   55:         /// <summary/>
   56:         public int PossibleNumberOfTd { get; set; }
   57:  
   58:         /// <summary/>
   59:         public int PossibleNumberOfEthernet { get; set; }
   60:  
   61:         /// <summary/>
   62:         public DateTime Created { get; set; }
   63:  
   64:         /// <summary/>
   65:         public DateTime Updated { get; set; }
   66:  
   67:         /// <summary/>
   68:         [ForeignKey("Access_Id")]
   69:         public virtual Access Access { get; set; }
   70:  
   71:         /// <summary/>
   72:         [NotMapped]
   73:         public string Name
   74:         {
   75:             get
   76:             {
   77:                 string s;
   78:  
   79:                 s = this.AreaSymbol + "." + this.Pon + "." + this.Ont;
   80:  
   81:                 return s;
   82:             }
   83:         }
   84:  
   85:         ////////////////////////////////////////////////////////////////////////////
   86:  
   87:         /// <summary>
   88:         ///
   89:         /// </summary>
   90:         public void Copy(ServiceRequestOnt serviceRequestOnt)
   91:         {
   92:             this.Access = serviceRequestOnt.Access;
   93:             this.Id = serviceRequestOnt.Id;
   94:             this.Created = serviceRequestOnt.Created;
   95:             this.Updated = serviceRequestOnt.Updated;
   96:  
   97:             this.Pon = serviceRequestOnt.Pon;
   98:             this.Ont = serviceRequestOnt.Ont;
   99:             this.AreaSymbol = serviceRequestOnt.AreaSymbol;
  100:             this.Block = serviceRequestOnt.Block;
  101:             this.Street = serviceRequestOnt.Street;
  102:             this.PremisesOld = serviceRequestOnt.PremisesOld;
  103:             this.PremisesNew = serviceRequestOnt.PremisesNew;
  104:             this.Paci = serviceRequestOnt.Paci;
  105:             this.PossibleNumberOfTd = serviceRequestOnt.PossibleNumberOfTd;
  106:             this.PossibleNumberOfEthernet = serviceRequestOnt.PossibleNumberOfEthernet;
  107:         }
  108:  
  109:         ////////////////////////////////////////////////////////////////////////////
  110:  
  111:         /// <summary>
  112:         ///
  113:         /// </summary>
  114:         public bool Update(ServiceRequestOnt updatedServiceRequestOnt)
  115:         {
  116:             // below: this will not update Id, Created
  117:             bool updated;
  118:  
  119:             updated = false;
  120:  
  121:             if (this.Access != updatedServiceRequestOnt.Access) { this.Access = updatedServiceRequestOnt.Access; updated = true; }
  122:  
  123:             if (this.Pon != updatedServiceRequestOnt.Pon) { this.Pon = updatedServiceRequestOnt.Pon; updated = true; }
  124:             if (this.Ont != updatedServiceRequestOnt.Ont) { this.Ont = updatedServiceRequestOnt.Ont; updated = true; }
  125:             if (this.AreaSymbol != updatedServiceRequestOnt.AreaSymbol) { this.AreaSymbol = updatedServiceRequestOnt.AreaSymbol; updated = true; }
  126:             if (this.Block != updatedServiceRequestOnt.Block) { this.Block = updatedServiceRequestOnt.Block; updated = true; }
  127:             if (this.Street != updatedServiceRequestOnt.Street) { this.Street = updatedServiceRequestOnt.Street; updated = true; }
  128:             if (this.PremisesOld != updatedServiceRequestOnt.PremisesOld) { this.PremisesOld = updatedServiceRequestOnt.PremisesOld; updated = true; }
  129:             if (this.PremisesNew != updatedServiceRequestOnt.PremisesNew) { this.PremisesNew = updatedServiceRequestOnt.PremisesNew; updated = true; }
  130:             if (this.Paci != updatedServiceRequestOnt.Paci) { this.Paci = updatedServiceRequestOnt.Paci; updated = true; }
  131:             if (this.PossibleNumberOfTd != updatedServiceRequestOnt.PossibleNumberOfTd) { this.PossibleNumberOfTd = updatedServiceRequestOnt.PossibleNumberOfTd; updated = true; }
  132:             if (this.PossibleNumberOfEthernet != updatedServiceRequestOnt.PossibleNumberOfEthernet) { this.PossibleNumberOfEthernet = updatedServiceRequestOnt.PossibleNumberOfEthernet; updated = true; }
  133:  
  134:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  135:  
  136:             return updated;
  137:         }
  138:  
  139:         ////////////////////////////////////////////////////////////////////////////
  140:         ////////////////////////////////////////////////////////////////////////////
  141:     }
  142:  
  143:     ////////////////////////////////////////////////////////////////////////////
  144:     ////////////////////////////////////////////////////////////////////////////
  145: }