Professional Applications Programmers/Consultants برمجة واستشارات تطبيقات الإنترنت
Skip Navigation LinksHome » Code Library » Onu

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

Huawei's ONU 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.Web.Security;
   6:  using System.ComponentModel.DataAnnotations;
   7:  using System.ComponentModel.DataAnnotations.Schema;
   8:  using System.Text.RegularExpressions;
   9:  using System.Data.Entity;
  10:   
  11:  namespace Ia.Ngn.Cl.Model.Huawei
  12:  {
  13:      ////////////////////////////////////////////////////////////////////////////
  14:   
  15:      /// <summary publish="true">
  16:      /// Huawei's ONU Entity Framework class for Next Generation Network (NGN) entity model.
  17:      /// </summary>
  18:      /// 
  19:      /// <remarks> 
  20:      /// Copyright © 2016-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  21:      ///
  22:      /// 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
  23:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  24:      ///
  25:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  26:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  27:      /// 
  28:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  29:      /// 
  30:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  31:      /// </remarks> 
  32:      public partial class Onu
  33:      {
  34:          /// <summary/>
  35:          public Onu() { }
  36:   
  37:          /// <summary/>
  38:          [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
  39:          public string Id { get; set; }
  40:          /// <summary/>
  41:          //public int StateId { get; set; }
  42:          /// <summary/>
  43:          public int FamilyTypeId { get; set; }
  44:          /// <summary/>
  45:          public string Serial { get; set; }
  46:          /// <summary/>
  47:          //public string EquipmentId { get; set; }
  48:          /// <summary/>
  49:          public int VendorId { get; set; }
  50:          /// <summary/>
  51:          //public string ActiveSoftware { get; set; }
  52:          /// <summary/>
  53:          //public string PassiveSoftware { get; set; }
  54:          /// <summary/>
  55:          //public string PlannedSoftware { get; set; }
  56:          /// <summary/>
  57:          //public bool BatteryBackupAvailable { get; set; }
  58:          /// <summary/>
  59:          //public string Description1 { get; set; }
  60:          /// <summary/>
  61:          //public string Description2 { get; set; }
  62:          /// <summary/>
  63:          public DateTime Created { get; set; }
  64:          /// <summary/>
  65:          public DateTime Updated { get; set; }
  66:          /// <summary/>
  67:          public System.Guid UserId { get; set; }
  68:   
  69:          /// <summary/>
  70:          public virtual Access Access { get; set; }
  71:          /// <summary/>
  72:          //public virtual ICollection<OntServiceHsi> OntServiceHsis { get; set; }
  73:          /// <summary/>
  74:          //public virtual ICollection<OntServiceVoip> OntServiceVoips { get; set; }
  75:          /// <summary/>
  76:          //public virtual ICollection<OntOntPots> OntOntPotses { get; set; }
  77:   
  78:          ////////////////////////////////////////////////////////////////////////////
  79:   
  80:          /// <summary>
  81:          ///
  82:          /// </summary>
  83:          public bool Equal(Ia.Ngn.Cl.Model.Huawei.Onu b)
  84:          {
  85:              // below: this will not check the Id, Created, or Updated fields
  86:              bool areEqual;
  87:   
  88:              /*if (this.BatteryBackupAvailable != b.BatteryBackupAvailable) areEqual = false;
  89:              else*/ areEqual = true;
  90:   
  91:              return areEqual;
  92:          }
  93:   
  94:          ////////////////////////////////////////////////////////////////////////////
  95:   
  96:          /// <summary>
  97:          ///
  98:          /// </summary>
  99:          public bool Update(Ia.Ngn.Cl.Model.Huawei.Onu updatedOnu)
 100:          {
 101:              // below: this will not update Id, Created
 102:              bool updated;
 103:   
 104:              updated = false;
 105:   
 106:              //if (this.StateId != updatedOnu.StateId) { this.StateId = updatedOnu.StateId; updated = true; }
 107:              if (this.FamilyTypeId != updatedOnu.FamilyTypeId) { this.FamilyTypeId = updatedOnu.FamilyTypeId; updated = true; }
 108:              if (this.Serial != updatedOnu.Serial) { this.Serial = updatedOnu.Serial; updated = true; }
 109:              //if (this.EquipmentId != updatedOnu.EquipmentId) { this.EquipmentId = updatedOnu.EquipmentId; updated = true; }
 110:              if (this.VendorId != updatedOnu.VendorId) { this.VendorId = updatedOnu.VendorId; updated = true; }
 111:              //if (this.ActiveSoftware != updatedOnu.ActiveSoftware) { this.ActiveSoftware = updatedOnu.ActiveSoftware; updated = true; }
 112:              //if (this.PassiveSoftware != updatedOnu.PassiveSoftware) { this.PassiveSoftware = updatedOnu.PassiveSoftware; updated = true; }
 113:   
 114:              //if (this.PlannedSoftware != updatedOnu.PlannedSoftware) { this.PlannedSoftware = updatedOnu.PlannedSoftware; updated = true; }
 115:              //if (this.BatteryBackupAvailable != updatedOnu.BatteryBackupAvailable) { this.BatteryBackupAvailable = updatedOnu.BatteryBackupAvailable; updated = true; }
 116:              //if (this.Description1 != updatedOnu.Description1) { this.Description1 = updatedOnu.Description1; updated = true; }
 117:              //if (this.Description2 != updatedOnu.Description2) { this.Description2 = updatedOnu.Description2; updated = true; }
 118:              if (this.UserId != updatedOnu.UserId) { this.UserId = updatedOnu.UserId; updated = true; }
 119:              if (this.Access != updatedOnu.Access) { this.Access = updatedOnu.Access; updated = true; }
 120:   
 121:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
 122:   
 123:              return updated;
 124:          }
 125:   
 126:          ////////////////////////////////////////////////////////////////////////////
 127:          ////////////////////////////////////////////////////////////////////////////
 128:      }
 129:   
 130:      ////////////////////////////////////////////////////////////////////////////
 131:      ////////////////////////////////////////////////////////////////////////////
 132:  }