Пример #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 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);
        }
Пример #3
0
        /// <summary>
        /// 获取VIP账户
        /// </summary>
        /// <param name="request">过滤器VipAccount.Id</param>
        /// <returns>VipAccount</returns>
        public Response Execute(User currentUser, string request)
        {
            var req = JsonConvert.DeserializeObject <Request <VipAccount> >(request);

            return(VipHelper.GetVipAccount(req.Filter.Id));
        }