コード例 #1
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();
                }
            }
        }