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

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

Migration support class of Fixed Telecommunications Network (FTN) data model.

    1: using System;
    2: using System.Collections.Generic;
    3: using System.Data;
    4: using System.Linq;
    5:  
    6: namespace Ia.Ftn.Cl.Model.Data
    7: {
    8:     ////////////////////////////////////////////////////////////////////////////
    9:  
   10:     /// <summary publish="true">
   11:     /// Migration support class of Fixed Telecommunications Network (FTN) data model.
   12:     /// </summary>
   13:     /// 
   14:     /// <remarks> 
   15:     /// Copyright © 2018-2019 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   16:     ///
   17:     /// 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
   18:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   19:     ///
   20:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   21:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   22:     /// 
   23:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   24:     /// 
   25:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   26:     /// </remarks> 
   27:     public class Migration
   28:     {
   29:         ////////////////////////////////////////////////////////////////////////////
   30:  
   31:         /// <summary>
   32:         ///
   33:         /// </summary>
   34:         public Migration()
   35:         {
   36:  
   37:         }
   38:  
   39:         /*
   40:         ////////////////////////////////////////////////////////////////////////////
   41: 
   42:         /// <summary>
   43:         ///
   44:         /// </summary>
   45:         public static List<Ia.Ftn.Cl.Model.Business.Migration.MigratedService> MigrationPendingPstnServiceWithValidAccessAndNoFtnServiceList()
   46:         {
   47:             int port;
   48:             string service;
   49:             List<string> serviceExemptionList, ftnServiceList;
   50:             Ia.Ftn.Cl.Model.Service2 service2;
   51:             Ia.Ftn.Cl.Model.Business.Service.ServiceSupplementaryService serviceSupplementaryService;
   52:             Ia.Ftn.Cl.Model.Business.NetworkDesignDocument.Pstn pstn;
   53:             Ia.Ftn.Cl.Model.Business.NetworkDesignDocument.Ont nddOnt;
   54: 
   55:             List<Ia.Ftn.Cl.Model.Business.Migration.MigratedService> migratedServiceList;
   56:             Dictionary<string, Ia.Ftn.Cl.Model.Business.NetworkDesignDocument.Ont> pstnServiceToNddOntDictionary;
   57: 
   58:             // find brownfield PSTN services with valid access and no FTN service
   59: 
   60:             using (var db = new Ia.Ftn.Cl.Model.Ftn())
   61:             {
   62:                 var pstnServiceList = Ia.Ftn.Cl.Model.Data.Service2.PstnServiceList;
   63: 
   64:                 pstnServiceToNddOntDictionary = Ia.Ftn.Cl.Model.Data.Service2.PstnServiceToNddOntDictionary;
   65: 
   66:                 ftnServiceList = Ia.Ftn.Cl.Model.Data.Service2.ServiceList;
   67: 
   68:                 // services to provision (pstnServiceToNddOntDictionary and not in ftnServiceIdList)
   69:                 migratedServiceList = new List<Ia.Ftn.Cl.Model.Business.Migration.MigratedService>(pstnServiceToNddOntDictionary.Count);
   70: 
   71:                 // will exclude exempt numbers
   72:                 serviceExemptionList = Ia.Ftn.Cl.Model.Data.Provision.ServiceOfServiceExemptFromProvisionProcessingList();
   73: 
   74:                 foreach (KeyValuePair<string, Ia.Ftn.Cl.Model.Business.NetworkDesignDocument.Ont> kvp in pstnServiceToNddOntDictionary)
   75:                 {
   76:                     service = kvp.Key;
   77:                     nddOnt = kvp.Value;
   78: 
   79:                     if (!ftnServiceList.Contains(service))
   80:                     {
   81:                         if (!serviceExemptionList.Contains(service))
   82:                         {
   83:                             if (Ia.Ftn.Cl.Model.Business.Service.OltIsWithinAllowedToBeMigratedOltList(nddOnt.Pon.PonGroup.Olt))
   84:                             {
   85:                                 service2 = (from s in pstnServiceList where s.Service == service select s).SingleOrDefault();
   86: 
   87:                                 serviceSupplementaryService = new Ia.Ftn.Cl.Model.Business.Service.ServiceSupplementaryService();
   88:                                 serviceSupplementaryService.SupplementaryServiceList = new List<Ia.Ftn.Cl.Model.Business.Service.SupplementaryService>();
   89: 
   90:                                 if (int.TryParse(service2.Service, out int i))
   91:                                 {
   92:                                     serviceSupplementaryService.Service = i;
   93:                                     port = service2.Port;
   94: 
   95:                                     // test to see if service is in Siemens EWSD or Ericsson AXE
   96:                                     pstn = Ia.Ftn.Cl.Model.Data.NetworkDesignDocument.PstnFromService(service);
   97: 
   98:                                     if (pstn != null)
   99:                                     {
  100:                                         if (service2.AbbriviatedCalling) serviceSupplementaryService.SupplementaryServiceList.Add(Ia.Ftn.Cl.Model.Business.Service.SupplementaryService.AbbriviatedCalling);
  101:                                         if (service2.CallerId) serviceSupplementaryService.SupplementaryServiceList.Add(Ia.Ftn.Cl.Model.Business.Service.SupplementaryService.CallerId);
  102:                                         if (service2.CallForwarding) serviceSupplementaryService.SupplementaryServiceList.Add(Ia.Ftn.Cl.Model.Business.Service.SupplementaryService.CallForwarding);
  103:                                         if (service2.CallWaiting) serviceSupplementaryService.SupplementaryServiceList.Add(Ia.Ftn.Cl.Model.Business.Service.SupplementaryService.CallWaiting);
  104:                                         if (service2.ConferenceCall) serviceSupplementaryService.SupplementaryServiceList.Add(Ia.Ftn.Cl.Model.Business.Service.SupplementaryService.ConferenceCall);
  105:                                         if (service2.InternationalCalling) serviceSupplementaryService.SupplementaryServiceList.Add(Ia.Ftn.Cl.Model.Business.Service.SupplementaryService.InternationalCalling);
  106:                                         if (service2.InternationalCallingUserControlled) serviceSupplementaryService.SupplementaryServiceList.Add(Ia.Ftn.Cl.Model.Business.Service.SupplementaryService.InternationalCallingUserControlled);
  107:                                         if (service2.ServiceSuspension) serviceSupplementaryService.SupplementaryServiceList.Add(Ia.Ftn.Cl.Model.Business.Service.SupplementaryService.ServiceSuspension);
  108:                                         if (service2.WakeupCall) serviceSupplementaryService.SupplementaryServiceList.Add(Ia.Ftn.Cl.Model.Business.Service.SupplementaryService.WakeupCall);
  109: 
  110:                                         serviceSupplementaryService.Pin = service2.Pin.ToString();
  111: 
  112:                                         migratedServiceList.Add(new Ia.Ftn.Cl.Model.Business.Migration.MigratedService
  113:                                         {
  114:                                             Service = service,
  115:                                             Port = port,
  116:                                             NddOnt = nddOnt,
  117:                                             Access = service2.Access,
  118:                                             PstnExchangeType = pstn.PstnExchangeType,
  119:                                             ServiceSupplementaryService = serviceSupplementaryService
  120:                                         }
  121:                                         );
  122:                                     }
  123:                                     else throw new Exception("Pstn is null. ");
  124:                                 }
  125:                             }
  126:                         }
  127:                     }
  128:                 }
  129:             }
  130: 
  131:             return migratedServiceList;
  132:         }
  133:         */
  134:  
  135:         ////////////////////////////////////////////////////////////////////////////    
  136:         ////////////////////////////////////////////////////////////////////////////    
  137:     }
  138:  
  139:     ////////////////////////////////////////////////////////////////////////////
  140:     ////////////////////////////////////////////////////////////////////////////   
  141: }