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

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

ONT-SERVICEVOIP support class for Next Generation Network (NGN) Nokia data 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.Text.RegularExpressions;
   7:  using System.Text;
   8:   
   9:  namespace Ia.Ngn.Cl.Model.Data.Nokia
  10:  {
  11:      ////////////////////////////////////////////////////////////////////////////
  12:   
  13:      /// <summary publish="true">
  14:      /// ONT-SERVICEVOIP support class for Next Generation Network (NGN) Nokia data model.
  15:      /// </summary>
  16:      /// 
  17:      /// <remarks> 
  18:      /// Copyright © 2006-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Internet Applications - Kuwait. All Rights Reserved.
  19:      ///
  20:      /// 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
  21:      /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  22:      ///
  23:      /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  24:      /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  25:      /// 
  26:      /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
  27:      /// 
  28:      /// Copyright notice: This notice may not be removed or altered from any source distribution.
  29:      /// </remarks> 
  30:      public partial class OntServiceVoip
  31:      {
  32:          /// <summary/>
  33:          public OntServiceVoip() { }
  34:   
  35:          /*
  36:          ////////////////////////////////////////////////////////////////////////////
  37:  
  38:          /// <summary>
  39:          ///
  40:          /// </summary>
  41:          public static List<Ia.Ngn.Cl.Model.OntServiceVoip> ReadListBySerial(string serial)
  42:          {
  43:              List<Ia.Ngn.Cl.Model.OntServiceVoip> list;
  44:  
  45:              using (var db = new Ia.Ngn.Cl.Model.Ngn())
  46:              {
  47:                  list = (from q in db.Onts where q.Serial == serial select q).ToList();
  48:              }
  49:  
  50:              return list;
  51:          }
  52:           */
  53:   
  54:          ////////////////////////////////////////////////////////////////////////////
  55:   
  56:          /// <summary>
  57:          ///
  58:          /// </summary>
  59:          public static Dictionary<string, string> IdToOntIdDictionary
  60:          {
  61:              get
  62:              {
  63:                  Dictionary<string, string> dictionary;
  64:   
  65:                  using (var db = new Ia.Ngn.Cl.Model.Ngn())
  66:                  {
  67:                      dictionary = (from s in db.OntServiceVoips select new { s.Id, OntId = s.Ont.Id }).ToDictionary(u => u.Id, u => u.OntId);
  68:                  }
  69:   
  70:                  return dictionary.ToDictionary(u => u.Key, u => u.Value);
  71:              }
  72:          }
  73:   
  74:          ////////////////////////////////////////////////////////////////////////////
  75:          ////////////////////////////////////////////////////////////////////////////
  76:   
  77:          /// <summary>
  78:          ///
  79:          /// </summary>
  80:          public static string ToSimpleTextString(Ia.Ngn.Cl.Model.OntServiceVoip ontServiceVoip)
  81:          {
  82:              StringBuilder sb;
  83:   
  84:              sb = new StringBuilder();
  85:   
  86:              //sb.AppendLine("Vendor: " + Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia.Name);
  87:              sb.AppendLine("State: " + ontServiceVoip.State);
  88:              //sb.AppendLine("Svlan: " + ontServiceVoip.Svlan);
  89:              sb.AppendLine("Ip: " + ontServiceVoip.Ip);
  90:              //sb.AppendLine("FtpIp: " + ontServiceVoip.FtpIp);
  91:              //sb.AppendLine("ConfiguratinFile: " + ontServiceVoip.ConfiguratinFile);
  92:              sb.AppendLine("Customer: " + ontServiceVoip.Customer);
  93:              sb.AppendLine("Label: " + ontServiceVoip.Label);
  94:   
  95:              return sb.ToString();
  96:          }
  97:   
  98:          ////////////////////////////////////////////////////////////////////////////
  99:          ////////////////////////////////////////////////////////////////////////////
 100:      }
 101:   
 102:      ////////////////////////////////////////////////////////////////////////////
 103:      ////////////////////////////////////////////////////////////////////////////
 104:  }