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