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

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

ServiceExemption Framework class for Fixed Telecommunications Network (FTN) entity model.

    1: using System;
    2: using System.ComponentModel.DataAnnotations.Schema;
    3: using System.Linq;
    4: using System.Threading;
    5: using System.Threading.Tasks;
    6:  
    7: namespace Ia.Ftn.Cl.Models
    8: {
    9:     ////////////////////////////////////////////////////////////////////////////
   10:  
   11:     /// <summary publish="true">
   12:     /// ServiceExemption Framework class for Fixed Telecommunications Network (FTN) entity model.
   13:     /// </summary>
   14:     /// 
   15:     /// <remarks> 
   16:     /// Copyright © 2006-2021 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   17:     /// </remarks> 
   18:     public class ServiceExemption
   19:     {
   20:         /// <summary/>
   21:         public ServiceExemption() { }
   22:  
   23:         /// <summary/>
   24:         public string Id { get; set; }
   25:  
   26:         /// <summary/>
   27:         public string Service { get; set; }
   28:  
   29:         /// <summary/>
   30:         public int ServiceType { get; set; }
   31:  
   32:         /// <summary/>
   33:         public string Note { get; set; }
   34:  
   35:         /// <summary/>
   36:         public DateTime Created { get; set; }
   37:  
   38:         /// <summary/>
   39:         public DateTime Updated { get; set; }
   40:  
   41:         /// <summary/>
   42:         [ForeignKey("StaffIdentityUser_Id")]
   43:         public virtual StaffIdentityUser StaffIdentityUser { get; set; }
   44:  
   45:         ////////////////////////////////////////////////////////////////////////////
   46:  
   47:         /// <summary>
   48:         ///
   49:         /// </summary>
   50:         public static string ServiceServiceExemptionId(string service, int serviceType)
   51:         {
   52:             // below:
   53:             string id;
   54:  
   55:             id = Ia.Ftn.Cl.Models.Business.Service2.ServiceId(service, serviceType);
   56:  
   57:             return id;
   58:         }
   59:  
   60:         ////////////////////////////////////////////////////////////////////////////
   61:  
   62:         /// <summary>
   63:         ///
   64:         /// </summary>
   65:         public bool Update(Ia.Ftn.Cl.Models.ServiceExemption updateServiceExemption)
   66:         {
   67:             // below: this will not update Id, Created
   68:             bool updated;
   69:  
   70:             updated = false;
   71:  
   72:             if (this.Note != updateServiceExemption.Note) { this.Note = updateServiceExemption.Note; updated = true; }
   73:             if (this.StaffIdentityUser.Id != updateServiceExemption.StaffIdentityUser.Id) { this.StaffIdentityUser.Id = updateServiceExemption.StaffIdentityUser.Id; updated = true; }
   74:  
   75:             if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
   76:  
   77:             return updated;
   78:         }
   79:  
   80:         ////////////////////////////////////////////////////////////////////////////
   81:         ////////////////////////////////////////////////////////////////////////////
   82:     }
   83:  
   84:     ////////////////////////////////////////////////////////////////////////////
   85:     ////////////////////////////////////////////////////////////////////////////
   86: }