예제 #1
0
        public ActionResult BackstageLogin(string username, string password, string validateCode)
        {
            if (validateCode != Session["ValidateCode"].ToString())
            {
                return(Content("验证码错误"));
            }

            Material_Teacher teacher = _teacherBll.GetEntity(m =>
                                                             (m.Teacher_Name == username || m.Teacher_Id == username) && m.Teacher_Password == password && !m.Del_Flag);

            if (teacher == null || teacher.Teacher_Password != password)
            {
                return(Content("用户名或密码错误,请核对"));
            }
            Material_Role_Teacher roleTeacher = _roleTeacherBll.GetEntity(m => m.Teacher_Id == teacher.Teacher_Id);

            if (roleTeacher != null)
            {
                int  roleId  = roleTeacher.Role_Id;
                bool delFlag = _roleBll.Find(roleId).Del_Flag;
                if (teacher == null || delFlag)
                {
                    return(Content("该用户不存在或已被冻结,请先注册"));
                }
            }

            return(Content("OK"));
        }
예제 #2
0
        public ActionResult BeforeLogin(string username, string password)
        {
            Material_Teacher teacher = _teacherBll.GetEntity(m => (m.Teacher_Id == username || m.Teacher_Name == username) && m.Del_Flag == false);

            if (teacher == null || teacher.Teacher_Password != password)
            {
                return(Content("用户名或密码错误,请核对"));
            }
            Material_Role_Teacher roleTeacher = _roleTeacherBll.GetEntity(m => m.Teacher_Id == teacher.Teacher_Id);

            if (roleTeacher != null)
            {
                int  roleId  = roleTeacher.Role_Id;
                bool delFlag = _roleBll.Find(roleId).Del_Flag;
                if (teacher == null || delFlag)
                {
                    return(Content("该用户不存在或已被冻结,请先注册"));
                }
            }

            return(Content(teacher.Teacher_Password != password ? "密码错误,请核对密码" : "OK"));
        }