예제 #1
0
        public ActionResult GetSchoolName(string phone)
        {
            SchoolTeacherBll schoolTeacherBll = new SchoolTeacherBll();
            var result = schoolTeacherBll.GetSchoolTeacherByPhone(phone);

            if (result != null && result.Yoh_SchoolId > 0)
            {
                return(Json(new JsonResponse <string>()
                {
                    State = true, ErrorMsg = "查询成功", Data = result.Bsl_SchoolName
                }));
            }
            return(Json(new JsonSimpleResponse()
            {
                State = false, ErrorMsg = "查询失败"
            }));
        }
예제 #2
0
        public ActionResult FindPwd(string phone, string pwd, string repwd, string code)
        {
            AccountBll       accountBll       = new AccountBll();
            SchoolTeacherBll schoolTeacherBll = new SchoolTeacherBll();
            bool             success          = false;
            string           msg        = "";
            bool             checkCode  = false;
            bool             checkPhone = false;
            bool             checkPwd   = false;
            DtoSchoolTeacher teacher    = null;

            try
            {
                checkCode = SmsCookie.GetSmsCode.Check(phone, code);
            }
            catch (Exception)
            {
                checkCode = false;
            }
            msg = checkCode ? "" : "验证码错误";
            if (checkCode)
            {
                teacher = schoolTeacherBll.GetSchoolTeacherByPhone(phone);
                if (teacher != null)
                {
                    checkPhone = true;
                    checkPwd   = !string.IsNullOrEmpty(pwd) && pwd == repwd;
                    msg        = checkPwd ? "" : "密码错误";
                }
                else
                {
                    msg        = "账号不存在";
                    checkPhone = false;
                }
            }
            if (checkCode && checkPhone && checkPwd)
            {
                success = schoolTeacherBll.UpdatePwd(teacher.Yoh_Id, Encrypt.GetMD5Pwd(pwd));
                msg     = success ? "修改成功" : "修改失败";
            }
            return(Json(new JsonSimpleResponse()
            {
                State = success, ErrorMsg = msg
            }));
        }
예제 #3
0
        public ActionResult BindSchool(string phone)
        {
            StudentApplyBll studentApplyBll = new StudentApplyBll();
            var             result          = studentApplyBll.StudentApply(GetCurrentUser().StudentId, phone);

            if (result)
            {
                SchoolTeacherBll schoolTeacherBll = new SchoolTeacherBll();
                var school = schoolTeacherBll.GetSchoolTeacherByPhone(phone);
                return(Json(new JsonResponse <DtoSchoolTeacher>()
                {
                    State = true, ErrorMsg = "申请成功", Data = school
                }));
            }
            return(Json(new JsonSimpleResponse()
            {
                State = false, ErrorMsg = "申请失败"
            }));
        }