)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
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:     ///
   18:     /// 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
   19:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   20:     ///
   21:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   22:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   23:     /// 
   24:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   25:     /// 
   26:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   27:     /// </remarks> 
   28:     public class ReportHistory
   29:     {
   30:         /// <summary/>
   31:         public ReportHistory() { }
   32:  
   33:         /// <summary/>
   34:         public int Id { get; set; }
   35:  
   36:         /// <summary/>
   37:         public int Indication { get; set; }
   38:  
   39:         /// <summary/>
   40:         public int Action { get; set; }
   41:  
   42:         /// <summary/>
   43:         public int Resolution { get; set; }
   44:  
   45:         /// <summary/>
   46:         public int Estimate { get; set; }
   47:  
   48:         /// <summary/>
   49:         public int Area { get; set; }
   50:  
   51:         /// <summary/>
   52:         public string Detail { get; set; }
   53:  
   54:         /// <summary/>
   55:         public string Note { get; set; }
   56:  
   57:         /// <summary/>
   58:         public bool ComplainantNotified { get; set; }
   59:  
   60:         /// <summary/>
   61:         public DateTime Created { get; set; }
   62:  
   63:         /// <summary/>
   64:         public DateTime Updated { get; set; }
   65:  
   66:         /// <summary/>
   67:         public string FrameworkId { get; set; }
   68:  
   69:         /// <summary/>
   70:         [ForeignKey("StaffIdentityUser_Id")]
   71:         public virtual StaffIdentityUser StaffIdentityUser { get; set; }
   72:  
   73:         /// <summary/>
   74:         [ForeignKey("Report_Id")]
   75:         public virtual Report Report { get; set; }
   76:  
   77:         ////////////////////////////////////////////////////////////////////////////
   78:  
   79:         /// <summary>
   80:         ///
   81:         /// </summary>
   82:         public bool UpdateMigrated(ReportHistory updatedReportHistory)
   83:         {
   84:             // below: this will not update Id, Created
   85:             bool updated;
   86:  
   87:             updated = false;
   88:  
   89:             if (this.Action != updatedReportHistory.Action) { this.Action = updatedReportHistory.Action; updated = true; }
   90:             if (this.Area != updatedReportHistory.Area) { this.Area = updatedReportHistory.Area; updated = true; }
   91:             if (this.Detail != updatedReportHistory.Detail) { this.Detail = updatedReportHistory.Detail; updated = true; }
   92:             if (this.Note != updatedReportHistory.Note) { this.Note = updatedReportHistory.Note; updated = true; }
   93:             if (this.Estimate != updatedReportHistory.Estimate) { this.Estimate = updatedReportHistory.Estimate; updated = true; }
   94:             if (this.Indication != updatedReportHistory.Indication) { this.Indication = updatedReportHistory.Indication; updated = true; }
   95:  
   96:             if (this.Resolution != updatedReportHistory.Resolution) { this.Resolution = updatedReportHistory.Resolution; updated = true; }
   97:             if (this.Report != updatedReportHistory.Report) { this.Report = updatedReportHistory.Report; updated = true; }
   98:  
   99:             if (this.StaffIdentityUser.Id != updatedReportHistory.StaffIdentityUser.Id) { this.StaffIdentityUser.Id = updatedReportHistory.StaffIdentityUser.Id; updated = true; }
  100:  
  101:             // below: this is an update of migrated data
  102:             if (this.Created != updatedReportHistory.Created) { this.Created = updatedReportHistory.Created; updated = true; }
  103:             if (this.Updated != updatedReportHistory.Updated) { this.Updated = updatedReportHistory.Updated; updated = true; }
  104:  
  105:             //if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  106:  
  107:             return updated;
  108:         }
  109:  
  110:         ////////////////////////////////////////////////////////////////////////////
  111:         ////////////////////////////////////////////////////////////////////////////
  112:     }
  113:  
  114:     ////////////////////////////////////////////////////////////////////////////
  115:     ////////////////////////////////////////////////////////////////////////////
  116: }