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

Integrated Applications Programming Company

Skip Navigation Links

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

ONT-SERVICEHSI 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:   
   9:  namespace Ia.Ngn.Cl.Model
  10:  {
  11:      ////////////////////////////////////////////////////////////////////////////
  12:   
  13:      /// <summary publish="true">
  14:      /// ONT-SERVICEHSI Entity Framework class for Next Generation Network (NGN) entity model.
  15:      /// </summary>
  16:      /// 
  17:      /// <remarks> 
  18:      /// Copyright © 2006-2018 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated 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 partial class OntServiceHsi
  31:      {
  32:          /// <summary/>
  33:          public OntServiceHsi() { }
  34:   
  35:          /// <summary/>
  36:          public enum PriorityQueueProfile { A = 1 };
  37:   
  38:          /// <summary/>
  39:          [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
  40:          public string Id { get; set; }
  41:          /// <summary/>
  42:          public int StateId { get; set; }
  43:          /// <summary/>
  44:          public int Card { get; set; }
  45:          /// <summary/>
  46:          public int Port { get; set; }
  47:          /// <summary/>
  48:          public int Service { get; set; }
  49:          /// <summary/>
  50:          public int UpstreamBandwidthProfileId { get; set; }
  51:          /// <summary/>
  52:          public int DownstreamBandwidthProfileId { get; set; }
  53:          /// <summary/>
  54:          public int PriorityQueueProfileId { get; set; }
  55:          /// <summary/>
  56:          public bool Aes { get; set; }
  57:          /// <summary/>
  58:          public int Svlan { get; set; }
  59:          /// <summary/>
  60:          public string Label { get; set; }
  61:          /// <summary/>
  62:          public string Customer { get; set; }
  63:          /// <summary/>
  64:          public DateTime Created { get; set; }
  65:          /// <summary/>
  66:          public DateTime Updated { get; set; }
  67:          /// <summary/>
  68:          public System.Guid UserId { get; set; }
  69:          /// <summary/>
  70:          public virtual Ont Ont { get; set; }
  71:   
  72:          ////////////////////////////////////////////////////////////////////////////
  73:   
  74:          /// <summary>
  75:          ///
  76:          /// </summary>
  77:          [NotMapped]
  78:          public string State
  79:          {
  80:              get
  81:              {
  82:                  return Ia.Ngn.Cl.Model.Data.Nokia.Ams.BellcoreStateFromId(this.StateId);
  83:              }
  84:          }
  85:   
  86:          ////////////////////////////////////////////////////////////////////////////
  87:   
  88:          /// <summary>
  89:          ///
  90:          /// </summary>
  91:          public bool Equal(OntServiceHsi b)
  92:          {
  93:              // below: this will not check the Id, Created, Updated fields
  94:              bool areEqual;
  95:   
  96:              /*if (this.BatteryBackupAvailable != b.BatteryBackupAvailable) areEqual = false;
  97:              else*/ areEqual = true;
  98:   
  99:              return areEqual;
 100:          }
 101:   
 102:          ////////////////////////////////////////////////////////////////////////////
 103:   
 104:          /// <summary>
 105:          ///
 106:          /// </summary>
 107:          public bool Update(OntServiceHsi b)
 108:          {
 109:              // below: this will not update Id, Created
 110:              bool updated;
 111:   
 112:              updated = false;
 113:   
 114:              if (this.Aes != b.Aes) { this.Aes = b.Aes; updated = true; }
 115:              if (this.Card != b.Card) { this.Card = b.Card; updated = true; }
 116:              if (this.Customer != b.Customer) { this.Customer = b.Customer; updated = true; }
 117:              if (this.DownstreamBandwidthProfileId != b.DownstreamBandwidthProfileId) { this.DownstreamBandwidthProfileId = b.DownstreamBandwidthProfileId; updated = true; }
 118:              if (this.Label != b.Label) { this.Label = b.Label; updated = true; }
 119:              if (this.Ont != b.Ont) { this.Ont = b.Ont; updated = true; }
 120:              if (this.Port != b.Port) { this.Port = b.Port; updated = true; }
 121:   
 122:              if (this.PriorityQueueProfileId != b.PriorityQueueProfileId) { this.PriorityQueueProfileId = b.PriorityQueueProfileId; updated = true; }
 123:              if (this.Service != b.Service) { this.Service = b.Service; updated = true; }
 124:              if (this.StateId != b.StateId) { this.StateId = b.StateId; updated = true; }
 125:              if (this.Svlan != b.Svlan) { this.Svlan = b.Svlan; updated = true; }
 126:              if (this.UpstreamBandwidthProfileId != b.UpstreamBandwidthProfileId) { this.UpstreamBandwidthProfileId = b.UpstreamBandwidthProfileId; updated = true; }
 127:              if (this.UserId != b.UserId) { this.UserId = b.UserId; updated = true; }
 128:   
 129:              if(updated) this.Updated = DateTime.UtcNow.AddHours(3);
 130:   
 131:              return updated;
 132:          }
 133:   
 134:          ////////////////////////////////////////////////////////////////////////////
 135:          ////////////////////////////////////////////////////////////////////////////
 136:   
 137:          /// <summary>
 138:          ///
 139:          /// </summary>
 140:          public string ToSimpleTextString()
 141:          {
 142:              return Ia.Ngn.Cl.Model.Data.Nokia.OntServiceHsi.ToSimpleTextString(this);
 143:          }
 144:   
 145:          ////////////////////////////////////////////////////////////////////////////
 146:          ////////////////////////////////////////////////////////////////////////////
 147:      }
 148:   
 149:      ////////////////////////////////////////////////////////////////////////////
 150:      ////////////////////////////////////////////////////////////////////////////
 151:  }