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

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

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

    1: using Microsoft.EntityFrameworkCore.Metadata.Internal;
    2: using System;
    3: using System.Collections.Generic;
    4: using System.ComponentModel.DataAnnotations;
    5: using System.ComponentModel.DataAnnotations.Schema;
    6: using System.Linq;
    7: using System.Runtime.Serialization;
    8: using System.Threading;
    9: using System.Threading.Tasks;
   10:  
   11: namespace Ia.Ftn.Cl.Models
   12: {
   13:     ////////////////////////////////////////////////////////////////////////////
   14:  
   15:     /// <summary publish="true">
   16:     /// Service Request Type Entity Framework class for Fixed Telecommunications Network (FTN) entity model.
   17:     /// </summary>
   18:     /// 
   19:     /// <remarks> 
   20:     /// Copyright © 2006-2021 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   21:     /// </remarks> 
   22:     [DataContract(IsReference = true, Namespace = "kw.com.ia.ftn.api", Name = "ServiceRequestType")]
   23:     public class ServiceRequestType
   24:     {
   25:         /// <summary/>
   26:         public ServiceRequestType()
   27:         {
   28:         }
   29:  
   30:         /// <summary/>
   31:         [DataMember]
   32:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   33:         public int Id { get; set; }
   34:  
   35:         /// <summary/>
   36:         [DataMember]
   37:         public int TypeId { get; set; }
   38:  
   39:         /// <summary/>
   40:         [DataMember]
   41:         public string Value { get; set; }
   42:  
   43:         /// <summary/>
   44:         [DataMember]
   45:         public DateTime Created { get; set; }
   46:  
   47:         /// <summary/>
   48:         [DataMember]
   49:         public DateTime Updated { get; set; }
   50:  
   51:         /// <summary/>
   52:         [ForeignKey("ServiceRequest_Id")]
   53:         public virtual ServiceRequest ServiceRequest { get; set; }
   54:  
   55:         ////////////////////////////////////////////////////////////////////////////
   56:  
   57:         /// <summary>
   58:         ///
   59:         /// </summary>
   60:         public bool Update(ServiceRequestType updatedServiceRequestType)
   61:         {
   62:             // below: this will not update Id, Created
   63:             bool updated;
   64:  
   65:             updated = false;
   66:  
   67:             if (this.TypeId != updatedServiceRequestType.TypeId) { this.TypeId = updatedServiceRequestType.TypeId; updated = true; }
   68:             if (this.Value != updatedServiceRequestType.Value) { this.Value = updatedServiceRequestType.Value; updated = true; }
   69:  
   70:             // below: ?? 
   71:             //if (this.ServiceRequest == null || this.ServiceRequest != updatedServiceRequestType.ServiceRequest) { this.ServiceRequest = updatedServiceRequestType.ServiceRequest; updated = true; }
   72:  
   73:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
   74:  
   75:             return updated;
   76:         }
   77:  
   78:         ////////////////////////////////////////////////////////////////////////////
   79:         ////////////////////////////////////////////////////////////////////////////
   80:     }
   81:  
   82:     ////////////////////////////////////////////////////////////////////////////
   83:     ////////////////////////////////////////////////////////////////////////////
   84: }