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

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

Service Request Ont Detail 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 Detail 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 ServiceRequestOntDetail
   21:     {
   22:         /// <summary/>
   23:         public ServiceRequestOntDetail()
   24:         {
   25:         }
   26:  
   27:         /// <summary/>
   28:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   29:         public string Id { get; set; }
   30:  
   31:         /// <summary/>
   32:         public int ServiceType { get; set; }
   33:  
   34:         /// <summary/>
   35:         public int ServicePosition { get; set; }
   36:  
   37:         /// <summary/>
   38:         public string Service { get; set; }
   39:  
   40:         /// <summary/>
   41:         public DateTime Created { get; set; }
   42:  
   43:         /// <summary/>
   44:         public DateTime Updated { get; set; }
   45:  
   46:         /// <summary/>
   47:         [ForeignKey("ServiceRequestOnt_Id")]
   48:         public virtual ServiceRequestOnt ServiceRequestOnt { get; set; }
   49:  
   50:         ////////////////////////////////////////////////////////////////////////////
   51:  
   52:         /// <summary>
   53:         ///
   54:         /// </summary>
   55:         public void Copy(ServiceRequestOntDetail serviceRequestOntDetail)
   56:         {
   57:             this.ServiceRequestOnt = serviceRequestOntDetail.ServiceRequestOnt;
   58:             this.Id = serviceRequestOntDetail.Id;
   59:             this.Created = serviceRequestOntDetail.Created;
   60:             this.Updated = serviceRequestOntDetail.Updated;
   61:  
   62:             this.ServiceType = serviceRequestOntDetail.ServiceType;
   63:             this.ServicePosition = serviceRequestOntDetail.ServicePosition;
   64:             this.Service = serviceRequestOntDetail.Service;
   65:         }
   66:  
   67:         ////////////////////////////////////////////////////////////////////////////
   68:  
   69:         /// <summary>
   70:         ///
   71:         /// </summary>
   72:         public bool Update(ServiceRequestOntDetail updatedServiceRequestOntDetail)
   73:         {
   74:             // below: this will not update Id, Created
   75:             bool updated;
   76:  
   77:             updated = false;
   78:  
   79:             if (this.ServiceRequestOnt != updatedServiceRequestOntDetail.ServiceRequestOnt) { this.ServiceRequestOnt = updatedServiceRequestOntDetail.ServiceRequestOnt; updated = true; }
   80:  
   81:             if (this.ServiceType != updatedServiceRequestOntDetail.ServiceType) { this.ServiceType = updatedServiceRequestOntDetail.ServiceType; updated = true; }
   82:             if (this.ServicePosition != updatedServiceRequestOntDetail.ServicePosition) { this.ServicePosition = updatedServiceRequestOntDetail.ServicePosition; updated = true; }
   83:             if (this.Service != updatedServiceRequestOntDetail.Service) { this.Service = updatedServiceRequestOntDetail.Service; updated = true; }
   84:  
   85:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
   86:  
   87:             return updated;
   88:         }
   89:  
   90:         ////////////////////////////////////////////////////////////////////////////
   91:         ////////////////////////////////////////////////////////////////////////////
   92:     }
   93:  
   94:     ////////////////////////////////////////////////////////////////////////////
   95:     ////////////////////////////////////////////////////////////////////////////
   96: }