Ejemplo n.º 1
0
        public static void UpdateEndpoint(EndPointRow pEndPointRow, EndpointContext pEndpointContext)
        {
            //pEndpointContext.TransactionType = TxType.Delete;
            using (var _db = new Rbr_Db()) {
                using (var _tx = new Transaction(_db, pEndPointRow, pEndpointContext)) {
                    var _original = EndpointManager.Get(_db, pEndPointRow.End_point_id);
                    EndpointManager.Update(_db, _original, pEndPointRow);

                    if (pEndpointContext.CarrierAcctEPMapRowToDelete != null)
                    {
                        foreach (var _carrierAcctEPMapRow in pEndpointContext.CarrierAcctEPMapRowToDelete)
                        {
                            CarrierAcctManager.DeleteDialPeer(_db, _carrierAcctEPMapRow, pEndPointRow);
                        }
                    }

                    if (pEndpointContext.CarrierAcctEPMapRowToAdd != null)
                    {
                        foreach (var _carrierAcctEPMapRow in pEndpointContext.CarrierAcctEPMapRowToAdd)
                        {
                            if (_carrierAcctEPMapRow.Carrier_acct_EP_map_id <= 0)
                            {
                                _carrierAcctEPMapRow.End_point_id = pEndPointRow.End_point_id;
                                CarrierAcctManager.AddDialPeer(_db, _carrierAcctEPMapRow, pEndPointRow);
                            }
                        }
                    }
                    _tx.Commit();
                }
            }
        }
Ejemplo n.º 2
0
 public static void DeleteDialPeerByRoute(CarrierAcctDto pCarrierAcct, EndPointRow pEndPointRow, RatedRouteDto pCarrierRoute)
 {
     using (var _db = new Rbr_Db()) {
         using (var _tx = new Transaction(_db, pCarrierAcct, pEndPointRow, pCarrierRoute)) {
             var _carrierAcctEPMapRow = CarrierAcctManager.GetDialPeer(_db, pCarrierAcct.CarrierAcctId, pEndPointRow.End_point_id, pCarrierRoute.RatedRouteId);
             CarrierAcctManager.DeleteDialPeer(_db, _carrierAcctEPMapRow, pEndPointRow);
             _tx.Commit();
         }
     }
 }
Ejemplo n.º 3
0
 public static void DeleteDialPeerByCountry(CarrierAcctDto pCarrierAcct, EndPointRow pEndPointRow, CountryDto pCountry)
 {
     using (var _db = new Rbr_Db()) {
         using (var _tx = new Transaction(_db, pCarrierAcct, pEndPointRow, pCountry)) {
             //CarrierAcctManager.DeleteDialPeerByCountry(_db, pCarrierAcct, pCountry, pEndPointRow);
             var _countryCarrierRoutes = CarrierAcctManager.GetByCarrierAcctIdCountryId(_db, pCarrierAcct.CarrierAcctId, pCountry.CountryId);
             var _carrierAcctEPMapRows = CarrierAcctManager.GetByCountry(_db, _countryCarrierRoutes, pCarrierAcct.CarrierAcctId, pEndPointRow.End_point_id);
             foreach (var _carrierAcctEPMapRow in _carrierAcctEPMapRows)
             {
                 CarrierAcctManager.DeleteDialPeer(_db, _carrierAcctEPMapRow, pEndPointRow);
             }
             _tx.Commit();
         }
     }
 }
Ejemplo n.º 4
0
        public static void DeleteEndpoint(EndPointRow pEndPointRow)
        {
            using (var _db = new Rbr_Db()) {
                using (var _tx = new Transaction(_db, pEndPointRow)) {
                    CustomerAcctManager.DeleteDialPeersByEndpointId(_db, pEndPointRow.End_point_id);

                    //- Delete Carrier Dialpeers
                    var _dialPeers = _db.CarrierAcctEPMapCollection.GetByEnd_point_id(pEndPointRow.End_point_id);
                    if (_dialPeers != null && _dialPeers.Length > 0)
                    {
                        foreach (var _carrierAcctEPMapRow in _dialPeers)
                        {
                            CarrierAcctManager.DeleteDialPeer(_db, _carrierAcctEPMapRow, pEndPointRow);
                        }
                    }

                    EndpointManager.Delete(_db, pEndPointRow);
                    _tx.Commit();
                }
            }
        }