Esempio n. 1
0
        public ActionResult AjaxSendValidateCellphoneByCode(FormCollection form)
        {
            string cell = Request["CellPhoneNumber"].ToString();

            if (!string.IsNullOrEmpty(cell))
            {
                //判断手机号码是否被验证过
                if (CustomerFacade.PhoneIsValidate(cell))
                {
                    return(Json("此手机号码已经被验证过,不能进行重复验证", JsonRequestBehavior.AllowGet));
                }
                CellPhoneConfirm item = new CellPhoneConfirm();
                item.CustomerSysNo = CurrUser.UserSysNo;
                item.CellPhone     = cell;

                string code = VerifyImage.CreateRandomNumber();

                item.ConfirmKey = code;
                int CellPhoneSysNo = CustomerFacade.CreateCellPhoneConfirm(item).SysNo;
                if (CellPhoneSysNo > 0)
                {
                    return(Json("s", JsonRequestBehavior.AllowGet));
                }

                if (CellPhoneSysNo == -99999)
                {
                    return(Json("同一个IP地址24小时内只能请求验证码10次,同一个手机号码请求验证码5次。", JsonRequestBehavior.AllowGet));
                }
                return(Json("服务器忙,稍后重试", JsonRequestBehavior.AllowGet));
            }
            return(Json("服务器忙,稍后重试", JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public ActionResult AjaxSendValidateCellphoneByCode(FormCollection form)
        {
            //return Json("s", JsonRequestBehavior.AllowGet);
            string validatedCode = Request["ValidateCode"].ToString();

            if (CookieHelper.GetCookie <String>("VerifyCode").ToLower() != validatedCode.ToLower())
            {
                return(Json(new JsonResult()
                {
                    ContentType = "验证码不正确", Data = ""
                }, JsonRequestBehavior.AllowGet));
            }


            string cell = Request["CellPhoneNumber"].ToString();

            if (!string.IsNullOrEmpty(cell))
            {
                //判断手机号码是否被验证过
                //if (CustomerFacade.PhoneIsValidate(cell))
                //{
                //    return Json(new JsonResult(){ContentType="此手机号码已经被验证过,不能进行重复验证"} , JsonRequestBehavior.AllowGet);
                //}
                CellPhoneConfirm item = new CellPhoneConfirm();
                item.CustomerSysNo = 0;
                item.CellPhone     = cell;

                string code = VerifyImage.CreateRandomNumber();

                item.ConfirmKey = code;
                int CellPhoneSysNo = CustomerFacade.CreateCellPhoneConfirm(item).SysNo;
                if (CellPhoneSysNo > 0)
                {
                    return(Json(new JsonResult()
                    {
                        ContentType = "s", Data = CellPhoneSysNo
                    }, JsonRequestBehavior.AllowGet));
                }
                if (CellPhoneSysNo == -99999)
                {
                    return(Json(new JsonResult()
                    {
                        ContentType = "同一个IP地址24小时内只能请求验证码10次,同一个手机号码请求验证码5次。"
                    }, JsonRequestBehavior.AllowGet));
                }
                return(Json(new JsonResult()
                {
                    ContentType = "服务器忙,稍后重试"
                }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new JsonResult()
            {
                ContentType = "服务器忙,稍后重试"
            }, JsonRequestBehavior.AllowGet));
        }