public ActionResult GetTeacherList(Models.Admin.MSGetUserInfoListIn InModel) { SqlParams sqlParams = new SqlParams(); sqlParams.PageIndex = Converter.TryToInt32(InModel.PageIndex, 1); sqlParams.PageSize = Converter.TryToInt32(InModel.PageSize, sqlParams.PageSize); sqlParams.addUsefulParam("roleId", (int)RoleType.教职工); sqlParams.addUsefulParam("PositionType", InModel.PositionType); sqlParams.addUsefulParam("majorId", InModel.MajorId); sqlParams.addUsefulParam("keyWords", InModel.KeyWords); int allCount = 0; List <Model.Admin.MSUserInfo> userInfoList = BLL.Admin.MSUserInfoBll.GetAllUserInfoList(sqlParams, out allCount); return(Json(new { Rows = userInfoList.Select(u => new { u.UserID, u.UserName, u.RealName, Gender = u.Gender == 0 ? "女" : "男", MajorName = MSDepartmentInfoBll.GetDepartmentNameById(u.MajorID).IfEmptyToString("--"), u.PositionName, }), AllCount = allCount }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetMajorList(string pageIndex, string pageSize, string keyWords) { SqlParams sqlParams = new SqlParams(); sqlParams.PageIndex = Converter.TryToInt32(pageIndex, 1); sqlParams.PageSize = Converter.TryToInt32(pageSize, sqlParams.PageSize); sqlParams.addUsefulParam("keyWords", keyWords); sqlParams.addUsefulParam("DepartmentLevel", (int)Model.DepartmentLevel.专业); int allCount = 0; List <Model.Admin.MSDepartmentInfo> departmentList = BLL.Admin.MSDepartmentInfoBll.GetAllMSDepartmentInfoPageList(sqlParams, out allCount); return(Json(new { Rows = departmentList.Select(d => { Model.Admin.MSUserInfo directiorUser = BLL.Admin.MSUserPositionRelationBll.GetUserByDepartmentIdAndPositionType(d.DepartmentID, (int)Model.PositionType.系主任); return new { d.DepartmentID, d.DepartmentName, ParentName = BLL.Admin.MSDepartmentInfoBll.GetDepartmentNameById(d.ParentID).IfEmptyToString("--"), DirectorName = directiorUser == null ? "--" : directiorUser.RealName, // 系主任 DirectorId = directiorUser == null ? 0 : directiorUser.UserID, // 系主任 }; }), AllCount = allCount }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetAllBaseUserInfoList(Models.Admin.MSGetUserInfoListIn InModel) { SqlParams sqlParams = new SqlParams(); sqlParams.PageIndex = 9999; sqlParams.PageSize = 1; sqlParams.addUsefulParam("roleId", InModel.RoleId); sqlParams.addUsefulParam("majorId", InModel.MajorId); sqlParams.addUsefulParam("classId", InModel.ClassId); sqlParams.addUsefulParam("keyWords", InModel.KeyWords); List <Model.Admin.MSUserInfo> userInfoList = BLL.Admin.MSUserInfoBll.GetAllBaseUserInfoList(sqlParams); return(Json(new { Rows = userInfoList.Select(u => new { u.UserID, u.UserName, u.RealName, }) }, JsonRequestBehavior.AllowGet)); }