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

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

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

   1:  using System;
   2:  using System.Collections;
   3:  using System.Collections.Generic;
   4:  using System.Linq;
   5:  using System.Web;
   6:  using System.ComponentModel.DataAnnotations;
   7:  using System.ComponentModel.DataAnnotations.Schema;
   8:  using System.Data;
   9:   
  10:  namespace Ia.Ngn.Cl.Model.Huawei
  11:  {
  12:      ////////////////////////////////////////////////////////////////////////////
  13:   
  14:      /// <summary publish="true">
  15:      /// Huawei's Owsbr Entity Framework class for Next Generation Network (NGN) entity model.
  16:      /// </summary>
  17:      /// 
  18:      /// <remarks> 
  19:      /// Copyright © 2014-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  20:      ///
  21:      /// 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
  22:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  23:      ///
  24:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  25:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  26:      /// 
  27:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  28:      /// 
  29:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  30:      /// </remarks> 
  31:      public partial class Owsbr
  32:      {
  33:          /// <summary/>
  34:          public enum ServiceTypeList { IMPU = 1, US }
  35:   
  36:          /// <summary/>
  37:          public Owsbr() { }
  38:   
  39:          /// <summary/>
  40:          public long Id { get; set; }
  41:   
  42:          /// <summary>
  43:          /// It specifies the IMPU of a specific subscriber. It can be a TEL URI or a SIP URI. The rules for setting the parameter are as follows:
  44:          /// To configure an IMPU in SIP URI format, type a string such as sip:userinfo@huawei.com or userinfo@huawei.com.
  45:          /// To configure an IMPU in TEL URI format, type a string such as tel:+867557780000 or +867557780000.
  46:          ///. Value: a string of a maximum of 128 characters. Default value: none. This parameter is mandatory.
  47:          /// </summary>
  48:          [Key]
  49:          public string IMPU { get; set; }
  50:   
  51:          /// <summary>
  52:          /// Options:
  53:          /// 0: NORMAL (NORMAL): The subscriber can originate and answer calls normally.
  54:          /// 1: OUTOWN (OUTOWN): The subscriber can answer calls but is forbidden to originate any call except for owing override calls.
  55:          /// 2: INOWN(INOWN): The subscriber is forbidden to answer calls but can originate calls.
  56:          /// 3: BOTHOWN (BOTHOWN): The subscriber is forbidden to answer and originate any calls.
  57:          /// </summary>
  58:          public int US { get; set; }
  59:   
  60:          /// <summary/>
  61:          public DateTime Created { get; set; }
  62:   
  63:          /// <summary/>
  64:          public DateTime Updated { get; set; }
  65:   
  66:          ////////////////////////////////////////////////////////////////////////////
  67:   
  68:          /// <summary>
  69:          ///
  70:          /// </summary>
  71:          public bool Equal(Owsbr owsbr)
  72:          {
  73:              // below: this will not check the Id, Created, Updated, or Viewed fields
  74:              bool areEqual;
  75:   
  76:              if (this.IMPU != owsbr.IMPU) areEqual = false;
  77:              else if (this.US != owsbr.US) { areEqual = false; }
  78:              else areEqual = true;
  79:   
  80:              return areEqual;
  81:          }
  82:   
  83:          ////////////////////////////////////////////////////////////////////////////
  84:   
  85:          /// <summary>
  86:          ///
  87:          /// </summary>
  88:          public bool Update(Owsbr owsbr)
  89:          {
  90:              // below: this will not update Id, IMPU, Created
  91:              bool updated;
  92:   
  93:              updated = false;
  94:   
  95:              if (this.US != owsbr.US) { this.US = owsbr.US; updated = true; }
  96:   
  97:              if (updated) this.Updated = DateTime.UtcNow.AddHours(3);
  98:   
  99:              return updated;
 100:          }
 101:   
 102:          ////////////////////////////////////////////////////////////////////////////
 103:          ////////////////////////////////////////////////////////////////////////////
 104:   
 105:          /// <summary>
 106:          ///
 107:          /// </summary>
 108:          public string ToSimpleTextString()
 109:          {
 110:              return Ia.Ngn.Cl.Model.Data.Huawei.Owsbr.ToSimpleTextString(this);
 111:          }
 112:   
 113:          ////////////////////////////////////////////////////////////////////////////
 114:          ////////////////////////////////////////////////////////////////////////////
 115:      }
 116:   
 117:      ////////////////////////////////////////////////////////////////////////////
 118:      ////////////////////////////////////////////////////////////////////////////
 119:  }