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

Integrated Applications Programming Company

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), Integrated 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:   
  41:          /// <summary/>
  42:          //public int StateId { get; set; }
  43:   
  44:          /// <summary/>
  45:          public int FamilyTypeId { get; set; }
  46:   
  47:          /// <summary/>
  48:          public string Serial { get; set; }
  49:   
  50:          /// <summary/>
  51:          //public string EquipmentId { get; set; }
  52:   
  53:          /// <summary/>
  54:          public int VendorId { get; set; }
  55:   
  56:          /// <summary/>
  57:          //public string ActiveSoftware { get; set; }
  58:   
  59:          /// <summary/>
  60:          //public string PassiveSoftware { get; set; }
  61:   
  62:          /// <summary/>
  63:          //public string PlannedSoftware { get; set; }
  64:   
  65:          /// <summary/>
  66:          //public bool BatteryBackupAvailable { get; set; }
  67:   
  68:          /// <summary/>
  69:          //public string Description1 { get; set; }
  70:   
  71:          /// <summary/>
  72:          //public string Description2 { get; set; }
  73:   
  74:          /// <summary/>
  75:          public DateTime Created { get; set; }
  76:   
  77:          /// <summary/>
  78:          public DateTime Updated { get; set; }
  79:   
  80:          /// <summary/>
  81:          public System.Guid UserId { get; set; }
  82:   
  83:          /// <summary/>
  84:          public virtual Access Access { get; set; }
  85:   
  86:          /// <summary/>
  87:          //public virtual ICollection<OntServiceHsi> OntServiceHsis { get; set; }
  88:   
  89:          /// <summary/>
  90:          //public virtual ICollection<OntServiceVoip> OntServiceVoips { get; set; }
  91:   
  92:          /// <summary/>
  93:          //public virtual ICollection<OntOntPots> OntOntPotses { get; set; }
  94:   
  95:          ////////////////////////////////////////////////////////////////////////////
  96:   
  97:          /// <summary>
  98:          ///
  99:          /// </summary>
 100:          public bool Equal(Ia.Ngn.Cl.Model.Huawei.Onu b)
 101:          {
 102:              // below: this will not check the Id, Created, or Updated fields
 103:              bool areEqual;
 104:   
 105:              /*if (this.BatteryBackupAvailable != b.BatteryBackupAvailable) areEqual = false;
 106:              else*/ areEqual = true;
 107:   
 108:              return areEqual;
 109:          }
 110:   
 111:          ////////////////////////////////////////////////////////////////////////////
 112:   
 113:          /// <summary>
 114:          ///
 115:          /// </summary>
 116:          public bool Update(Ia.Ngn.Cl.Model.Huawei.Onu updatedOnu)
 117:          {
 118:              // below: this will not update Id, Created
 119:              bool updated;
 120:   
 121:              updated = false;
 122:   
 123:              //if (this.StateId != updatedOnu.StateId) { this.StateId = updatedOnu.StateId; updated = true; }
 124:              if (this.FamilyTypeId != updatedOnu.FamilyTypeId) { this.FamilyTypeId = updatedOnu.FamilyTypeId; updated = true; }
 125:              if (this.Serial != updatedOnu.Serial) { this.Serial = updatedOnu.Serial; updated = true; }
 126:              //if (this.EquipmentId != updatedOnu.EquipmentId) { this.EquipmentId = updatedOnu.EquipmentId; updated = true; }
 127:              if (this.VendorId != updatedOnu.VendorId) { this.VendorId = updatedOnu.VendorId; updated = true; }
 128:              //if (this.ActiveSoftware != updatedOnu.ActiveSoftware) { this.ActiveSoftware = updatedOnu.ActiveSoftware; updated = true; }
 129:              //if (this.PassiveSoftware != updatedOnu.PassiveSoftware) { this.PassiveSoftware = updatedOnu.PassiveSoftware; updated = true; }
 130:   
 131:              //if (this.PlannedSoftware != updatedOnu.PlannedSoftware) { this.PlannedSoftware = updatedOnu.PlannedSoftware; updated = true; }
 132:              //if (this.BatteryBackupAvailable != updatedOnu.BatteryBackupAvailable) { this.BatteryBackupAvailable = updatedOnu.BatteryBackupAvailable; updated = true; }
 133:              //if (this.Description1 != updatedOnu.Description1) { this.Description1 = updatedOnu.Description1; updated = true; }
 134:              //if (this.Description2 != updatedOnu.Description2) { this.Description2 = updatedOnu.Description2; updated = true; }
 135:              if (this.UserId != updatedOnu.UserId) { this.UserId = updatedOnu.UserId; updated = true; }
 136:              if (this.Access != updatedOnu.Access) { this.Access = updatedOnu.Access; updated = true; }
 137:   
 138:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
 139:   
 140:              return updated;
 141:          }
 142:   
 143:          ////////////////////////////////////////////////////////////////////////////
 144:          ////////////////////////////////////////////////////////////////////////////
 145:      }
 146:   
 147:      ////////////////////////////////////////////////////////////////////////////
 148:      ////////////////////////////////////////////////////////////////////////////
 149:  }