شركة التطبيقات المتكاملة لتصميم النظم البرمجية الخاصة

Integrated Applications Programming Company

Skip Navigation LinksHome » Code Library » OntOntPots

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

ONT-ONTPOTS support class for Next Generation Network (NGN) Nokia data model.

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