)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
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:     ///
   22:     /// 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
   23:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   24:     ///
   25:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   26:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   27:     /// 
   28:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   29:     /// 
   30:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   31:     /// </remarks> 
   32:     [DataContract(IsReference = true, Namespace = "kw.com.ia.ftn.api", Name = "ServiceRequestType")]
   33:     public class ServiceRequestType
   34:     {
   35:         /// <summary/>
   36:         public ServiceRequestType()
   37:         {
   38:         }
   39:  
   40:         /// <summary/>
   41:         [DataMember]
   42:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   43:         public int Id { get; set; }
   44:  
   45:         /// <summary/>
   46:         [DataMember]
   47:         public int TypeId { get; set; }
   48:  
   49:         /// <summary/>
   50:         [DataMember]
   51:         public string Value { get; set; }
   52:  
   53:         /// <summary/>
   54:         [DataMember]
   55:         public DateTime Created { get; set; }
   56:  
   57:         /// <summary/>
   58:         [DataMember]
   59:         public DateTime Updated { get; set; }
   60:  
   61:         /// <summary/>
   62:         [ForeignKey("ServiceRequest_Id")]
   63:         public virtual ServiceRequest ServiceRequest { get; set; }
   64:  
   65:         ////////////////////////////////////////////////////////////////////////////
   66:  
   67:         /// <summary>
   68:         ///
   69:         /// </summary>
   70:         public bool Update(ServiceRequestType updatedServiceRequestType)
   71:         {
   72:             // below: this will not update Id, Created
   73:             bool updated;
   74:  
   75:             updated = false;
   76:  
   77:             if (this.TypeId != updatedServiceRequestType.TypeId) { this.TypeId = updatedServiceRequestType.TypeId; updated = true; }
   78:             if (this.Value != updatedServiceRequestType.Value) { this.Value = updatedServiceRequestType.Value; updated = true; }
   79:  
   80:             // below: ?? 
   81:             //if (this.ServiceRequest == null || this.ServiceRequest != updatedServiceRequestType.ServiceRequest) { this.ServiceRequest = updatedServiceRequestType.ServiceRequest; updated = true; }
   82:  
   83:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
   84:  
   85:             return updated;
   86:         }
   87:  
   88:         ////////////////////////////////////////////////////////////////////////////
   89:         ////////////////////////////////////////////////////////////////////////////
   90:     }
   91:  
   92:     ////////////////////////////////////////////////////////////////////////////
   93:     ////////////////////////////////////////////////////////////////////////////
   94: }