Example #1
0
        public string DeleteRole(int id, bool isDel)
        {
            Material_Role role = _roleBll.Find(id);

            role.Del_Flag = isDel;
            return(_roleBll.UpdateEntities(new List <Material_Role>()
            {
                role
            }) ? "OK" : "Error");
        }
Example #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"));
        }