شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة ش.ش.و.

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » ReportHistory

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

Report History Entity Framework class for Next Generation Network (NGN) entity model.

   1:  using System;
   2:  using System.ComponentModel.DataAnnotations.Schema;
   3:   
   4:  namespace Ia.Ngn.Cl.Model
   5:  {
   6:      ////////////////////////////////////////////////////////////////////////////
   7:   
   8:      /// <summary publish="true">
   9:      /// Report History Entity Framework class for Next Generation Network (NGN) entity model.
  10:      /// </summary>
  11:      /// 
  12:      /// <remarks> 
  13:      /// Copyright © 2006-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
  14:      ///
  15:      /// 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
  16:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  17:      ///
  18:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  19:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  20:      /// 
  21:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  22:      /// 
  23:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  24:      /// </remarks> 
  25:      public class ReportHistory
  26:      {
  27:          /// <summary/>
  28:          public ReportHistory() { }
  29:   
  30:          /// <summary/>
  31:          public int Id { get; set; }
  32:   
  33:          /// <summary/>
  34:          public int Indication { get; set; }
  35:   
  36:          /// <summary/>
  37:          public int Action { get; set; }
  38:   
  39:          /// <summary/>
  40:          public int Resolution { get; set; }
  41:   
  42:          /// <summary/>
  43:          public int Estimate { get; set; }
  44:   
  45:          /// <summary/>
  46:          public int Area { get; set; }
  47:   
  48:          /// <summary/>
  49:          public string Detail { get; set; }
  50:   
  51:          /// <summary/>
  52:          public string Note { get; set; }
  53:   
  54:          /// <summary/>
  55:          public DateTime Created { get; set; }
  56:   
  57:          /// <summary/>
  58:          public DateTime Updated { get; set; }
  59:   
  60:          /// <summary/>
  61:          public System.Guid UserId { 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.UserId != updatedReportHistory.UserId) { this.UserId = updatedReportHistory.UserId; 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:  }