Пример #1
0
        private void ajaxCharge()
        {
            string checkCode = base.f("name");
            string value     = base.f("money");
            string code      = base.f("code");
            string text      = "";

            if (!ValidateCode.CheckValidateCode(code, ref text))
            {
                this._response = base.JsonResult(0, "验证码错误");
            }
            else
            {
                int num = new Lottery.DAL.Flex.UserChargeDAL().Save(this.AdminId, "1007", checkCode, Convert.ToDecimal(value));
                if (num == -1)
                {
                    this._response = base.JsonResult(0, "充值金额不能小于最小充值金额!");
                }
                else if (num > 0)
                {
                    this._response = base.JsonResult(1, this.AdminId.ToString());
                }
                else
                {
                    this._response = base.JsonResult(0, "充值失败");
                }
            }
        }
Пример #2
0
        private void ajaxCharge()
        {
            string bankId = base.f("setid");
            string text   = base.f("name");
            string value  = base.f("money");
            string text2  = base.f("code");
            int    num    = new Lottery.DAL.Flex.UserChargeDAL().Save(this.AdminId, bankId, text.Trim(), Convert.ToDecimal(value));

            if (num == -1)
            {
                this._response = base.JsonResult(0, "充值金额不能小于最小充值金额!");
            }
            else if (num > 0)
            {
                this._response = base.JsonResult(1, this.AdminId.ToString());
            }
            else
            {
                this._response = base.JsonResult(0, "充值失败");
            }
        }
Пример #3
0
        /// <summary>
        /// 获取订单状态
        /// </summary>
        private void ajaxChargeState()
        {
            //用户Id
            int userId;

            Int32.TryParse(this.q("userId"), out userId);

            //订单号
            string orderId = this.q("orderid");

            orderId = string.IsNullOrEmpty(orderId) ? "" : orderId;

            //无效订单
            this._response = this.JsonResult(-1, "无效订单");

            if (!string.IsNullOrEmpty(orderId))
            {
                try
                {
                    int num = new Lottery.DAL.Flex.UserChargeDAL().GetState(userId, orderId);

                    if (num == 0)
                    {
                        this._response = this.JsonResult(0, "待支付");
                    }
                    else if (num == 1)
                    {
                        this._response = this.JsonResult(1, "支付成功");
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    this._response = this.JsonResult(-1, "无效订单");
                }
            }
        }