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

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

ONT-SERVICEHSI support class of Next Generation Network'a (NGN's) Nokia business 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:  using System.Data.Entity;
   9:   
  10:  namespace Ia.Ngn.Cl.Model.Business.Nokia
  11:  {
  12:      ////////////////////////////////////////////////////////////////////////////
  13:   
  14:      /// <summary publish="true">
  15:      /// ONT-SERVICEHSI support class of Next Generation Network'a (NGN's) Nokia business model.
  16:      /// </summary>
  17:      /// 
  18:      /// <remarks> 
  19:      /// Copyright © 2006-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 OntServiceHsi
  32:      {
  33:          /// <summary/>
  34:          public OntServiceHsi() { }
  35:   
  36:          ////////////////////////////////////////////////////////////////////////////
  37:   
  38:          /// <summary>
  39:          ///
  40:          /// </summary>
  41:          public static string OntServiceHsiId(string ontId, int card, int port, int service)
  42:          {
  43:              string id;
  44:   
  45:              id = ontId.ToString() + card.ToString().PadLeft(2, '0') + port.ToString().PadLeft(2, '0') + service.ToString().PadLeft(2, '0');
  46:   
  47:              return id;
  48:          }
  49:   
  50:          ////////////////////////////////////////////////////////////////////////////
  51:   
  52:          /// <summary>
  53:          ///
  54:          /// </summary>
  55:          public static List<Ia.Ngn.Cl.Model.OntServiceHsi> ReturnOntServiceHsiAndOntAndAccessListForIspAndBandwidth(Ia.Ngn.Cl.Model.Data.Hsi.Isp isp, Ia.Ngn.Cl.Model.Data.Hsi.Profile profile)
  56:          {
  57:              return ReturnOntServiceHsiAndOntAndAccessListForIspAndBandwidthAndTakeN(isp.Id, profile.Id, 10000000);
  58:          }
  59:   
  60:          ////////////////////////////////////////////////////////////////////////////
  61:   
  62:          /// <summary>
  63:          ///
  64:          /// </summary>
  65:          public static List<Ia.Ngn.Cl.Model.OntServiceHsi> ReturnOntServiceHsiAndOntAndAccessListForIspAndBandwidthAndTakeN(int ispNameId, int profileNameId, int take)
  66:          {
  67:              Ia.Ngn.Cl.Model.Data.Hsi.Isp isp;
  68:              Ia.Ngn.Cl.Model.Data.Hsi.Profile profile;
  69:              List<Ia.Ngn.Cl.Model.OntServiceHsi> ontServiceHsiList;
  70:   
  71:              isp = Ia.Ngn.Cl.Model.Data.Hsi.IspFromIspId(ispNameId);
  72:              profile = Ia.Ngn.Cl.Model.Data.Hsi.ProfileFromProfileId(profileNameId);
  73:   
  74:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
  75:              {
  76:                  if (ispNameId != 0 && profileNameId != 0)
  77:                  {
  78:                      ontServiceHsiList = (from osh in db.OntServiceHsis where osh.Ont.Access != null && osh.Svlan == isp.Lan && (osh.DownstreamBandwidthProfileId == profile.Id || osh.UpstreamBandwidthProfileId == profile.Id) select osh).Include(x => x.Ont.Access).Take(take).ToList();
  79:                  }
  80:                  else if (ispNameId != 0)
  81:                  {
  82:                      ontServiceHsiList = (from osh in db.OntServiceHsis where osh.Ont.Access != null && osh.Svlan == isp.Lan select osh).Include(x => x.Ont.Access).Take(take).ToList();
  83:                  }
  84:                  else if (profileNameId != 0)
  85:                  {
  86:                      ontServiceHsiList = (from osh in db.OntServiceHsis where osh.Ont.Access != null && (osh.DownstreamBandwidthProfileId == profile.Id || osh.UpstreamBandwidthProfileId == profile.Id) select osh).Include(x => x.Ont.Access).Take(take).ToList();
  87:                  }
  88:                  else
  89:                  {
  90:                      ontServiceHsiList = (from osh in db.OntServiceHsis where osh.Ont.Access != null select osh).Include(x => x.Ont.Access).Take(take).ToList();
  91:                  }
  92:              }
  93:   
  94:              return ontServiceHsiList;
  95:          }
  96:          
  97:          ////////////////////////////////////////////////////////////////////////////
  98:          ////////////////////////////////////////////////////////////////////////////
  99:      }
 100:   
 101:      ////////////////////////////////////////////////////////////////////////////
 102:      ////////////////////////////////////////////////////////////////////////////
 103:  }