)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » Owsbr (Ia.Ftn.Cl.Models.Huawei)

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

Huawei's Owsbr Entity Framework class for Fixed Telecommunications Network (FTN) entity model.

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