Exemplo n.º 1
0
        public Response Execute(User currentUser, string request)
        {
            var req    = JsonConvert.DeserializeObject <Request <VipUse> >(request);
            var vipUse = req.FirstEntity();

            if (string.IsNullOrEmpty(vipUse.CityId))
            {
                vipUse.CityId = "75";
            }

            Response rsp = ResultHelper.CreateResponse();

            //生成 待支付订单
            vipUse.Id          = Ext.NewId();
            vipUse.MasterType  = MasterType.YUEDOUPAY.Id;
            vipUse.MasterId    = "";
            vipUse.VenueId     = "";
            vipUse.CostTypeId  = CostType.YUEDOUCOST.Id;
            vipUse.Discount    = 1;
            vipUse.Amount      = vipUse.TotalAmount * vipUse.Discount;
            vipUse.PayState    = PayState.PAY.Id;//待支付
            vipUse.IsOwnCreate = true;
            vipUse.CreatorId   = currentUser.Id;
            vipUse.CreateDate  = DateTime.Now;
            rsp.Tag            = VipHelper.SaveVipUse(vipUse);
            rsp.IsSuccess      = true;
            return(rsp);
        }
        public Response SaveWaitPay(CoachStudentMoney obj, User currentUser)
        {
            Response rsp = new Response();
            //生成 待支付订单
            var vipUse = new VipUse();

            vipUse.Id         = Ext.NewId();
            vipUse.MasterType = MasterType.STUDENTPAYFORBOOTCAMP.Id;
            vipUse.MasterId   = obj.Id;
            vipUse.CityId     = obj.CityId;
            vipUse.VenueId    = "";
            vipUse.CostTypeId = CostType.COACHCOST.Id;

            vipUse.TotalAmount = obj.ThenMoney;
            vipUse.Discount    = 1;
            vipUse.Amount      = obj.ThenMoney * vipUse.Discount;
            vipUse.PayState    = PayState.PAY.Id;//待支付
            vipUse.IsOwnCreate = true;
            vipUse.Remark      = "购买了集训课";

            vipUse.UserId     = currentUser.Id;
            vipUse.CreatorId  = currentUser.Id;
            vipUse.CreateDate = DateTime.Now;
            rsp.Tag           = VipHelper.SaveVipUse(vipUse);
            rsp.IsSuccess     = true;

            return(rsp);
        }
Exemplo n.º 3
0
        public Response SaveWaitPay(CoachStudentMoneyNotPay obj, User currentUser)
        {
            Response rsp = new Response();
            //生成 待支付订单
            var vipUse = new VipUse();

            vipUse.Id         = Ext.NewId();
            vipUse.MasterType = MasterType.STUDENTPAY.Id;
            vipUse.MasterId   = obj.Id;
            vipUse.CityId     = obj.CityId;
            vipUse.VenueId    = "";
            vipUse.CostTypeId = CostType.COACHCOST.Id;

            vipUse.TotalAmount = obj.ThenMoney;
            vipUse.Discount    = 1;
            vipUse.Amount      = obj.ThenMoney * vipUse.Discount;
            vipUse.PayState    = PayState.PAY.Id;//待支付
            vipUse.IsOwnCreate = true;
            if (obj.CourseTypeId == CoachDic.BigCourse)
            {
                vipUse.Remark = "购买大课" + obj.Amount + "课时";
            }
            else if (obj.CourseTypeId == CoachDic.PrivateCourse)
            {
                vipUse.Remark = "购买私教" + obj.Amount + "课时";
            }

            vipUse.UserId     = currentUser.Id;
            vipUse.CreatorId  = currentUser.Id;
            vipUse.CreateDate = DateTime.Now;
            rsp.Tag           = VipHelper.SaveVipUse(vipUse);
            rsp.IsSuccess     = true;

            return(rsp);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 保存消费记录
        /// </summary>
        /// <param name="request">实体VipUse</param>
        /// <returns></returns>
        public Response Execute(string request)
        {
            var req = JsonConvert.DeserializeObject <Request <VipUse> >(request);

            var result = ResultHelper.Success();

            result.Tag = VipHelper.SaveVipUse(req.Entities.FirstOrDefault());; //返回主键,供下一步使用。

            return(result);
        }