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) data model.

   1:  using System.Collections;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:  using System.Data;
   5:  using System.Text;
   6:   
   7:  namespace Ia.Ngn.Cl.Model.Data.Huawei
   8:  {
   9:      ////////////////////////////////////////////////////////////////////////////
  10:   
  11:      /// <summary publish="true">
  12:      /// Huawei's Owsbr Entity Framework class for Next Generation Network (NGN) data model.
  13:      /// </summary>
  14:      /// 
  15:      /// <remarks> 
  16:      /// Copyright © 2014-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  17:      ///
  18:      /// 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
  19:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  20:      ///
  21:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  22:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  23:      /// 
  24:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  25:      /// 
  26:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  27:      /// </remarks> 
  28:      public partial class Owsbr
  29:      {
  30:          /// <summary/>
  31:          public Owsbr() { }
  32:   
  33:          ////////////////////////////////////////////////////////////////////////////
  34:   
  35:          /// <summary>
  36:          ///
  37:          /// </summary>
  38:          public static Ia.Ngn.Cl.Model.Huawei.Owsbr Read(string impu)
  39:          {
  40:              Ia.Ngn.Cl.Model.Huawei.Owsbr owsbr;
  41:   
  42:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
  43:              {
  44:                  owsbr = (from o in db.Owsbrs where o.IMPU == impu select o).SingleOrDefault();
  45:              }
  46:   
  47:              return owsbr;
  48:          }
  49:   
  50:          ////////////////////////////////////////////////////////////////////////////
  51:   
  52:          /// <summary>
  53:          ///
  54:          /// </summary>
  55:          public static List<Ia.Ngn.Cl.Model.Huawei.Owsbr> ReadList(ArrayList impuList)
  56:          {
  57:              long i;
  58:              long[] sp;
  59:              List<Ia.Ngn.Cl.Model.Huawei.Owsbr> owsbrList;
  60:   
  61:              i = 0;
  62:              sp = new long[impuList.Count];
  63:   
  64:              foreach (long l in impuList) sp[i++] = l;
  65:   
  66:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
  67:              {
  68:                  //serviceList = (from q in db.Services where dnList.Contains(q.DN) select q).ToList();
  69:   
  70:                  // var pages = context.Pages.Where(x => keys.Any(key => x.Title.Contains(key)));
  71:                  owsbrList = db.Owsbrs.Where(q => sp.Any(v => q.IMPU == v.ToString())).ToList();
  72:              }
  73:   
  74:              return owsbrList;
  75:          }
  76:   
  77:          ////////////////////////////////////////////////////////////////////////////
  78:          ////////////////////////////////////////////////////////////////////////////
  79:   
  80:          /// <summary>
  81:          ///
  82:          /// </summary>
  83:          public static string ToSimpleTextString(Ia.Ngn.Cl.Model.Huawei.Owsbr owsbr)
  84:          {
  85:              StringBuilder sb;
  86:   
  87:              sb = new StringBuilder();
  88:   
  89:              //sb.AppendLine("Vendor: " + Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Huawei.Name);
  90:              sb.AppendLine("IMPU: " + owsbr.IMPU);
  91:              sb.AppendLine("US: " + owsbr.US);
  92:   
  93:              return sb.ToString();
  94:          }
  95:   
  96:          ////////////////////////////////////////////////////////////////////////////
  97:          ////////////////////////////////////////////////////////////////////////////
  98:      }
  99:   
 100:      ////////////////////////////////////////////////////////////////////////////
 101:      ////////////////////////////////////////////////////////////////////////////
 102:  }