Ejemplo n.º 1
0
        public RetailService(long pAccessNumber)
        {
            AccessNumberListRow _accessNumberRow;

            using (var _db = new Rbr_Db()) {
                _accessNumberRow = _db.AccessNumberListCollection.GetByPrimaryKey(pAccessNumber);
            }
            if (_accessNumberRow == null)
            {
                throw new Exception(string.Format("Service.Ctor: AccessNumber NOT FOUND, AccessNumber={0}", pAccessNumber));
            }
            accessNumber = new AccessNumber(_accessNumberRow);

            using (var _db = new Rbr_Db()) {
                serviceRow = _db.ServiceCollection.GetByPrimaryKey(_accessNumberRow.Service_id);
            }
            if (serviceRow == null)
            {
                throw new Exception(string.Format("Service.Ctor: Service NOT FOUND, ServiceID={0}", _accessNumberRow.Service_id));
            }

            //-- init
            PayphoneSurchargeInfo = SurchargeInfo.Empty;
            if (serviceRow.Payphone_surcharge_id > 0)
            {
                using (var _db = new Rbr_Db()) {
                    var _payphoneSurchargeRow = _db.PayphoneSurchargeCollection.GetByPrimaryKey(serviceRow.Payphone_surcharge_id);
                    if (_payphoneSurchargeRow != null)
                    {
                        PayphoneSurchargeInfo = new SurchargeInfo(_payphoneSurchargeRow.Surcharge, _payphoneSurchargeRow.SurchargeType);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public static short GetCustomerAcctId(string pAccessNumber)
 {
     try {
         var _accessNumber = new AccessNumber(pAccessNumber);
         return(Get(_accessNumber.Number).Id);
     }
     catch (Exception _ex) {
         throw new RbrException(RbrResult.DNIS_Invalid, "CustomerAcct.GetCustomerAcctId", string.Format("Exception={0}", _ex));
     }
 }
Ejemplo n.º 3
0
 //--------------------- Static -----------------------------------------------------------
 public static RetailService Get(string pAccessNumber)
 {
     try {
         var _accessNumber = new AccessNumber(pAccessNumber);
         return(new RetailService(_accessNumber.Number));
     }
     catch (Exception _ex) {
         TimokLogger.Instance.LogRbr(LogSeverity.Error, "RetailService.Get", string.Format("Exception: {0}", _ex));
     }
     return(null);
 }