Ejemplo n.º 1
0
        public ActionResult AjaxLoadGiftCard(FormCollection form)
        {
            string code     = Request["Code"].Trim();
            string password = Request["Password"];

            var temp = GiftCardFacade.LoadGiftCard(code, password);

            if (temp == null)
            {
                return(Json(new
                {
                    Result = false,
                    Message = "卡号或密码错误,请输入正确的卡号和密码"
                }));
            }
            else
            {
                var newTemp = new
                {
                    Code        = temp.Code,
                    EndDate     = temp.EndDate.Value.ToString("yyyy-MM-dd"),
                    AvailAmount = temp.AvailAmount.ToString("F2"),
                    Status      = temp.BindingCustomerSysNo > 0 ? "已绑定" : "未绑定"
                };
                return(Json(new
                {
                    Result = true,
                    Message = newTemp
                }));
            }
        }
Ejemplo n.º 2
0
        public ActionResult AjaxModifyGiftCardPwd(FormCollection form)
        {
            string code        = Request["Code"].Trim();
            string password    = Request["Password"];
            string newPassword = Request["NewPassword"];

            var temp = GiftCardFacade.LoadGiftCard(code, password);

            if (temp == null)
            {
                return(Json(new
                {
                    Result = false,
                    Message = "卡号或密码错误,请输入正确的卡号和密码"
                }));
            }
            else if (temp.EndDate < DateTime.Now)
            {
                return(Json(new
                {
                    Result = false,
                    Message = "礼品卡已过期,不能修改密码"
                }));
            }
            else if ((temp.BindingCustomerSysNo > 0 && temp.BindingCustomerSysNo != CurrUser.UserSysNo) || (temp.BindingCustomerSysNo == 0 && temp.CustomerSysNo != CurrUser.UserSysNo))
            {
                return(Json(new
                {
                    Result = false,
                    Message = "礼品卡未绑定或不属于此帐号,不能修改密码"
                }));
            }
            else
            {
                GiftCardFacade.ModifyGiftCardPwd(code, newPassword);
                return(Json(new
                {
                    Result = true,
                    Message = "礼品卡密码修改成功"
                }));
            }
        }
Ejemplo n.º 3
0
        public ActionResult AjaxBindGiftCard(FormCollection form)
        {
            string code     = Request["Code"].Trim();
            string password = Request["Password"];

            var temp = GiftCardFacade.LoadGiftCard(code, password);

            if (temp == null)
            {
                return(Json(new
                {
                    Result = false,
                    Message = "卡号或密码错误,请输入正确的卡号和密码"
                }));
            }
            else if (temp.BindingCustomerSysNo > 0)
            {
                return(Json(new
                {
                    Result = false,
                    Message = "礼品卡已经被绑定,不能重复绑定"
                }));
            }
            else if (temp.EndDate < DateTime.Now)
            {
                return(Json(new
                {
                    Result = false,
                    Message = "礼品卡已过期,不能绑定"
                }));
            }
            else
            {
                GiftCardFacade.BindGiftCard(code, this.CurrUser.UserSysNo);
                return(Json(new
                {
                    Result = true,
                    Message = "礼品卡绑定成功"
                }));
            }
        }