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

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

Huawei's EMS Board Entity Framework class for Next Generation Network (NGN) entity model.

   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.ComponentModel.DataAnnotations;
   4:  using System.ComponentModel.DataAnnotations.Schema;
   5:   
   6:  namespace Ia.Ngn.Cl.Model.Huawei
   7:  {
   8:      ////////////////////////////////////////////////////////////////////////////
   9:   
  10:      /// <summary publish="true">
  11:      /// Huawei's EMS Board Entity Framework class for Next Generation Network (NGN) entity model.
  12:      /// </summary>
  13:      /// 
  14:      /// <remarks> 
  15:      /// Copyright © 2017-2018 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  16:      ///
  17:      /// 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
  18:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  19:      ///
  20:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  21:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  22:      /// 
  23:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  24:      /// 
  25:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  26:      /// </remarks> 
  27:      public partial class EmsBoard
  28:      {
  29:          /*
  30:           * iManager_U2000_V200R014C60_TL1_NBI_User_Guide_13.pdf
  31:           * 14.1.7 Querying the Information About a Board (LST-BOARD)
  32:           * 
  33:           * Usage Note
  34:           * 
  35:           * The DEV (IP address of an OLT) and ONULOCATEINFO parameters can be used as the location information. Before using these two parameters as the location information, make sure that the DEV parameter indicates the IP address of the device. For details, see C.7 How to Locate a Device According to the IP Address.
  36:           * 
  37:           * Command Format LST-BOARD::(DID=Device-ID|DEV=Device-name|(DEV=device-oltipaddress,ONULOCATEINFO=onu-locate-infomation))[,FN=Frame-num[,SN=Slot-num]] [,BT=board-type]:CTAG::[SHOWOPTION=optionof result's attributes];
  38:           * 
  39:           */
  40:   
  41:          /// <summary/>
  42:          //public enum ServiceTypeList { IMPU = 1, TEMPLATEIDX, DSPIDX, LP, CSC, UNAME, VCCFLAG, VTFLAG, NSCFU, NSCFUVM, NSCFB, NSCFBVM, NSCFNR, NSCFNRVM, NSCFNL, NSCFNLVM, NSCD, NSCDVM, NSCFNRC, NSCFNRCVM, NSCLIP, NSCIDCW, NSRIO, NSCNIP, NSCLIR, NSRIP, NSCNIR, NSRID, NSNRID, NSRND, NSNRND, NSCW, NSCCW, NSOIP, NSACRM, NSGOIR, NSMOIR, NSTIP, NSTIR, NSOTIR, NSCLIPNOSCREENING, NSCR, NSWAKE_UP, NSAOC_D, NSAOC_E, NSXEXH, NSXEGJ, NSCWCFNR, NSIIFC, NSDN_CALL_OUT_BAR, NSCCBS, NSCCNR, NSCCBSR, NSCCNRR, NS3PTY, NSNPTY, NSDND, NSMCR, NSCBA, NSTMP_LIN, NSCODEC_CNTRL, NSMWI, NSDC, NSHOLD, NSECT, NSCFTB, NSDAN, NSSTOP_SECRET, NSMCID, NSEBO, NSICO, NSOUTG, NSINQYH, NSUINFO, NSDN_CALL_OUT_ALLOW, NSSIC, NSSOC, NSSETCFNRTIME, NSCFS, NSCFSB, NSFAX, NSABRC, NSACRTOVM, NSPREPAID, NSCRBT, NSICB, NSMRINGING, NSCIS, NSCBEG, NSCOLP, NSCOLR, NSCOLPOVR, NSBAOC, NSBOIC, NSBOICEXHC, NSBAIC, NSBICROM, NSSPEED_DIAL, NSSD1D, NSSD2D, NSGRNCALL, NSCPARK, NSGAA, NSQSNS, NSMSN, NSHOTLINE, NSAOC_S, NSNIGHTSRV, NSBACKNUM, NSAUTOCON, NSCAMPON, NSCTD, NSCLICKHOLD, NSQUEUE, NSSANSWER, NSICENCF, NSCFGO, NSCECT, NSCTGO, NSCTIO, NSSETBUSY, NSOVERSTEP, NSABSENT, NSMONITOR, NSFMONITOR, NSDISCNT, NSFDISCNT, NSINSERT, NSFINSERT, NSASI, NSPWCB, NSRD, NSLCPS, NSNCPS, NSICPS, NSCBCLOCK, NSMINIBAR, NSMCN, NSDSTR, NSOPRREG, NSONEKEY, NSINBOUND, NSOUTBOUND, NSCALLERID, NSCUN, NSIPTVVC, NSNP, NSSEC, NSSECSTA, NSHRCN, NSSB, NSOCCR, LCO, LC, LCT, NTT, ITT, ICTX, OCTX, INTT, IITT, ICLT, ICDDD, ICIDD, IOLT, CTLCO, CTLCT, CTLD, CTINTNANP, CTINTWORLD, CTDA, CTOSM, CTOSP, CTOSP1, CCO1, CCO2, CCO3, CCO4, CCO5, CCO6, CCO7, CCO8, CCO9, CCO10, CCO11, CCO12, CCO13, CCO14, CCO15, CCO16, HIGHENTCO, OPERATOR, SUPYSRV, IDDCI, NTCI, LTCI, RSC, CIG, OUTRST, INRST, NOAT, RINGCOUNT, VMAIND, VDMAIND, TGRP, TIDHLD, TIDCW, SCF, LMTGRP, FLBGRP, SLBGRP, COP, G711_64K_A_LAW, G711_64K_U_LAW, G722, G723, G726, G728, G729, CODEC_MP4A, CODEC2833, CODEC2198, G726_40, G726_32, G726_24, G726_16, AMR, CLEARMODE, ILBC, SPEEX, G729EV, EVRC, EVRCB, H261, H263, CODEC_MP4V, H264, T38, T120, G711A_VBD, G711U_VBD, G726_VBD, G726_40_VBD, G726_32_VBD, G726_24_VBD, G726_16_VBD, WIND_BAND_AMR, GSM610, H263_2000, BROADVOICE_32, UNKNOWN_CODEC, ACODEC, VCODEC, POLIDX, NCPI, ICPI, EBOCL, EBOPL, EBOIT, RM, CPC, PCHG, TFPT, CHT, MCIDMODE, MCIDCMODE, MCIDAMODE, PREPAIDIDX, CRBTID, ODBBICTYPE, ODBBOCTYPE, ODBBARTYPE, ODBSS, ODBBRCFTYPE, PNOTI, MAXPARACALL, ATSDTMBUSY, CALLCOUNT, CDNOTICALLER, ISCHGFLAG, CHC, CUSER, CGRP, CUSERGRP, STCF, CHARSC, REGUIDX, SOCBFUNC, SOCBPTONEIDX, ADMINCBA, ADCONTROL_DIVERSION, DPR, PRON, CPCRUS, CUSCAT, SPT100REL }
  43:   
  44:          /// <summary/>
  45:          public EmsBoard() { }
  46:   
  47:          /// <summary/>
  48:          [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
  49:          public string Id { get; set; }
  50:   
  51:          /// <summary>
  52:          /// DID INTEGER - Indicates the device ID. 
  53:          /// </summary>
  54:          public int DID { get; set; }
  55:   
  56:          /// <summary>
  57:          /// FN INTEGER 0-255 Indicates the subrack ID.
  58:          /// </summary>
  59:          public int FN { get; set; }
  60:   
  61:          /// <summary>
  62:          /// SN INTEGER 0-35 Indicates the slot ID. 
  63:          /// </summary>
  64:          public int SN { get; set; }
  65:   
  66:          /// <summary>
  67:          /// BT OCTET STRING See D.2 Parameters Related To the Board Type. Indicates the type of the board. 
  68:          /// </summary>
  69:          public string BT { get; set; }
  70:   
  71:          /// <summary>
  72:          /// BVER OCTET STRING SIZE (64) Indicates the version of the board. 
  73:          /// </summary>
  74:          public string BVER { get; set; }
  75:   
  76:          /// <summary>
  77:          /// BSTAT OCTET STRING l Unknown l Uninstall l Normal l Fault l Forbidden l Discovery l Config l Offline l Abnormal Indicates the status of the board. 
  78:          /// </summary>
  79:          public string BSTAT { get; set; }
  80:   
  81:          /// <summary>
  82:          /// DEV OCTET STRING SIZE (192) Indicates the device name. By default, this parameter is not displayed. It is displayed only after you enter SHOWOPTION=DEV in the command. Indicates the device name by default. If the value of the configuration item DEVMEAN is 1, the DEV parameter indicates the IP address of the device. For details about how to modify configuration items, see C.7 How to Locate a Device According to the IP Address. 
  83:          /// </summary>
  84:          public string DEV { get; set; }
  85:   
  86:          /// <summary>
  87:          /// BNAME OCTET STRING SIZE (32) Indicates the subtype of the board. 
  88:          /// </summary>
  89:          public string BNAME { get; set; }
  90:   
  91:          /// <summary>
  92:          /// NAME OCTET STRING SIZE (255) Indicates the board name. 
  93:          /// </summary>
  94:          public string NAME { get; set; }
  95:   
  96:          /// <summary>
  97:          /// ALIAS OCTET STRING SIZE (64) Indicates the alias for the board. 
  98:          /// </summary>
  99:          public string ALIAS { get; set; }
 100:   
 101:          /// <summary>
 102:          /// ELABEL OCTET STRING SIZE (255) Indicates the sequence number of the board. 
 103:          /// </summary>
 104:          public string ELABEL { get; set; }
 105:   
 106:          /// <summary>
 107:          /// PCBVER OCTET STRING SIZE (255) Indicates the hardware version of the board.
 108:          /// </summary>
 109:          public string PCBVER { get; set; }
 110:   
 111:          /// <summary>
 112:          /// SWVER OCTET STRING SIZE (255) Indicates the software version of the board. 
 113:          /// </summary>
 114:          public string SWVER { get; set; }
 115:   
 116:          /// <summary>
 117:          /// ROLE OCTET STRING SIZE (255) Indicates the role of the board. The options are as follows: l UP: Indicates upstream transmission. l CAS: Indicates subtend. 
 118:          /// </summary>
 119:          public string ROLE { get; set; }
 120:   
 121:          /// <summary>
 122:          /// ALARM OCTET STRING l CRITICAL l MAJOR l MINOR l WARNING Indicates the alarm status of a board. Options are as follows: l CRITICAL: critical alarms l MAJOR: major alarms l MINOR: minor alarms l WARNING: warnings 
 123:          /// </summary>
 124:          public string ALARM { get; set; }
 125:   
 126:          /// <summary>
 127:          /// ST OCTET STRING l VOIP l ALL Indicates the service types that are supported by a board. Options are as follows: l VOIP: A board that houses POTS ports. POTS ports are used to carry voice over IP (VOIP) services. l ALL: A Board that houses other ports. 
 128:          /// </summary>
 129:          public string ST { get; set; }
 130:   
 131:          /// <summary>
 132:          /// PROTECTMODE OCTET STRING NONE Indicates the protection mode of a board. 
 133:          /// </summary>
 134:          public string PROTECTMODE { get; set; }
 135:   
 136:          /// <summary>
 137:          /// PORTCOUNT OCTET STRING SIZE(32) Indicates the port quantity on a board. 
 138:          /// </summary>
 139:          public string PORTCOUNT { get; set; }
 140:   
 141:          /// <summary>
 142:          /// PORTTYPE OCTET STRING Table D-4 Indicates the port type on a board. 
 143:          /// </summary>
 144:          public string PORTTYPE { get; set; }
 145:   
 146:          /// <summary>
 147:          /// WORKMODE OCTET STRING l active l standby l — Indicates the working mode of a board. Options are as follows: l active: active control board l standby: standby control board l —: non-control board 
 148:          /// </summary>
 149:          public string WORKMODE { get; set; }
 150:   
 151:          /// <summary>
 152:          /// REPLACE OCTET STRING Yes Specifies whether a board is replaceable.
 153:          /// </summary>
 154:          public string REPLACE { get; set; }
 155:   
 156:          /// <summary/>
 157:          public DateTime Created { get; set; }
 158:   
 159:          /// <summary/>
 160:          public DateTime Updated { get; set; }
 161:   
 162:          /// <summary/>
 163:          public virtual Ia.Ngn.Cl.Model.Huawei.EmsDev EmsDev { get; set; }
 164:   
 165:          /// <summary/>
 166:          public virtual ICollection<Ia.Ngn.Cl.Model.Huawei.EmsPort> EmsPorts { get; set; }
 167:   
 168:          ////////////////////////////////////////////////////////////////////////////
 169:   
 170:          /// <summary>
 171:          ///
 172:          /// </summary>
 173:          public bool Equal(Ia.Ngn.Cl.Model.Huawei.EmsBoard b)
 174:          {
 175:              // below: this will not check the Id, Created, Updated fields
 176:              bool areEqual;
 177:   
 178:              if (this.DID != b.DID) areEqual = false;
 179:              else if (this.FN != b.FN) areEqual = false;
 180:              else if (this.SN != b.SN) areEqual = false;
 181:              else if (this.BT != b.BT) areEqual = false;
 182:              else if (this.BVER != b.BVER) areEqual = false;
 183:              else if (this.BSTAT != b.BSTAT) areEqual = false;
 184:              else if (this.DEV != b.DEV) areEqual = false;
 185:              else if (this.BNAME != b.BNAME) areEqual = false;
 186:              else if (this.NAME != b.NAME) areEqual = false;
 187:              else if (this.ALIAS != b.ALIAS) areEqual = false;
 188:              else if (this.ELABEL != b.ELABEL) areEqual = false;
 189:              else if (this.PCBVER != b.PCBVER) areEqual = false;
 190:              else if (this.SWVER != b.SWVER) areEqual = false;
 191:              else if (this.ROLE != b.ROLE) areEqual = false;
 192:              else if (this.ALARM != b.ALARM) areEqual = false;
 193:              else if (this.ST != b.ST) areEqual = false;
 194:              else if (this.PROTECTMODE != b.PROTECTMODE) areEqual = false;
 195:              else if (this.PORTCOUNT != b.PORTCOUNT) areEqual = false;
 196:              else if (this.PORTTYPE != b.PORTTYPE) areEqual = false;
 197:              else if (this.WORKMODE != b.WORKMODE) areEqual = false;
 198:              else if (this.REPLACE != b.REPLACE) areEqual = false;
 199:              else if (this.EmsDev.Id != b.EmsDev.Id) areEqual = false;
 200:              else areEqual = true;
 201:   
 202:              return areEqual;
 203:          }
 204:   
 205:          ////////////////////////////////////////////////////////////////////////////
 206:   
 207:          /// <summary>
 208:          ///
 209:          /// </summary>
 210:          public bool Update(Ia.Ngn.Cl.Model.Huawei.EmsBoard updatedItem)
 211:          {
 212:              // below: this will not update Id, Created
 213:              bool updated;
 214:   
 215:              updated = false;
 216:   
 217:              if (this.DID != updatedItem.DID) { this.DID = updatedItem.DID; updated = true; }
 218:              if (this.FN != updatedItem.FN) { this.FN = updatedItem.FN; updated = true; }
 219:              if (this.SN != updatedItem.SN) { this.SN = updatedItem.SN; updated = true; }
 220:              if (this.BT != updatedItem.BT) { this.BT = updatedItem.BT; updated = true; }
 221:              if (this.BVER != updatedItem.BVER) { this.BVER = updatedItem.BVER; updated = true; }
 222:              if (this.BSTAT != updatedItem.BSTAT) { this.BSTAT = updatedItem.BSTAT; updated = true; }
 223:              if (this.DEV != updatedItem.DEV) { this.DEV = updatedItem.DEV; updated = true; }
 224:              if (this.BNAME != updatedItem.BNAME) { this.BNAME = updatedItem.BNAME; updated = true; }
 225:              if (this.NAME != updatedItem.NAME) { this.NAME = updatedItem.NAME; updated = true; }
 226:              if (this.ALIAS != updatedItem.ALIAS) { this.ALIAS = updatedItem.ALIAS; updated = true; }
 227:              if (this.ELABEL != updatedItem.ELABEL) { this.ELABEL = updatedItem.ELABEL; updated = true; }
 228:              if (this.PCBVER != updatedItem.PCBVER) { this.PCBVER = updatedItem.PCBVER; updated = true; }
 229:              if (this.SWVER != updatedItem.SWVER) { this.SWVER = updatedItem.SWVER; updated = true; }
 230:              if (this.ROLE != updatedItem.ROLE) { this.ROLE = updatedItem.ROLE; updated = true; }
 231:              if (this.ALARM != updatedItem.ALARM) { this.ALARM = updatedItem.ALARM; updated = true; }
 232:              if (this.ST != updatedItem.ST) { this.ST = updatedItem.ST; updated = true; }
 233:              if (this.PROTECTMODE != updatedItem.PROTECTMODE) { this.PROTECTMODE = updatedItem.PROTECTMODE; updated = true; }
 234:              if (this.PORTCOUNT != updatedItem.PORTCOUNT) { this.PORTCOUNT = updatedItem.PORTCOUNT; updated = true; }
 235:              if (this.PORTTYPE != updatedItem.PORTTYPE) { this.PORTTYPE = updatedItem.PORTTYPE; updated = true; }
 236:              if (this.WORKMODE != updatedItem.WORKMODE) { this.WORKMODE = updatedItem.WORKMODE; updated = true; }
 237:              if (this.REPLACE != updatedItem.REPLACE) { this.REPLACE = updatedItem.REPLACE; updated = true; }
 238:              if (this.EmsDev.Id != updatedItem.EmsDev.Id) { this.EmsDev = updatedItem.EmsDev; updated = true; }
 239:   
 240:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
 241:   
 242:              return updated;
 243:          }
 244:   
 245:          ////////////////////////////////////////////////////////////////////////////
 246:          ////////////////////////////////////////////////////////////////////////////
 247:      }
 248:   
 249:      ////////////////////////////////////////////////////////////////////////////
 250:      ////////////////////////////////////////////////////////////////////////////
 251:  }