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

Integrated Applications Programming Company

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 Optical Fiber Network (OFN) 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-SERVICEVOIP support class for Optical Fiber Network (OFN) Nokia data model.
  11:      /// </summary>
  12:      /// 
  13:      /// <remarks> 
  14:      /// Copyright © 2006-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated 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 class OntServiceVoip
  27:      {
  28:          /// <summary/>
  29:          public OntServiceVoip() { }
  30:   
  31:          /*
  32:          ////////////////////////////////////////////////////////////////////////////
  33:  
  34:          /// <summary>
  35:          ///
  36:          /// </summary>
  37:          public static List<Ia.Ngn.Cl.Model.OntServiceVoip> ReadListBySerial(string serial)
  38:          {
  39:              List<Ia.Ngn.Cl.Model.OntServiceVoip> 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.OntServiceVoips 
  64:                                    select new { s.Id, OntId = s.Ont.Id }).ToDictionary(u => u.Id, u => u.OntId);
  65:                  }
  66:   
  67:                  return dictionary.ToDictionary(u => u.Key, u => u.Value);
  68:              }
  69:          }
  70:   
  71:          ////////////////////////////////////////////////////////////////////////////
  72:          ////////////////////////////////////////////////////////////////////////////
  73:   
  74:          /// <summary>
  75:          ///
  76:          /// </summary>
  77:          public static string ToSimpleTextString(Ia.Ngn.Cl.Model.OntServiceVoip ontServiceVoip)
  78:          {
  79:              StringBuilder sb;
  80:   
  81:              sb = new StringBuilder();
  82:   
  83:              //sb.AppendLine("Vendor: " + Ia.Ngn.Cl.Model.Business.NetworkDesignDocument.Vendor.Nokia.Name);
  84:              sb.AppendLine("State: " + ontServiceVoip.State);
  85:              //sb.AppendLine("Svlan: " + ontServiceVoip.Svlan);
  86:              sb.AppendLine("Ip: " + ontServiceVoip.Ip);
  87:              //sb.AppendLine("FtpIp: " + ontServiceVoip.FtpIp);
  88:              //sb.AppendLine("ConfiguratinFile: " + ontServiceVoip.ConfiguratinFile);
  89:              sb.AppendLine("Customer: " + ontServiceVoip.Customer);
  90:              sb.AppendLine("Label: " + ontServiceVoip.Label);
  91:   
  92:              return sb.ToString();
  93:          }
  94:   
  95:          ////////////////////////////////////////////////////////////////////////////
  96:          ////////////////////////////////////////////////////////////////////////////
  97:      }
  98:   
  99:      ////////////////////////////////////////////////////////////////////////////
 100:      ////////////////////////////////////////////////////////////////////////////
 101:  }