public void AddRoutes(short pAccountId, int[] pBaseRouteIds, ViewContext pContext) { using (var _db = new Rbr_Db()) { using (var _tx = new Transaction(_db, pAccountId, pBaseRouteIds, pContext)) { if (pContext == ViewContext.Carrier) { var _carrierAcct = CarrierAcctManager.GetAcct(_db, pAccountId); CarrierRouteManager.Add(_db, _carrierAcct, pBaseRouteIds); } else if (pContext == ViewContext.Customer) { //NOTE: same as ServiceDialPlan CustomerRouteManager.Add(_db, pAccountId, pBaseRouteIds); } else if (pContext == ViewContext.Service) { //NOTE: same as CustomerDialPlan CustomerRouteManager.Add(_db, pAccountId, pBaseRouteIds); } else { throw new NotImplementedException("ViewContext: " + pContext); } _tx.Commit(); } } }
protected CarrierAcctDto getCarrierAcct(Rbr_Db _db) { CarrierAcctDto _carrierAcct = CarrierAcctManager.GetAcct(_db, args.AccountId); if (_carrierAcct == null) { throw new Exception("CarrierAcct not found [Id: " + args.AccountId + "]"); } return(_carrierAcct); }
public static CarrierAcctDto GetAcct(short pCarrierAcctId) { using (Rbr_Db _db = new Rbr_Db()) { return(CarrierAcctManager.GetAcct(_db, pCarrierAcctId)); } }