示例#1
0
        public Response GetYueDouBuyPayInfo(Request <GetVipRelatedFilter> req, VipPayInfo obj, User currentUser)
        {
            Response rsp = new Response();

            //获取我的余额
            var myBalance = VipHelper.GetVipAccount(currentUser.Id).FirstEntity <VipAccount>();

            if (myBalance != null)
            {
                obj.MyBalance = myBalance.Balance;
            }
            //折扣信息
            obj.Discount = 1;
            //支付状态
            if (req.Filter.PayType == "Use")
            {
                obj.PayState = GetVipUsePayState(req.Filter.PayId, req.Filter.PayType);
            }
            else
            {
                obj.PayState = GetVipBuyPayState(req.Filter.PayId, req.Filter.PayType);
            }
            //获取详细支付信息
            rsp = VipHelper.GetVipUseInfo(req.Filter.PayId, true);
            if (rsp.IsSuccess && rsp.Entities.Count > 0)
            {
                obj.VipUseInfo = rsp.FirstEntity <VipUse>();
            }

            return(rsp);
        }
示例#2
0
        public Response Execute(User currentUser, string request)
        {
            var        req = JsonConvert.DeserializeObject <Request <GetVipRelatedFilter> >(request);
            VipPayInfo obj = new VipPayInfo();
            Response   rsp = new Response();

            if (req.Filter.BusinessType == MasterType.VENUE.Id)
            {
                rsp = GetVenuePayInfo(req, obj, currentUser);
            }
            else if (req.Filter.BusinessType == MasterType.STUDENTPAY.Id)
            {
                rsp = GetCoachPayInfo(req, obj, currentUser);
            }
            else if (req.Filter.BusinessType == MasterType.STUDENTPAYFORBOOTCAMP.Id)
            {
                rsp = GetBootcampPayInfo(req, obj, currentUser);
            }
            else if (req.Filter.BusinessType == MasterType.YUEDOUPAY.Id)
            {
                rsp = GetYueDouBuyPayInfo(req, obj, currentUser);
            }


            rsp.Entities = new List <EntityBase>();
            rsp.Entities.Add(obj);
            rsp.IsSuccess = true;
            return(rsp);
        }
示例#3
0
        public Response GetVenuePayInfo(Request <GetVipRelatedFilter> req, VipPayInfo obj, User currentUser)
        {
            Response rsp = new Response();
            //获取 Name, HeadUrl
            var sql = @"
SELECT HeadUrl,Name FROM dbo.Venue WHERE Id=@Id
";
            var cmd = CommandHelper.CreateText <Venue>(FetchType.Fetch, sql);

            cmd.Params.Add("@Id", req.Filter.MasterId);
            rsp = DbContext.GetInstance().Execute(cmd);
            if (rsp.Entities.Count > 0)
            {
                obj.HeadUrl = rsp.FirstEntity <Venue>().HeadUrl;
                obj.Name    = rsp.FirstEntity <Venue>().Name;
            }
            //获取我的余额
            var myBalance = VipHelper.GetVipAccount(currentUser.Id).FirstEntity <VipAccount>();

            if (myBalance != null)
            {
                obj.MyBalance = myBalance.Balance;
            }
            //折扣信息
            obj.Discount = 1;
            //支付状态
            if (req.Filter.PayType == "Use")
            {
                obj.PayState = GetVipUsePayState(req.Filter.PayId, req.Filter.PayType);
            }
            else
            {
                obj.PayState = GetVipBuyPayState(req.Filter.PayId, req.Filter.PayType);
            }

            obj.VipRechargeScaleList  = VipHelper.GetVipRechargeScaleList().Entities.ToList <EntityBase, VipRechargeScale>();
            obj.YueDouBalance         = PayHelper.Instance.GetYueDouBalance(currentUser.Id);
            obj.ConvertibleProportion = UserHelper.GetConfig().YueDouConvertibleProportion;

            return(rsp);
        }