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

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:   
   3:  namespace Ia.Ngn.Cl.Model
   4:  {
   5:      ////////////////////////////////////////////////////////////////////////////
   6:   
   7:      /// <summary publish="true">
   8:      /// Report History Entity Framework class for Next Generation Network (NGN) entity model.
   9:      /// </summary>
  10:      /// 
  11:      /// <remarks> 
  12:      /// Copyright © 2006-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  13:      ///
  14:      /// 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
  15:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  16:      ///
  17:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  18:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  19:      /// 
  20:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  21:      /// 
  22:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  23:      /// </remarks> 
  24:      public class ReportHistory
  25:      {
  26:          /// <summary/>
  27:          public ReportHistory() { }
  28:   
  29:          /// <summary/>
  30:          public int Id { get; set; }
  31:   
  32:          /// <summary/>
  33:          public int Indication { get; set; }
  34:   
  35:          /// <summary/>
  36:          public int Action { get; set; }
  37:   
  38:          /// <summary/>
  39:          public int Resolution { get; set; }
  40:   
  41:          /// <summary/>
  42:          public int Estimate { get; set; }
  43:   
  44:          /// <summary/>
  45:          public int Area { get; set; }
  46:   
  47:          /// <summary/>
  48:          public string Detail { get; set; }
  49:   
  50:          /// <summary/>
  51:          public string Note { get; set; }
  52:   
  53:          /// <summary/>
  54:          public DateTime Created { get; set; }
  55:   
  56:          /// <summary/>
  57:          public DateTime Updated { get; set; }
  58:   
  59:          /// <summary/>
  60:          public System.Guid UserId { get; set; }
  61:   
  62:          /// <summary/>
  63:          public virtual Report Report { get; set; }
  64:   
  65:          ////////////////////////////////////////////////////////////////////////////
  66:   
  67:          /// <summary>
  68:          ///
  69:          /// </summary>
  70:          public bool UpdateMigrated(ReportHistory updatedReportHistory)
  71:          {
  72:              // below: this will not update Id, Created
  73:              bool updated;
  74:   
  75:              updated = false;
  76:   
  77:              if (this.Action != updatedReportHistory.Action) { this.Action = updatedReportHistory.Action; updated = true; }
  78:              if (this.Area != updatedReportHistory.Area) { this.Area = updatedReportHistory.Area; updated = true; }
  79:              if (this.Detail != updatedReportHistory.Detail) { this.Detail = updatedReportHistory.Detail; updated = true; }
  80:              if (this.Note != updatedReportHistory.Note) { this.Note = updatedReportHistory.Note; updated = true; }
  81:              if (this.Estimate != updatedReportHistory.Estimate) { this.Estimate = updatedReportHistory.Estimate; updated = true; }
  82:              if (this.Indication != updatedReportHistory.Indication) { this.Indication = updatedReportHistory.Indication; updated = true; }
  83:   
  84:              if (this.Resolution != updatedReportHistory.Resolution) { this.Resolution = updatedReportHistory.Resolution; updated = true; }
  85:              if (this.Report != updatedReportHistory.Report) { this.Report = updatedReportHistory.Report; updated = true; }
  86:   
  87:              if (this.UserId != updatedReportHistory.UserId) { this.UserId = updatedReportHistory.UserId; updated = true; }
  88:   
  89:              // below: this is an update of migrated data
  90:              if (this.Created != updatedReportHistory.Created) { this.Created = updatedReportHistory.Created; updated = true; }
  91:              if (this.Updated != updatedReportHistory.Updated) { this.Updated = updatedReportHistory.Updated; updated = true; }
  92:   
  93:              //if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  94:   
  95:              return updated;
  96:          }
  97:   
  98:          ////////////////////////////////////////////////////////////////////////////
  99:          ////////////////////////////////////////////////////////////////////////////
 100:      }
 101:  }