1:
2: using System.Collections.Generic;
3:
4: namespace Ia.Ngn.Cl.Model.Business.Ericsson
5: {
6: ////////////////////////////////////////////////////////////////////////////
7:
8: /// <summary publish="true">
9: /// AXE Subscriber support class for Optical Fiber Network (OFN) business model.
10: /// </summary>
11: ///
12: /// <remarks>
13: /// Copyright © 2018-2022 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
14: ///
15: /// 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
16: /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
17: ///
18: /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
19: /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20: ///
21: /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
22: ///
23: /// Copyright notice: This notice may not be removed or altered from any source distribution.
24: /// </remarks>
25: public class Subscriber
26: {
27: ////////////////////////////////////////////////////////////////////////////
28:
29: /// <summary>
30: ///
31: /// </summary>
32: public Subscriber() { }
33:
34: ////////////////////////////////////////////////////////////////////////////
35:
36: /// <summary>
37: ///
38: /// </summary>
39: public static string SubscriberId(int snb)
40: {
41: int serviceType;
42: string serviceId;
43:
44: serviceType = Ia.Ngn.Cl.Model.Business.Service.ServiceType.PstnService;
45:
46: serviceId = Ia.Ngn.Cl.Model.Business.Service.ServiceToServiceId(snb.ToString(), serviceType);
47:
48: return serviceId;
49: }
50:
51: ////////////////////////////////////////////////////////////////////////////
52:
53: /// <summary>
54: ///
55: /// </summary>
56: public static Ia.Ngn.Cl.Model.Business.Default.SwitchRoute IcsxRouteToSwitchRoute(int icsxRoute)
57: {
58: Ia.Ngn.Cl.Model.Business.Default.SwitchRoute switchRoute;
59:
60: switch (icsxRoute)
61: {
62: // sync with below
63: case 0: switchRoute = Ia.Ngn.Cl.Model.Business.Default.SwitchRoute.EricssonAxeCopper; break;
64: case 1: switchRoute = Ia.Ngn.Cl.Model.Business.Default.SwitchRoute.EricssonAxeCopper; break;
65: case 2: switchRoute = Ia.Ngn.Cl.Model.Business.Default.SwitchRoute.EricssonAxeCopper; break;
66: case 3: switchRoute = Ia.Ngn.Cl.Model.Business.Default.SwitchRoute.NokiaIms; break;
67: case 4: switchRoute = Ia.Ngn.Cl.Model.Business.Default.SwitchRoute.HuaweiIms; break;
68: default: switchRoute = Ia.Ngn.Cl.Model.Business.Default.SwitchRoute.Unknown; break;
69: }
70:
71: return switchRoute;
72: }
73:
74: ////////////////////////////////////////////////////////////////////////////
75:
76: /// <summary>
77: ///
78: /// </summary>
79: public static int SwitchRouteToIcsxRoute(Ia.Ngn.Cl.Model.Business.Default.SwitchRoute switchRoute)
80: {
81: int icsxRoute;
82:
83: switch (switchRoute)
84: {
85: // sync with above and below
86: case Ia.Ngn.Cl.Model.Business.Default.SwitchRoute.EricssonAxeCopper: icsxRoute = 0; break;
87: case Ia.Ngn.Cl.Model.Business.Default.SwitchRoute.NokiaIms: icsxRoute = 3; break;
88: case Ia.Ngn.Cl.Model.Business.Default.SwitchRoute.HuaweiIms: icsxRoute = 4; break;
89: default: icsxRoute = -1; break;
90: }
91:
92: return icsxRoute;
93: }
94:
95: ////////////////////////////////////////////////////////////////////////////
96:
97: /// <summary>
98: ///
99: /// </summary>
100: public static int IcsRouteFromSubscriberScl(string subscriberScl)
101: {
102: int icsRoute;
103:
104: // sync with above and below
105: if (subscriberScl.Contains("ICS-0")) icsRoute = 0;
106: else if (subscriberScl.Contains("ICS-1")) icsRoute = 1;
107: else if (subscriberScl.Contains("ICS-2")) icsRoute = 2;
108: else if (subscriberScl.Contains("ICS-3")) icsRoute = 3;
109: else if (subscriberScl.Contains("ICS-4")) icsRoute = 4;
110: else icsRoute = 0;
111:
112: return icsRoute;
113: }
114:
115: ////////////////////////////////////////////////////////////////////////////
116:
117: /// <summary>
118: ///
119: /// </summary>
120: public static string RouteName(string subscriberScl)
121: {
122: string routeName;
123:
124: // sync with above
125: if (subscriberScl.Contains("ICS-3")) routeName = "Nokia IMS";
126: else if (subscriberScl.Contains("ICS-4")) routeName = "Huawei IMS";
127: else routeName = "Ericsson AXE Copper";
128:
129: return routeName;
130: }
131:
132: ////////////////////////////////////////////////////////////////////////////
133:
134: /// <summary>
135: ///
136: /// </summary>
137: public static bool SetSclToEmptyToInvokeDeleteForAxeSubscribersThatAreRoutedToNokiaImsButAreStillInServiceInAxeSwitch()
138: {
139: return Ia.Ngn.Cl.Model.Data.Ericsson.Subscriber.UpdateSnbSetSclToEmptyWhereSclHasIcs3AndSutNotNc();
140: }
141:
142: ////////////////////////////////////////////////////////////////////////////
143: ////////////////////////////////////////////////////////////////////////////
144: }
145:
146: ////////////////////////////////////////////////////////////////////////////
147: ////////////////////////////////////////////////////////////////////////////
148: }