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

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

Report History Entity 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:     /// Report History Entity Framework class for Fixed Telecommunications Network (FTN) entity model.
   13:     /// </summary>
   14:     /// 
   15:     /// <remarks> 
   16:     /// Copyright © 2006-2024 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   17:     /// </remarks> 
   18:     public class ReportHistory
   19:     {
   20:         /// <summary/>
   21:         public ReportHistory() { }
   22:  
   23:         /// <summary/>
   24:         public int Id { get; set; }
   25:  
   26:         /// <summary/>
   27:         public int Indication { get; set; }
   28:  
   29:         /// <summary/>
   30:         public int Action { get; set; }
   31:  
   32:         /// <summary/>
   33:         public int Resolution { get; set; }
   34:  
   35:         /// <summary/>
   36:         public int Estimate { get; set; }
   37:  
   38:         /// <summary/>
   39:         public int Area { get; set; }
   40:  
   41:         /// <summary/>
   42:         public string Detail { get; set; }
   43:  
   44:         /// <summary/>
   45:         public string Note { get; set; }
   46:  
   47:         /// <summary/>
   48:         public bool ComplainantNotified { get; set; }
   49:  
   50:         /// <summary/>
   51:         public DateTime Created { get; set; }
   52:  
   53:         /// <summary/>
   54:         public DateTime Updated { get; set; }
   55:  
   56:         /// <summary/>
   57:         public string FrameworkId { get; set; }
   58:  
   59:         /// <summary/>
   60:         [ForeignKey("StaffIdentityUser_Id")]
   61:         public virtual StaffIdentityUser StaffIdentityUser { get; set; }
   62:  
   63:         /// <summary/>
   64:         [ForeignKey("Report_Id")]
   65:         public virtual Report Report { get; set; }
   66:  
   67:         ////////////////////////////////////////////////////////////////////////////
   68:  
   69:         /// <summary>
   70:         ///
   71:         /// </summary>
   72:         public bool UpdateMigrated(ReportHistory updatedReportHistory)
   73:         {
   74:             // below: this will not update Id, Created
   75:             bool updated;
   76:  
   77:             updated = false;
   78:  
   79:             if (this.Action != updatedReportHistory.Action) { this.Action = updatedReportHistory.Action; updated = true; }
   80:             if (this.Area != updatedReportHistory.Area) { this.Area = updatedReportHistory.Area; updated = true; }
   81:             if (this.Detail != updatedReportHistory.Detail) { this.Detail = updatedReportHistory.Detail; updated = true; }
   82:             if (this.Note != updatedReportHistory.Note) { this.Note = updatedReportHistory.Note; updated = true; }
   83:             if (this.Estimate != updatedReportHistory.Estimate) { this.Estimate = updatedReportHistory.Estimate; updated = true; }
   84:             if (this.Indication != updatedReportHistory.Indication) { this.Indication = updatedReportHistory.Indication; updated = true; }
   85:  
   86:             if (this.Resolution != updatedReportHistory.Resolution) { this.Resolution = updatedReportHistory.Resolution; updated = true; }
   87:             if (this.Report != updatedReportHistory.Report) { this.Report = updatedReportHistory.Report; updated = true; }
   88:  
   89:             if (this.StaffIdentityUser.Id != updatedReportHistory.StaffIdentityUser.Id) { this.StaffIdentityUser.Id = updatedReportHistory.StaffIdentityUser.Id; updated = true; }
   90:  
   91:             // below: this is an update of migrated data
   92:             if (this.Created != updatedReportHistory.Created) { this.Created = updatedReportHistory.Created; updated = true; }
   93:             if (this.Updated != updatedReportHistory.Updated) { this.Updated = updatedReportHistory.Updated; updated = true; }
   94:  
   95:             //if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
   96:  
   97:             return updated;
   98:         }
   99:  
  100:         ////////////////////////////////////////////////////////////////////////////
  101:         ////////////////////////////////////////////////////////////////////////////
  102:     }
  103:  
  104:     ////////////////////////////////////////////////////////////////////////////
  105:     ////////////////////////////////////////////////////////////////////////////
  106: }