Ejemplo n.º 1
0
 public static void DeleteCabina(short pEndPointId, short pCustomerAcctId, string pPrefix)
 {
     using (var _db = new Rbr_Db()) {
         using (var _tx = new Transaction(_db, pEndPointId, pCustomerAcctId, pPrefix)) {
             CustomerAcctManager.DeleteDialPeer(_db, pEndPointId, pPrefix);
             _tx.Commit();
         }
     }
 }
Ejemplo n.º 2
0
 public static void DeleteSelectedDialPeersForCustomer(EndPointRow[] pEndpointRows, CustomerAcctDto pCustomerAcct)
 {
     using (var _db = new Rbr_Db()) {
         using (var _tx = new Transaction(_db, pEndpointRows, pCustomerAcct)) {
             foreach (var _endPointRow in pEndpointRows)
             {
                 CustomerAcctManager.DeleteDialPeer(_db, _endPointRow.End_point_id, pCustomerAcct.PrefixIn);
             }
             _tx.Commit();
         }
     }
 }
Ejemplo n.º 3
0
 public static void DeleteDialPeer(EndPointRow pEndpointRow, CustomerAcctDto pCustomerAcct)
 {
     using (var _db = new Rbr_Db()) {
         using (var _tx = new Transaction(_db, pEndpointRow, pCustomerAcct)) {
             CustomerAcctManager.DeleteDialPeer(_db, pEndpointRow.End_point_id, pCustomerAcct.PrefixIn);
             if (pCustomerAcct.ServiceDto.ServiceType == ServiceType.Retail)
             {
                 foreach (var _accessNumberDto in pCustomerAcct.ServiceDto.AccessNumbers)
                 {
                     CustomerAcctManager.DeleteDialPeer(_db, pEndpointRow.End_point_id, _accessNumberDto.Number.ToString());
                 }
             }
             _tx.Commit();
         }
     }
 }
Ejemplo n.º 4
0
        public static void ReassignDialPeer(EndPointRow pEndpointRow, CustomerAcctDto pFromCustomerAcct, CustomerAcctDto pToCustomerAcct)
        {
            if (pEndpointRow.WithInPrefixes || pFromCustomerAcct.WithPrefixes || pToCustomerAcct.WithPrefixes)
            {
                throw new Exception("Invalid operation: expecting Endpoint and Customer without Prefixes ONLY.");
            }

            using (var _db = new Rbr_Db()) {
                using (var _tx = new Transaction(_db, pEndpointRow, pFromCustomerAcct, pToCustomerAcct)) {
                    CustomerAcctManager.DeleteDialPeer(_db, pEndpointRow.End_point_id, pFromCustomerAcct.PrefixIn);

                    var _newDialPeerRow = new DialPeerRow
                    {
                        End_point_id     = pEndpointRow.End_point_id,
                        Prefix_in        = pToCustomerAcct.PrefixIn,
                        Customer_acct_id = pToCustomerAcct.CustomerAcctId
                    };
                    CustomerAcctManager.AddDialPeer(_db, _newDialPeerRow, pEndpointRow);
                    _tx.Commit();
                }
            }
        }