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 Next Generation Network (NGN) 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 partial 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 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.OntServiceVoip ontServiceVoip)
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: " + ontServiceVoip.State);
84: //sb.AppendLine("Svlan: " + ontServiceVoip.Svlan);
85: sb.AppendLine("Ip: " + ontServiceVoip.Ip);
86: //sb.AppendLine("FtpIp: " + ontServiceVoip.FtpIp);
87: //sb.AppendLine("ConfiguratinFile: " + ontServiceVoip.ConfiguratinFile);
88: sb.AppendLine("Customer: " + ontServiceVoip.Customer);
89: sb.AppendLine("Label: " + ontServiceVoip.Label);
90:
91: return sb.ToString();
92: }
93:
94: ////////////////////////////////////////////////////////////////////////////
95: ////////////////////////////////////////////////////////////////////////////
96: }
97:
98: ////////////////////////////////////////////////////////////////////////////
99: ////////////////////////////////////////////////////////////////////////////
100: }