)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Skip Navigation Links

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

Media Gateway (MGW) support class for Huawei's Optical Fiber Network (OFN) data model.

    1: using System;
    2: using System.Collections.Generic;
    3: using System.Data;
    4: using System.Linq;
    5: using System.Text;
    6:  
    7: namespace Ia.Ngn.Cl.Model.Data.Huawei
    8: {
    9:     ////////////////////////////////////////////////////////////////////////////
   10:  
   11:     /// <summary publish="true">
   12:     /// Media Gateway (MGW) support class for Huawei's Optical Fiber Network (OFN) data model.
   13:     /// </summary>
   14:     /// 
   15:     /// <remarks> 
   16:     /// Copyright © 2019-2020 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   17:     ///
   18:     /// 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
   19:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   20:     ///
   21:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   22:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   23:     /// 
   24:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   25:     /// 
   26:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   27:     /// </remarks> 
   28:     public class Mgw
   29:     {
   30:         /// <summary/>
   31:         public Mgw() { }
   32:  
   33:         ////////////////////////////////////////////////////////////////////////////
   34:  
   35:         /// <summary>
   36:         ///
   37:         /// </summary>
   38:         public static bool Update(Ia.Ngn.Cl.Model.Business.Huawei.SoftX.Response response, out Ia.Cl.Model.Result result)
   39:         {
   40:             bool isUpdated;
   41:             int readItemCount, existingItemCount, insertedItemCount, updatedItemCount, deletedItemCount;
   42:             string id, queryEid, queryCommand;
   43:             Ia.Ngn.Cl.Model.Huawei.Mgw mgw, newMgw;
   44:  
   45:             isUpdated = false;
   46:             readItemCount = existingItemCount = insertedItemCount = updatedItemCount = deletedItemCount = 0;
   47:             result = new Ia.Cl.Model.Result();
   48:  
   49:             queryCommand = response.CommandString;
   50:  
   51:             // LST MGW: EID="10.12.42.190:2944";
   52:             queryEid = Ia.Cl.Model.Default.Match(queryCommand, @"EID=""(.+?)""");
   53:  
   54:             readItemCount = response.Count;
   55:  
   56:             id = Ia.Ngn.Cl.Model.Business.Huawei.Mgw.MgwId(response.NetworkElement, queryEid);
   57:  
   58:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
   59:             {
   60:                 mgw = (from m in db.Mgws where m.Id == id select m).SingleOrDefault();
   61:  
   62:                 if (response.Count >= 1)
   63:                 {
   64:                     newMgw = new Ia.Ngn.Cl.Model.Huawei.Mgw()
   65:                     {
   66:                         Id = id,
   67:                         EID = queryEid,
   68:                         NetworkElement = response.NetworkElement,
   69:                         GWTP = response.QueryDictionary.ContainsKey("GWTP") ? response.QueryDictionary["GWTP"] : string.Empty,
   70:                         MGWDESC = response.QueryDictionary.ContainsKey("MGWDESC") ? response.QueryDictionary["MGWDESC"] : string.Empty,
   71:                         MGCMODULENO = response.QueryDictionary.ContainsKey("MGCMODULENO") ? int.Parse(response.QueryDictionary["MGCMODULENO"]) : 0,
   72:                         PTYPE = response.QueryDictionary.ContainsKey("PTYPE") ? response.QueryDictionary["PTYPE"] : string.Empty,
   73:                         LA = response.QueryDictionary.ContainsKey("LA") ? response.QueryDictionary["LA"] : string.Empty,
   74:                         DYNIP = response.QueryDictionary.ContainsKey("DYNIP") ? response.QueryDictionary["DYNIP"] : string.Empty,
   75:                         RA1 = response.QueryDictionary.ContainsKey("RA1") ? response.QueryDictionary["RA1"] : string.Empty,
   76:                         RA2 = response.QueryDictionary.ContainsKey("RA2") ? response.QueryDictionary["RA2"] : string.Empty,
   77:                         RA3 = response.QueryDictionary.ContainsKey("RA3") ? response.QueryDictionary["RA3"] : string.Empty,
   78:                         RA4 = response.QueryDictionary.ContainsKey("RA4") ? response.QueryDictionary["RA4"] : string.Empty,
   79:                         RA5 = response.QueryDictionary.ContainsKey("RA5") ? response.QueryDictionary["RA5"] : string.Empty,
   80:                         RP = response.QueryDictionary.ContainsKey("RP") ? int.Parse(response.QueryDictionary["RP"]) : 0,
   81:                         LISTOFCODEC = response.QueryDictionary.ContainsKey("LISTOFCODEC") ? response.QueryDictionary["LISTOFCODEC"] : string.Empty,
   82:                         MRSCAP = response.QueryDictionary.ContainsKey("MRSCAP") ? response.QueryDictionary["MRSCAP"] : string.Empty,
   83:                         HAIRPIN = response.QueryDictionary.ContainsKey("HAIRPIN") ? response.QueryDictionary["HAIRPIN"] : string.Empty,
   84:                         EC = response.QueryDictionary.ContainsKey("EC") ? response.QueryDictionary["EC"] : string.Empty,
   85:                         CODETYPE = response.QueryDictionary.ContainsKey("CODETYPE") ? response.QueryDictionary["CODETYPE"] : string.Empty,
   86:                         UCATT = response.QueryDictionary.ContainsKey("UCATT") ? response.QueryDictionary["UCATT"] : string.Empty,
   87:                         ET = response.QueryDictionary.ContainsKey("ET") ? response.QueryDictionary["ET"] : string.Empty,
   88:                         SPI = response.QueryDictionary.ContainsKey("SPI") ? int.Parse(response.QueryDictionary["SPI"]) : 0,
   89:                         KEY = response.QueryDictionary.ContainsKey("KEY") ? response.QueryDictionary["KEY"] : string.Empty,
   90:                         CAPABILITY = response.QueryDictionary.ContainsKey("CAPABILITY") ? response.QueryDictionary["CAPABILITY"] : string.Empty,
   91:                         RATEOFTONE = response.QueryDictionary.ContainsKey("RATEOFTONE") ? int.Parse(response.QueryDictionary["RATEOFTONE"]) : 0,
   92:                         RATEOFMPTY = response.QueryDictionary.ContainsKey("RATEOFMPTY") ? int.Parse(response.QueryDictionary["RATEOFMPTY"]) : 0,
   93:                         RATEOFDETECTDTMF = response.QueryDictionary.ContainsKey("RATEOFDETECTDTMF") ? int.Parse(response.QueryDictionary["RATEOFDETECTDTMF"]) : 0,
   94:                         RATEOFSENDDTMF = response.QueryDictionary.ContainsKey("RATEOFSENDDTMF") ? int.Parse(response.QueryDictionary["RATEOFSENDDTMF"]) : 0,
   95:                         MINTERMID = response.QueryDictionary.ContainsKey("MINTERMID") ? int.Parse(response.QueryDictionary["MINTERMID"]) : 0,
   96:                         MAXTERMID = response.QueryDictionary.ContainsKey("MAXTERMID") ? int.Parse(response.QueryDictionary["MAXTERMID"]) : 0,
   97:                         CHOICE = response.QueryDictionary.ContainsKey("CHOICE") ? response.QueryDictionary["CHOICE"] : string.Empty,
   98:                         TDMIFC1 = response.QueryDictionary.ContainsKey("TDMIFC1") ? response.QueryDictionary["TDMIFC1"] : string.Empty,
   99:                         TDMIFC2 = response.QueryDictionary.ContainsKey("TDMIFC2") ? response.QueryDictionary["TDMIFC2"] : string.Empty,
  100:                         TDMIFC3 = response.QueryDictionary.ContainsKey("TDMIFC3") ? response.QueryDictionary["TDMIFC3"] : string.Empty,
  101:                         TDMIFC4 = response.QueryDictionary.ContainsKey("TDMIFC4") ? response.QueryDictionary["TDMIFC4"] : string.Empty,
  102:                         TDMIFC5 = response.QueryDictionary.ContainsKey("TDMIFC5") ? response.QueryDictionary["TDMIFC5"] : string.Empty,
  103:                         TDMIFC6 = response.QueryDictionary.ContainsKey("TDMIFC6") ? response.QueryDictionary["TDMIFC6"] : string.Empty,
  104:                         TDMIFC7 = response.QueryDictionary.ContainsKey("TDMIFC7") ? response.QueryDictionary["TDMIFC7"] : string.Empty,
  105:                         TDMIFC8 = response.QueryDictionary.ContainsKey("TDMIFC8") ? response.QueryDictionary["TDMIFC8"] : string.Empty,
  106:                         TDMIFC9 = response.QueryDictionary.ContainsKey("TDMIFC9") ? response.QueryDictionary["TDMIFC9"] : string.Empty,
  107:                         TDMIFC10 = response.QueryDictionary.ContainsKey("TDMIFC10") ? response.QueryDictionary["TDMIFC10"] : string.Empty,
  108:                         TDMIFC11 = response.QueryDictionary.ContainsKey("TDMIFC11") ? response.QueryDictionary["TDMIFC11"] : string.Empty,
  109:                         TDMIFC12 = response.QueryDictionary.ContainsKey("TDMIFC12") ? response.QueryDictionary["TDMIFC12"] : string.Empty,
  110:                         TDMIFC13 = response.QueryDictionary.ContainsKey("TDMIFC13") ? response.QueryDictionary["TDMIFC13"] : string.Empty,
  111:                         TDMIFC14 = response.QueryDictionary.ContainsKey("TDMIFC14") ? response.QueryDictionary["TDMIFC14"] : string.Empty,
  112:                         TDMIFC15 = response.QueryDictionary.ContainsKey("TDMIFC15") ? response.QueryDictionary["TDMIFC15"] : string.Empty,
  113:                         TDMIFC16 = response.QueryDictionary.ContainsKey("TDMIFC16") ? response.QueryDictionary["TDMIFC16"] : string.Empty,
  114:                         RTPIFC = response.QueryDictionary.ContainsKey("RTPIFC") ? response.QueryDictionary["RTPIFC"] : string.Empty,
  115:                         MSTYPE = response.QueryDictionary.ContainsKey("MSTYPE") ? response.QueryDictionary["MSTYPE"] : string.Empty,
  116:                         USRRATE = response.QueryDictionary.ContainsKey("USRRATE") ? int.Parse(response.QueryDictionary["USRRATE"]) : 0,
  117:                         OIPDM = response.QueryDictionary.ContainsKey("OIPDM") ? int.Parse(response.QueryDictionary["OIPDM"]) : 0,
  118:                         ENVOICEATTR = response.QueryDictionary.ContainsKey("ENVOICEATTR") ? response.QueryDictionary["ENVOICEATTR"] : string.Empty,
  119:                         RATEOFRECORD = response.QueryDictionary.ContainsKey("RATEOFRECORD") ? response.QueryDictionary["RATEOFRECORD"] : string.Empty,
  120:                         OWDYNA = response.QueryDictionary.ContainsKey("OWDYNA") ? response.QueryDictionary["OWDYNA"] : string.Empty,
  121:                         TOS = response.QueryDictionary.ContainsKey("TOS") ? response.QueryDictionary["TOS"] : string.Empty,
  122:                         E2ET = response.QueryDictionary.ContainsKey("E2ET") ? response.QueryDictionary["E2ET"] : string.Empty,
  123:                         PREMRS1 = response.QueryDictionary.ContainsKey("PREMRS1") ? Ia.Ngn.Cl.Model.Business.Huawei.SoftX.SpecialIntegerParameterHandling("PREMRS1", response.QueryDictionary["PREMRS1"]) : 0,
  124:                         PREMRS2 = response.QueryDictionary.ContainsKey("PREMRS2") ? response.QueryDictionary["PREMRS2"] : string.Empty,
  125:                         PREMRS3 = response.QueryDictionary.ContainsKey("PREMRS3") ? response.QueryDictionary["PREMRS3"] : string.Empty,
  126:                         AGID = response.QueryDictionary.ContainsKey("AGID") ? response.QueryDictionary["AGID"] : string.Empty,
  127:                         IMSFLAG = response.QueryDictionary.ContainsKey("IMSFLAG") ? bool.Parse(response.QueryDictionary["IMSFLAG"]) : false,
  128:                         MMFLAG = response.QueryDictionary.ContainsKey("MMFLAG") ? response.QueryDictionary["MMFLAG"] : string.Empty,
  129:                         CMTSIDX = response.QueryDictionary.ContainsKey("CMTSIDX") ? int.Parse(response.QueryDictionary["CMTSIDX"]) : 0,
  130:                         RTPTYPE = response.QueryDictionary.ContainsKey("RTPTYPE") ? response.QueryDictionary["RTPTYPE"] : string.Empty,
  131:                         ACTGATENUM = response.QueryDictionary.ContainsKey("ACTGATENUM") ? int.Parse(response.QueryDictionary["ACTGATENUM"]) : 0,
  132:                         MEDSSEC = response.QueryDictionary.ContainsKey("MEDSSEC") ? response.QueryDictionary["MEDSSEC"] : string.Empty,
  133:                         RTPSECPARA1 = response.QueryDictionary.ContainsKey("RTPSECPARA1") ? response.QueryDictionary["RTPSECPARA1"] : string.Empty,
  134:                         RTPSECPARA2 = response.QueryDictionary.ContainsKey("RTPSECPARA2") ? response.QueryDictionary["RTPSECPARA2"] : string.Empty,
  135:                         RTPSECPARA3 = response.QueryDictionary.ContainsKey("RTPSECPARA3") ? response.QueryDictionary["RTPSECPARA3"] : string.Empty,
  136:                         RTPSECPARA4 = response.QueryDictionary.ContainsKey("RTPSECPARA4") ? response.QueryDictionary["RTPSECPARA4"] : string.Empty,
  137:                         RTPSECPARA5 = response.QueryDictionary.ContainsKey("RTPSECPARA5") ? response.QueryDictionary["RTPSECPARA5"] : string.Empty,
  138:                         RTPSECPARA6 = response.QueryDictionary.ContainsKey("RTPSECPARA6") ? response.QueryDictionary["RTPSECPARA6"] : string.Empty,
  139:                         RTPSECPARA7 = response.QueryDictionary.ContainsKey("RTPSECPARA7") ? response.QueryDictionary["RTPSECPARA7"] : string.Empty,
  140:                         RTPSECPARA8 = response.QueryDictionary.ContainsKey("RTPSECPARA8") ? response.QueryDictionary["RTPSECPARA8"] : string.Empty,
  141:                         RTPSECPARA9 = response.QueryDictionary.ContainsKey("RTPSECPARA9") ? response.QueryDictionary["RTPSECPARA9"] : string.Empty,
  142:                         RTPSECPARA10 = response.QueryDictionary.ContainsKey("RTPSECPARA10") ? response.QueryDictionary["RTPSECPARA10"] : string.Empty,
  143:                         RTPSECPARA11 = response.QueryDictionary.ContainsKey("RTPSECPARA11") ? response.QueryDictionary["RTPSECPARA11"] : string.Empty,
  144:                         RTPSECPARA12 = response.QueryDictionary.ContainsKey("RTPSECPARA12") ? response.QueryDictionary["RTPSECPARA12"] : string.Empty,
  145:                         RTPSECPARA13 = response.QueryDictionary.ContainsKey("RTPSECPARA13") ? response.QueryDictionary["RTPSECPARA13"] : string.Empty,
  146:                         RTCPSECPARA1 = response.QueryDictionary.ContainsKey("RTCPSECPARA1") ? response.QueryDictionary["RTCPSECPARA1"] : string.Empty,
  147:                         RTCPSECPARA2 = response.QueryDictionary.ContainsKey("RTCPSECPARA2") ? response.QueryDictionary["RTCPSECPARA2"] : string.Empty,
  148:                         RTCPSECPARA3 = response.QueryDictionary.ContainsKey("RTCPSECPARA3") ? response.QueryDictionary["RTCPSECPARA3"] : string.Empty,
  149:                         RTCPSECPARA4 = response.QueryDictionary.ContainsKey("RTCPSECPARA4") ? response.QueryDictionary["RTCPSECPARA4"] : string.Empty,
  150:                         RTCPSECPARA5 = response.QueryDictionary.ContainsKey("RTCPSECPARA5") ? response.QueryDictionary["RTCPSECPARA5"] : string.Empty,
  151:                         RTCPSECPARA6 = response.QueryDictionary.ContainsKey("RTCPSECPARA6") ? response.QueryDictionary["RTCPSECPARA6"] : string.Empty,
  152:                         RTCPSECPARA7 = response.QueryDictionary.ContainsKey("RTCPSECPARA7") ? response.QueryDictionary["RTCPSECPARA7"] : string.Empty,
  153:                         RTCPSECPARA8 = response.QueryDictionary.ContainsKey("RTCPSECPARA8") ? response.QueryDictionary["RTCPSECPARA8"] : string.Empty,
  154:                         RTCPSECPARA9 = response.QueryDictionary.ContainsKey("RTCPSECPARA9") ? response.QueryDictionary["RTCPSECPARA9"] : string.Empty,
  155:                         RTCPSECPARA10 = response.QueryDictionary.ContainsKey("RTCPSECPARA10") ? response.QueryDictionary["RTCPSECPARA10"] : string.Empty,
  156:                         RTCPSECPARA11 = response.QueryDictionary.ContainsKey("RTCPSECPARA11") ? response.QueryDictionary["RTCPSECPARA11"] : string.Empty,
  157:                         NOTHWDEV = response.QueryDictionary.ContainsKey("NOTHWDEV") ? Ia.Ngn.Cl.Model.Business.Huawei.SoftX.SpecialBooleanParameterHandling("NOTHWDEV", response.QueryDictionary["NOTHWDEV"]) : false,
  158:                         MIXVOICE = response.QueryDictionary.ContainsKey("MIXVOICE") ? Ia.Ngn.Cl.Model.Business.Huawei.SoftX.SpecialBooleanParameterHandling("MIXVOICE", response.QueryDictionary["MIXVOICE"]) : false,
  159:                         SUPROOTPKG = response.QueryDictionary.ContainsKey("SUPROOTPKG") ? response.QueryDictionary["SUPROOTPKG"] : string.Empty,
  160:                         MGWFCFLAG = response.QueryDictionary.ContainsKey("MGWFCFLAG") ? response.QueryDictionary["MGWFCFLAG"] : string.Empty,
  161:                         OBJRATE = response.QueryDictionary.ContainsKey("OBJRATE") ? int.Parse(response.QueryDictionary["OBJRATE"]) : 0,
  162:                         PROTCTTM = response.QueryDictionary.ContainsKey("PROTCTTM") ? int.Parse(response.QueryDictionary["PROTCTTM"]) : 0,
  163:                         VBDCODECMODE = response.QueryDictionary.ContainsKey("VBDCODECMODE") ? response.QueryDictionary["VBDCODECMODE"] : string.Empty,
  164:                         MRSLISTOFCODEC = response.QueryDictionary.ContainsKey("MRSLISTOFCODEC") ? response.QueryDictionary["MRSLISTOFCODEC"] : string.Empty,
  165:                         HEARTBEATTIMES = response.QueryDictionary.ContainsKey("HEARTBEATTIMES") ? int.Parse(response.QueryDictionary["HEARTBEATTIMES"]) : 0,
  166:                         MGWGROUPNO = response.QueryDictionary.ContainsKey("MGWGROUPNO") ? int.Parse(response.QueryDictionary["MGWGROUPNO"]) : 0,
  167:                         IPDOMAIN = response.QueryDictionary.ContainsKey("IPDOMAIN") ? int.Parse(response.QueryDictionary["IPDOMAIN"]) : 0,
  168:                         CP = response.QueryDictionary.ContainsKey("CP") ? response.QueryDictionary["CP"] : string.Empty,
  169:                         UCATTEX = response.QueryDictionary.ContainsKey("UCATTEX") ? response.QueryDictionary["UCATTEX"] : string.Empty,
  170:                     };
  171:  
  172:                     if (mgw == null)
  173:                     {
  174:                         newMgw.Created = newMgw.Updated = DateTime.UtcNow.AddHours(3);
  175:  
  176:                         db.Mgws.Add(newMgw);
  177:  
  178:                         insertedItemCount++;
  179:                     }
  180:                     else
  181:                     {
  182:                         existingItemCount = 1;
  183:  
  184:                         if (mgw.Update(newMgw))
  185:                         {
  186:                             db.Mgws.Attach(mgw);
  187:                             db.Entry(mgw).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
  188:  
  189:                             updatedItemCount++;
  190:                         }
  191:                     }
  192:                 }
  193:                 else
  194:                 {
  195:                     // below: remove since reading was empty
  196:  
  197:                     if (mgw != null)
  198:                     {
  199:                         existingItemCount = 1;
  200:  
  201:                         mgw = (from m in db.Mgws where m.Id == id select m).SingleOrDefault();
  202:  
  203:                         db.Mgws.Remove(mgw);
  204:  
  205:                         deletedItemCount++;
  206:                     }
  207:                 }
  208:  
  209:                 db.SaveChanges();
  210:             }
  211:  
  212:             if (insertedItemCount != 0 || updatedItemCount != 0 || deletedItemCount != 0) isUpdated = true;
  213:             else isUpdated = false;
  214:  
  215:             result.AddSuccess("(" + readItemCount + "/" + existingItemCount + "/" + insertedItemCount + "," + updatedItemCount + "," + deletedItemCount + ")");
  216:  
  217:             return isUpdated;
  218:         }
  219:  
  220:         ////////////////////////////////////////////////////////////////////////////
  221:  
  222:         /// <summary>
  223:         ///
  224:         /// </summary>
  225:         public static List<Ia.Ngn.Cl.Model.Huawei.Mgw> List()
  226:         {
  227:             List<Ia.Ngn.Cl.Model.Huawei.Mgw> list;
  228:  
  229:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  230:             {
  231:                 list = (from s in db.Mgws select s).ToList();
  232:             }
  233:  
  234:             return list;
  235:         }
  236:  
  237:         ////////////////////////////////////////////////////////////////////////////
  238:  
  239:         /// <summary>
  240:         /// 
  241:         /// </summary>
  242:         public static Ia.Ngn.Cl.Model.Huawei.Mgw List(string service)
  243:         {
  244:             Ia.Ngn.Cl.Model.Huawei.Mgw mgw;
  245:  
  246:             var pui = Ia.Ngn.Cl.Model.Business.NumberFormatConverter.Pui(service);
  247:  
  248:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  249:             {
  250:                 mgw = (from m in db.Mgws
  251:                        join a in db.Asbrs on m.Id equals a.Mgw.Id
  252:                        where a.PUI == pui
  253:                        select m).SingleOrDefault();
  254:             }
  255:  
  256:             return mgw;
  257:         }
  258:  
  259:         ////////////////////////////////////////////////////////////////////////////
  260:  
  261:         /// <summary>
  262:         ///
  263:         /// </summary>
  264:         public static List<string> EidList(string networkElementDomain)
  265:         {
  266:             List<string> list;
  267:  
  268:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  269:             {
  270:                 list = (from m in db.Mgws where m.NetworkElement == networkElementDomain select m.EID).ToList();
  271:             }
  272:  
  273:             return list;
  274:         }
  275:  
  276:         ////////////////////////////////////////////////////////////////////////////
  277:  
  278:         /// <summary>
  279:         ///
  280:         /// </summary>
  281:         public static List<string> EidList()
  282:         {
  283:             List<string> list;
  284:  
  285:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  286:             {
  287:                 list = (from m in db.Mgws select m.EID).ToList();
  288:             }
  289:  
  290:             return list;
  291:         }
  292:  
  293:         ////////////////////////////////////////////////////////////////////////////
  294:  
  295:         /// <summary>
  296:         ///
  297:         /// </summary>
  298:         public static Dictionary<string, Ia.Ngn.Cl.Model.Business.Default.SwitchRoute> PstnServiceToSwitchRouteDictionary()
  299:         {
  300:             Dictionary<string, Ia.Ngn.Cl.Model.Business.Default.SwitchRoute> dictionary;
  301:  
  302:             dictionary = new Dictionary<string, Ia.Ngn.Cl.Model.Business.Default.SwitchRoute>();
  303:  
  304:             using (var db = new Ia.Ngn.Cl.Model.Ngn())
  305:             {
  306:                 var list = (from s in db.Mgws select new { s.Id/*.USRNUM, s.RNIDX2*/ }).ToList();
  307:  
  308:                 foreach (var l in list)
  309:                 {
  310:                     //dictionary[l.USRNUM] = Ia.Ngn.Cl.Model.Business.Huawei.Mgw.RnidxRouteToSwitchRoute(l.RNIDX2);
  311:                 }
  312:             }
  313:  
  314:             return dictionary;
  315:         }
  316:  
  317:         ////////////////////////////////////////////////////////////////////////////
  318:         ////////////////////////////////////////////////////////////////////////////
  319:  
  320:         /// <summary>
  321:         ///
  322:         /// </summary>
  323:         public static string ToSimpleTextString(Ia.Ngn.Cl.Model.Huawei.Mgw mgw)
  324:         {
  325:             StringBuilder sb;
  326:  
  327:             sb = new StringBuilder();
  328:  
  329:             sb.AppendLine("EID: " + mgw.EID);
  330:             //sb.AppendLine("MGWID: " + mgw.MGWID);
  331:             sb.AppendLine("MGWDESC: " + mgw.MGWDESC);
  332:             sb.AppendLine("GWTP: " + mgw.GWTP);
  333:             sb.AppendLine("PTYPE: " + mgw.PTYPE);
  334:             sb.AppendLine("MGCMODULENO: " + mgw.MGCMODULENO);
  335:             sb.AppendLine("MSTYPE: " + mgw.MSTYPE);
  336:             //sb.AppendLine("MAX: " + mgw.MAX);
  337:             //sb.AppendLine("IPADDR: " + mgw.IPADDR);
  338:             //sb.AppendLine("IPPORT: " + mgw.IPPORT);
  339:             //sb.AppendLine("PREMRS: " + mgw.PREMRS);
  340:             sb.AppendLine("MGWGROUPNO: " + mgw.MGWGROUPNO);
  341:             //sb.AppendLine("SBC: " + mgw.SBC);
  342:  
  343:             return sb.ToString();
  344:         }
  345:  
  346:         ////////////////////////////////////////////////////////////////////////////
  347:         ////////////////////////////////////////////////////////////////////////////
  348:     }
  349:  
  350:     ////////////////////////////////////////////////////////////////////////////
  351:     ////////////////////////////////////////////////////////////////////////////
  352: }