)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » Ont (Ia.Ftn.Cl.Models.Business.Nokia)

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

ONT support class of Fixed Telecommunications Network (FTN) Nokia business model.

    1: using System.Collections;
    2: using System.Collections.Generic;
    3: using System.Linq;
    4: using System.Text.RegularExpressions;
    5:  
    6: namespace Ia.Ftn.Cl.Models.Business.Nokia
    7: {
    8:     ////////////////////////////////////////////////////////////////////////////
    9:  
   10:     /// <summary publish="true">
   11:     /// ONT support class of Fixed Telecommunications Network (FTN) Nokia business model.
   12:     /// </summary>
   13:     /// 
   14:     /// <remarks> 
   15:     /// Copyright © 2006-2018 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   16:     /// </remarks> 
   17:     public class Ont
   18:     {
   19:         /// <summary/>
   20:         public static readonly int MaximumCardValue = 3;
   21:  
   22:         /// <summary/>
   23:         public static readonly int MinimumCardValue = 1;
   24:  
   25:         /// <summary/>
   26:         public static readonly int MaximumPortValue = 24;
   27:  
   28:         /// <summary/>
   29:         public static readonly int MinimumPortValue = 1;
   30:  
   31:         /// <summary/>
   32:         public class EquipmentType
   33:         {
   34:             /// <summary/>
   35:             public string Name;
   36:  
   37:             /// <summary/>
   38:             public string Model;
   39:  
   40:             /// <summary/>
   41:             public string ActiveSoftware;
   42:  
   43:             /// <summary/>
   44:             public string VersionNumber;
   45:  
   46:             /// <summary/>
   47:             public int TelPorts;
   48:  
   49:             /// <summary/>
   50:             public int EthernetPorts;
   51:  
   52:             /// <summary/>
   53:             public Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType FamilyType;
   54:  
   55:             /// <summary/>
   56:             public EquipmentType() { }
   57:         }
   58:  
   59:         /// <summary/>
   60:         public static EquipmentType[] EquipmentTypeList =
   61:             {
   62:             new EquipmentType { Name = "BVM3G00CRAO420EB", Model = "O-420E-B", ActiveSoftware="3FE50853AJJE12 (R05.06.01 H.248)", VersionNumber="3FE50683AD", FamilyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sfu, EthernetPorts = 2, TelPorts = 4 },
   63:             new EquipmentType { Name = "BVM4310DRAO420EB", Model = "O-420E-B", ActiveSoftware="3FE50853AJJE12 (R05.06.01 H.248)", VersionNumber="3FE50683AM", FamilyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sfu, EthernetPorts = 2, TelPorts = 4 },
   64:             new EquipmentType { Name = "BVM4X00DRAO821GD", Model = "O-821G-D", ActiveSoftware="3FE51136AJJE12 (R05.06.01 H.248)", VersionNumber="3FE50774AD", FamilyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sbu, EthernetPorts = 2, TelPorts = 8 },
   65:             new EquipmentType { Name = "BVM5F00CRAO24120", Model = "O-24120G-A", ActiveSoftware="3FE51408AJJE06 (R05.06.01 H.248)", VersionNumber="3FE51185AB", FamilyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Mdu, EthernetPorts = 12, TelPorts = 24 },
   66:             new EquipmentType { Name = "BVM5J00CRAO820GD", Model = "O-820G-D", ActiveSoftware="3FE51136AJJE12 (R05.06.01 H.248)", VersionNumber="3FE50774AG", FamilyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sbu, EthernetPorts = 2, TelPorts = 8 },
   67:             new EquipmentType { Name = "VAMZS10BRAG440GA", Model = "G-440G-A", ActiveSoftware="3FE56398DFGB42 (R05.06.01 H.248)", VersionNumber="3FE55423BA", FamilyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gfu, EthernetPorts = 4, TelPorts = 4 },
   68:             new EquipmentType { Name = "RVM3G00CRAO420EB", Model = "G-24240E-P", ActiveSoftware="3FE45670AOCK69 (R05.06.01 H.248)", VersionNumber="3FE45307AA", FamilyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gmdu, EthernetPorts = 24, TelPorts = 24 },
   69:  
   70:             //new EquipmentType { Name = "BVMDM00CRBG881GA", Model = "Undefined", ActiveSoftware="", VersionNumber="", FamilyType = Ia.Ftn.Cl.Model.Business.Nokia.Ont.FamilyType.Undefined, EthernetPorts = 0, TelPorts = 0 },
   71:         };
   72:  
   73:         /*
   74: select count(Id) as Count, substring(ActiveSoftware, 1, 6) as ActiveSoftware from Onts group by substring([ActiveSoftware], 1, 6)
   75: 
   76: Count    ActiveSoftware
   77: 160    3FE514
   78: 2    3FE556
   79: 4    3FE511
   80: 26811    3FE508
   81: 46317    NULL
   82: 2    3FE456
   83: 1    3FE559
   84: 108    3FE563       
   85:          */
   86:  
   87:         /*
   88: select count(Id) as Count, '[' + EquipmentId + ']' as EquipmentId from Onts group by EquipmentId
   89: 
   90: Count    EquipmentId
   91: 1    [BVM4X00DRAO821GD]
   92: 2    [RVM3G00CRAO420EB]
   93: 110    [VAMZS10BRAG440GA]
   94: 1    [BVMDM00CRBG881GA]
   95: 3    [BVM5J00CRAO820GD]
   96: 2913    [BVM4310DRAO420EB]
   97: 46376    NULL
   98: 23839    [BVM3G00CRAO420EB]
   99: 160    [BVM5F00CRAO24120]
  100:         */
  101:  
  102:         /// <summary/>
  103:         public enum FamilyType { Undefined = 0, Sfu = 1, Soho = 2, Mdu = 3, Gfu = 4, Sbu = 5, Gmdu = 6 };
  104:  
  105:         /// <summary/>
  106:         public Ont() { }
  107:  
  108:         ////////////////////////////////////////////////////////////////////////////
  109:  
  110:         /// <summary>
  111:         ///
  112:         /// </summary>
  113:         public static string OntId(string ponId, int ontNumber)
  114:         {
  115:             string id;
  116:  
  117:             id = Ia.Ftn.Cl.Models.Business.Default.OntId(ponId, ontNumber);
  118:  
  119:             return id;
  120:         }
  121:  
  122:         ////////////////////////////////////////////////////////////////////////////
  123:  
  124:         /// <summary>
  125:         ///
  126:         /// </summary>
  127:         public static string OntId(string amsName, string cardPortOntSequence)
  128:         {
  129:             string id;
  130:             string ontPosition;
  131:  
  132:             ontPosition = Ia.Ftn.Cl.Models.Business.Nokia.Ams.OntPositionFromAmsNameAndCardPortOntSquence(amsName, cardPortOntSequence);
  133:  
  134:             id = Ia.Ftn.Cl.Models.Data.NetworkDesignDocument.OntIdByPosition(ontPosition);
  135:             //id = (from o in Ia.Ftn.Cl.Model.Data.NetworkDesignDocument.OntList where o.Position == ontPosition select o.Id).SingleOrDefault();
  136:  
  137:             return id;
  138:         }
  139:  
  140:         ////////////////////////////////////////////////////////////////////////////
  141:  
  142:         /// <summary>
  143:         ///
  144:         /// </summary>
  145:         public static Ia.Ftn.Cl.Models.Business.Nokia.Ont.EquipmentType EquipmentTypeFromActiveSoftware(string activeSoftware)
  146:         {
  147:             Ia.Ftn.Cl.Models.Business.Nokia.Ont.EquipmentType equipmentType;
  148:  
  149:             equipmentType = null;
  150:  
  151:             return equipmentType;
  152:         }
  153:  
  154:         ////////////////////////////////////////////////////////////////////////////
  155:  
  156:         /// <summary>
  157:         /// Return the ONT family type id from the software version
  158:         /// </summary>
  159:         public static Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType FamilyTypeIdFromActiveSoftwareAndPlannedSoftware(string activeSoftware, string plannedSoftware)
  160:         {
  161:             Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType familyType;
  162:  
  163:             if (activeSoftware != null)
  164:             {
  165:                 if (activeSoftware == plannedSoftware || plannedSoftware == "auto" || plannedSoftware == "AUTO")
  166:                 {
  167:                     if (activeSoftware.StartsWith("3FE508")) familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sfu;
  168:                     else if (activeSoftware.StartsWith("3FE563")) familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gfu;
  169:                     else if (activeSoftware.StartsWith("3FE511")) familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Soho;
  170:                     else if (activeSoftware.StartsWith("3FE514")) familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Mdu;
  171:                     else if (activeSoftware.StartsWith("3FE456")) familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gmdu;
  172:                     else familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Undefined;
  173:                 }
  174:                 else familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Undefined;
  175:             }
  176:             else familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Undefined;
  177:  
  178:             return familyType;
  179:         }
  180:  
  181:         ////////////////////////////////////////////////////////////////////////////
  182:  
  183:         /// <summary>
  184:         /// 
  185:         /// </summary>
  186:         public static Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType FamilyTypeFromString(string familyTypeString)
  187:         {
  188:             // this will convert string format of ONU type from both email submittals and from EMSONT EQUIPMENTID values from NCE
  189:  
  190:             Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType familyType;
  191:  
  192:             if (!string.IsNullOrEmpty(familyTypeString))
  193:             {
  194:                 switch (familyTypeString.ToUpper())
  195:                 {
  196:                     case "SFU": familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sfu; break;
  197:                     case "GFU": familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gfu; break;
  198:                     case "SOHO": familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Soho; break;
  199:                     case "MDU": familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Mdu; break;
  200:                     case "GMDU": familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gmdu; break;
  201:                     default: familyType = Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Undefined; break;
  202:                 }
  203:             }
  204:             else familyType = 0;
  205:  
  206:             return familyType; // Undefined
  207:         }
  208:  
  209:         ////////////////////////////////////////////////////////////////////////////
  210:  
  211:         /// <summary>
  212:         /// 
  213:         /// </summary>
  214:         public static string FamilyTypeStringFromFamilyTypeId(int familyTypeId)
  215:         {
  216:             string familyTypeString;
  217:             Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType familyType;
  218:  
  219:             familyType = (Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType)familyTypeId;
  220:  
  221:             switch (familyType)
  222:             {
  223:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sfu: familyTypeString = "SFU"; break;
  224:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gfu: familyTypeString = "GFU"; break;
  225:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Soho: familyTypeString = "SOHO"; break;
  226:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Mdu: familyTypeString = "MDU"; break;
  227:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gmdu: familyTypeString = "GMDU"; break;
  228:                 default: familyTypeString = string.Empty; break;
  229:             }
  230:  
  231:             return familyTypeString;
  232:         }
  233:  
  234:         ////////////////////////////////////////////////////////////////////////////
  235:  
  236:         /// <summary>
  237:         /// 
  238:         /// </summary>
  239:         public static int PossibleNumberOfTdForOntFamilyType(int familyTypeId)
  240:         {
  241:             Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType familyType;
  242:  
  243:             familyType = (Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType)familyTypeId;
  244:  
  245:             return PossibleNumberOfTdForOntFamilyType(familyType);
  246:         }
  247:  
  248:         ////////////////////////////////////////////////////////////////////////////
  249:  
  250:         /// <summary>
  251:         /// 
  252:         /// </summary>
  253:         public static int PossibleNumberOfTdForOntFamilyType(Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType familyType)
  254:         {
  255:             int number;
  256:  
  257:             switch (familyType)
  258:             {
  259:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sfu: number = 4; break;
  260:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gfu: number = 4; break;
  261:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Soho: number = 8; break;
  262:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Mdu: number = 24; break;
  263:                 case Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gmdu: number = 24; break;
  264:                 default: number = 0; break;
  265:             }
  266:  
  267:             return number;
  268:         }
  269:  
  270:         ////////////////////////////////////////////////////////////////////////////
  271:  
  272:         /// <summary>
  273:         /// Get the number of card-port for a parameter of familyType and td
  274:         /// </summary>
  275:         public static void ReturnOntPotsCardAndPortFromFamilyTypeAndTd(Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType familyType, int td, out int card, out int port)
  276:         {
  277:             card = port = 0;
  278:  
  279:             if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sfu || familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gfu)
  280:             {
  281:                 if (td >= 1 && td <= 4)
  282:                 {
  283:                     card = 2; port = td;
  284:                 }
  285:             }
  286:             else if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Soho)
  287:             {
  288:                 if (td >= 1 && td <= 8)
  289:                 {
  290:                     card = 2; port = td;
  291:                 }
  292:             }
  293:             else if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Mdu)
  294:             {
  295:                 if (td >= 1 && td <= 24)
  296:                 {
  297:                     if (td >= 1 && td <= 4 || td >= 13 && td <= 16)
  298:                     {
  299:                         card = 1;
  300:                         if (td <= 4) port = td;
  301:                         else port = td - 8;
  302:                     }
  303:                     else if (td >= 5 && td <= 8 || td >= 17 && td <= 20)
  304:                     {
  305:                         card = 2;
  306:                         if (td <= 8) port = td - 4;
  307:                         else port = td - 12;
  308:                     }
  309:                     else if (td >= 9 && td <= 12 || td >= 21 && td <= 24)
  310:                     {
  311:                         card = 3;
  312:                         if (td <= 12) port = td - 8;
  313:                         else port = td - 16;
  314:                     }
  315:                 }
  316:             }
  317:             else if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gmdu)
  318:             {
  319:                 if (td >= 1 && td <= 24)
  320:                 {
  321:                     card = 2;
  322:                     port = td;
  323:                 }
  324:             }
  325:         }
  326:  
  327:         ////////////////////////////////////////////////////////////////////////////
  328:  
  329:         /// <summary>
  330:         /// 
  331:         /// </summary>
  332:         public static List<string> PossiblePotsCardPortConfigurationForOntFamilyTypeList(Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType familyType)
  333:         {
  334:             var list = new List<string>(100);
  335:  
  336:             /*
  337:              * see 
  338:         public static readonly int MaximumCardValue = 0;
  339:         public static readonly int MinimumCardValue = 0;
  340:         public static readonly int MaximumPortValue = 0;
  341:         public static readonly int MinimumPortValue = 0;
  342:              */
  343:  
  344:             if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sfu || familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gfu)
  345:             {
  346:                 list.Add("2-1");
  347:                 list.Add("2-2");
  348:                 list.Add("2-3");
  349:                 list.Add("2-4");
  350:             }
  351:             else if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Soho)
  352:             {
  353:                 list.Add("2-1");
  354:                 list.Add("2-2");
  355:                 list.Add("2-3");
  356:                 list.Add("2-4");
  357:                 list.Add("2-5");
  358:                 list.Add("2-6");
  359:                 list.Add("2-7");
  360:                 list.Add("2-8");
  361:             }
  362:             else if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Mdu)
  363:             {
  364:                 list.Add("1-1");
  365:                 list.Add("1-2");
  366:                 list.Add("1-3");
  367:                 list.Add("1-4");
  368:                 list.Add("1-5");
  369:                 list.Add("1-6");
  370:                 list.Add("1-7");
  371:                 list.Add("1-8");
  372:  
  373:                 list.Add("2-1");
  374:                 list.Add("2-2");
  375:                 list.Add("2-3");
  376:                 list.Add("2-4");
  377:                 list.Add("2-5");
  378:                 list.Add("2-6");
  379:                 list.Add("2-7");
  380:                 list.Add("2-8");
  381:  
  382:                 list.Add("3-1");
  383:                 list.Add("3-2");
  384:                 list.Add("3-3");
  385:                 list.Add("3-4");
  386:                 list.Add("3-5");
  387:                 list.Add("3-6");
  388:                 list.Add("3-7");
  389:                 list.Add("3-8");
  390:             }
  391:             else if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gmdu)
  392:             {
  393:                 list.Add("2-1");
  394:                 list.Add("2-2");
  395:                 list.Add("2-3");
  396:                 list.Add("2-4");
  397:                 list.Add("2-5");
  398:                 list.Add("2-6");
  399:                 list.Add("2-7");
  400:                 list.Add("2-8");
  401:  
  402:                 list.Add("2-9");
  403:                 list.Add("2-10");
  404:                 list.Add("2-11");
  405:                 list.Add("2-12");
  406:                 list.Add("2-13");
  407:                 list.Add("2-14");
  408:                 list.Add("2-15");
  409:                 list.Add("2-16");
  410:  
  411:                 list.Add("2-17");
  412:                 list.Add("2-18");
  413:                 list.Add("2-19");
  414:                 list.Add("2-20");
  415:                 list.Add("2-21");
  416:                 list.Add("2-22");
  417:                 list.Add("2-23");
  418:                 list.Add("2-24");
  419:             }
  420:  
  421:             return list;
  422:         }
  423:  
  424:         ////////////////////////////////////////////////////////////////////////////
  425:  
  426:         /// <summary>
  427:         /// 
  428:         /// </summary>
  429:         public static List<string> PossibleHsiCardPortServiceConfigurationForOntFamilyTypeList(Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType familyType)
  430:         {
  431:             List<string> list;
  432:  
  433:             list = new List<string>(100);
  434:  
  435:             if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Sfu || familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Soho)
  436:             {
  437:                 list.Add("1-1-1");
  438:                 list.Add("1-2-1");
  439:             }
  440:             else if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gfu)
  441:             {
  442:                 list.Add("1-1-1");
  443:                 list.Add("1-2-1");
  444:                 list.Add("1-3-1");
  445:                 list.Add("1-4-1");
  446:             }
  447:             else if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Mdu)
  448:             {
  449:                 list.Add("1-1-1");
  450:                 list.Add("1-2-1");
  451:                 list.Add("1-3-1");
  452:                 list.Add("1-4-1");
  453:                 list.Add("1-5-1");
  454:                 list.Add("1-6-1");
  455:                 list.Add("1-7-1");
  456:                 list.Add("1-8-1");
  457:                 list.Add("1-9-1");
  458:                 list.Add("1-10-1");
  459:                 list.Add("1-11-1");
  460:                 list.Add("1-12-1");
  461:             }
  462:             else if (familyType == Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType.Gmdu)
  463:             {
  464:                 // not verified
  465:  
  466:                 list.Add("1-1-1");
  467:                 list.Add("1-2-1");
  468:                 list.Add("1-3-1");
  469:                 list.Add("1-4-1");
  470:                 list.Add("1-5-1");
  471:                 list.Add("1-6-1");
  472:                 list.Add("1-7-1");
  473:                 list.Add("1-8-1");
  474:                 list.Add("1-9-1");
  475:                 list.Add("1-10-1");
  476:                 list.Add("1-11-1");
  477:                 list.Add("1-12-1");
  478:  
  479:                 list.Add("1-13-1");
  480:                 list.Add("1-14-1");
  481:                 list.Add("1-15-1");
  482:                 list.Add("1-16-1");
  483:                 list.Add("1-17-1");
  484:                 list.Add("1-18-1");
  485:                 list.Add("1-19-1");
  486:                 list.Add("1-20-1");
  487:                 list.Add("1-21-1");
  488:                 list.Add("1-22-1");
  489:                 list.Add("1-23-1");
  490:                 list.Add("1-24-1");
  491:             }
  492:  
  493:             return list;
  494:         }
  495:  
  496:         ////////////////////////////////////////////////////////////////////////////
  497:  
  498:         /// <summary>
  499:         /// 
  500:         /// </summary>
  501:         public static int PossibleNumberOfHsiCardPortServiceConfigurationForOntFamilyType(int familyType)
  502:         {
  503:             List<string> list;
  504:  
  505:             list = PossibleHsiCardPortServiceConfigurationForOntFamilyTypeList((Ia.Ftn.Cl.Models.Business.Nokia.Ont.FamilyType)familyType);
  506:  
  507:             return list.Count;
  508:         }
  509:  
  510:         ////////////////////////////////////////////////////////////////////////////
  511:  
  512:         /// <summary>
  513:         ///
  514:         /// </summary>
  515:         public static string OntPositionFromOntId(string ontId)
  516:         {
  517:             string rest, ontPosition, amsName;
  518:             int oltId, card, port, ont;
  519:  
  520:             oltId = int.Parse(ontId.Substring(0, 1 + 2 + 2 + 2 + 2)); // network id, site id, router id, odf id, olt id
  521:  
  522:             rest = Regex.Replace(ontId, "^" + oltId.ToString(), "");
  523:  
  524:             card = int.Parse(rest.Substring(4, 2));
  525:             port = int.Parse(rest.Substring(6, 2));
  526:             ont = int.Parse(rest.Substring(8, 2));
  527:  
  528:             amsName = Ia.Ftn.Cl.Models.Data.NetworkDesignDocument.AmsNameFromOltId(oltId);
  529:  
  530:             ontPosition = amsName + "-" + card + "-" + port + "-" + ont;
  531:  
  532:             return ontPosition;
  533:         }
  534:  
  535:         ////////////////////////////////////////////////////////////////////////////
  536:  
  537:         /// <summary>
  538:         ///
  539:         /// </summary>
  540:         public static bool IsValidSerialNumber(string serialNumber)
  541:         {
  542:             bool isValid;
  543:             string s;
  544:  
  545:             if (!string.IsNullOrEmpty(serialNumber))
  546:             {
  547:                 if (serialNumber.Length == 12) // ALCLA0A23C74
  548:                 {
  549:                     s = serialNumber.ToUpper();
  550:  
  551:                     if (s.Substring(0, 4) == "ALCL")
  552:                     {
  553:                         s = s.Substring(4, 8);
  554:  
  555:                         isValid = Ia.Cl.Models.Default.IsHex(s);
  556:                     }
  557:                     else isValid = false;
  558:                 }
  559:                 else isValid = false;
  560:             }
  561:             else isValid = false;
  562:  
  563:             return isValid;
  564:         }
  565:  
  566:         ////////////////////////////////////////////////////////////////////////////
  567:         ////////////////////////////////////////////////////////////////////////////
  568:     }
  569:  
  570:     ////////////////////////////////////////////////////////////////////////////
  571:     ////////////////////////////////////////////////////////////////////////////
  572: }