public JsonResult GetSubjectByDepartment(int DepartmentID) { DepartmentInfo info = DepartmentBLL.GetList(a => a.ID == DepartmentID).FirstOrDefault(); if (null == info) { return(Json(new APIJson(-1, "请选择学校"))); } var listSubject = info.DepartmentTypeInfo .SelectMany(a => a.SubjectInfo) .Distinct(); if (!PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.查看所有学科)) { var CurrentUserListSubjectID = CurrentUser.SubjectInfo.Select(a => a.ID); listSubject = listSubject.Where(a => CurrentUserListSubjectID.Contains(a.ID)); } var result = listSubject.OrderBy(a => a.Name).Select(a => new { a.ID, a.Name }); return(Json(new APIJson(0, "", result))); }
public ActionResult Pwd(UserInfo info) { info.PassWord = Function.GetRequestString("PwdNew"); UserInfo infoCurrent = UserBLL.GetCurrent(); infoCurrent = UserBLL.GetList(p => p.ID == infoCurrent.ID).FirstOrDefault(); if (info.ID != infoCurrent.ID) { return(Json(new APIJson(-1, "数据错误"))); } string PwdOld = Function.GetRequestString("PwdOld"); if (!PowerActionBLL.PowerCheck(PowerInfo.P_系统管理.PP系统帐户管理.PPP用户管理.重置任意人员密码)) { if (Tool.Md5Helper.Md5(PwdOld) != infoCurrent.PassWord) { return(Json(new APIJson(-1, "原始密码错误"))); } } if (!ValidatePassWord(info)) { return(Json(new APIJson(-1, "密码必需包含数字、字母,并且长度在8到16位"))); } infoCurrent.PassWord = Tool.Md5Helper.Md5(info.PassWord); if (UserBLL.Edit(infoCurrent)) { return(Json(new APIJson(0, "密码修改成功,请使用新密码重新登录。"))); } return(Json(new APIJson(-1, "失败了,请重试"))); }
public ActionResult Index(int page = 1) { infoHead.LeftURL = Url.Action("index", "home"); ViewBag.listUserLecture = UserBLL.GetList(a => true).ToList(); var list = ResearchPlanBLL.GetList(p => p.TypeEnum == (int)SysEnum.ResearchPlanType.个人听课); if (!PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP个人听课.PPP查看所有学校.KEY)) { list = list.Where(a => CurrentUser.DepartmentID == a.DepartmentID); } if (!PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP个人听课.PPP查看所有学科.KEY)) { var listCurrentUserSubjectID = CurrentUser.SubjectInfo.Select(a => a.ID); list = list.Where(a => a.ResearchInfo.Any(r => listCurrentUserSubjectID.Contains(r.SubjectID))); } if (PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP个人听课.PPP仅查看个人被评.KEY) && CurrentUser.ID != DicInfo.AdminID) { list = list.Where(a => a.ResearchInfo.Any(r => r.lectureUserID == CurrentUser.ID)); } if (PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP个人听课.PPP仅查看个人.KEY) && CurrentUser.ID != DicInfo.AdminID) { list = list.Where(a => a.ResearchInfo.Any(r => r.UserID == CurrentUser.ID)); } list = list.OrderByDescending(p => p.DateBegin).ThenByDescending(a => a.ID); IPagedList <ResearchPlanInfo> result = list.ToPagedList(page, PageSize); return(View(result)); }
public ActionResult Index(int page = 1) { SysEnum.RepNormalType RepNormalType = SysEnum.Parse <SysEnum.RepNormalType>(Function.GetRequestString("RepNormalType")); var list = RepResearchNormalBLL.GetList(p => true); list = list.Where(a => a.TypeFlag == (int)RepNormalType); ViewBag.RepNormalType = RepNormalType; string Name = Function.GetRequestString("Name"); DateTime DateBegin = Function.GetRequestDateTime("DateBegin"); DateTime DateEnd = Function.GetRequestDateTime("DateEnd"); if (DateBegin > DicInfo.DateZone) { list = list.Where(a => DbFunctions.DiffDays(a.DateBegin, DateBegin) <= 0); ViewBag.TxtDateBegin = DateBegin.ToString("yyyy-MM-dd"); } if (DateEnd > DicInfo.DateZone) { list = list.Where(a => DbFunctions.DiffDays(a.DateEnd, DateEnd) >= 0); ViewBag.TxtDateEnd = DateEnd.ToString("yyyy-MM-dd"); } switch (RepNormalType) { case SysEnum.RepNormalType.集体调研: if (!PowerActionBLL.PowerCheck(PowerInfo.P_工作信息管理.PP常规.PPP集体调研.查看所有)) { list = list.Where(a => a.CreateUserID == CurrentUser.ID); } break; case SysEnum.RepNormalType.一加三: if (!PowerActionBLL.PowerCheck(PowerInfo.P_工作信息管理.PP常规.PPP一加三.查看所有)) { list = list.Where(a => a.CreateUserID == CurrentUser.ID); } break; case SysEnum.RepNormalType.蹲点: if (!PowerActionBLL.PowerCheck(PowerInfo.P_工作信息管理.PP常规.PPP蹲点.查看所有)) { list = list.Where(a => a.CreateUserID == CurrentUser.ID); } break; case SysEnum.RepNormalType.教研组织: if (!PowerActionBLL.PowerCheck(PowerInfo.P_工作信息管理.PP常规.PPP教研组织.查看所有)) { list = list.Where(a => a.CreateUserID == CurrentUser.ID); } break; default: break; } list = list.OrderByDescending(p => p.ID); IPagedList <RepResearchNormalInfo> result = list.ToPagedList(page, PageSize); return(View(result)); }
private IQueryable <UserInfo> GetDataList() { IQueryable <UserInfo> list = UserBLL.GetList(p => true); int PowerGroupID = Function.GetRequestInt("PowerGroupID"); int DepartmentID = Function.GetRequestInt("DepartmentID"); int EnableStatus = Function.GetRequestInt("EnableStatus"); int SubjectID = Function.GetRequestInt("SubjectID"); string Name = Function.GetRequestString("Name"); if (!PowerActionBLL.PowerCheck(PowerInfo.P_系统管理.PP系统帐户管理.PPP用户管理.查看所有帐户)) { DepartmentID = CurrentUser.DepartmentID; if (!PowerActionBLL.PowerCheck(PowerInfo.P_系统管理.PP系统帐户管理.PPP用户管理.查看当前单位帐户)) { list = list.Where(a => a.ID == CurrentUser.ID); } } if (PowerGroupID > 0) { list = list.Where(p => p.RuleInfo.Any(r => r.ID == PowerGroupID)); ViewBag.DdlPowerGroupID = PowerGroupID; } if (DepartmentID > 0) { list = list.Where(p => p.DepartmentID == DepartmentID); ViewBag.DdlDepartmentID = DepartmentID; } if (EnableStatus > 0) { list = list.Where(p => p.Enable == (EnableStatus == (int)SysEnum.EnableStatus.EnumEnableStatus.启用)); ViewBag.DdlEnableStatus = EnableStatus; } if (!string.IsNullOrEmpty(Name)) { list = list.Where(p => p.Name.Contains(Name) || p.WechatNameNick.Contains(Name) || p.IDCard.Contains(Name) || p.Code.Contains(Name)); ViewBag.TxtName = Name; } if (SubjectID > 0) { list = list.Where(p => p.TypeID == SubjectID); ViewBag.DdlSubjectID = SubjectID; } list = list.OrderByDescending(p => p.Enable) .ThenByDescending(p => p.DepartmentID) .ThenByDescending(p => p.ID); return(list); }
public ActionResult Index(int page = 1) { WechatHeaderInfo infoHead = new WechatHeaderInfo(); infoHead.HeadText = "系统帐户管理"; infoHead.LeftURL = Url.Action("index", "Home"); ViewBag.WechatHeaderInfo = infoHead; GetSelectList(); int RuleID = Function.GetRequestInt("RuleID"); int MemberGroupID = Function.GetRequestInt("MemberGroupID"); int DepartmentID = Function.GetRequestInt("DepartmentID"); string Name = Function.GetRequestString("Name"); var list = UserBLL.GetList(p => true); if (!PowerActionBLL.PowerCheck(PowerInfo.P_系统管理.PP系统帐户管理.PPP用户管理.查看所有帐户)) { DepartmentID = CurrentUser.DepartmentID; if (!PowerActionBLL.PowerCheck(PowerInfo.P_系统管理.PP系统帐户管理.PPP用户管理.查看当前单位帐户)) { list = list.Where(a => a.ID == CurrentUser.ID); } } if (!string.IsNullOrEmpty(Name)) { list = list.Where(p => p.Name.Contains(Name)); ViewBag.TxtName = Name; } if (RuleID > 0) { list = list.Where(p => p.RuleInfo.Any(r => r.ID == RuleID)); ViewBag.DdlRuleID = RuleID; } if (MemberGroupID > 0) { list = list.Where(p => p.MemberGroupInfo.Any(M => M.ID == MemberGroupID)); ViewBag.DdlMemberGroup = MemberGroupID; } if (DepartmentID > 0) { list = list.Where(p => p.DepartmentID == DepartmentID); ViewBag.DdlDepartment = DepartmentID; } list = list.OrderByDescending(p => p.Enable) .ThenByDescending(p => p.DepartmentID) .ThenByDescending(p => p.ID); var result = list.ToPagedList(page, PageSize); return(View(result)); }
/// <summary> /// 学校调研报表 /// </summary> public ActionResult ResearchDepartment(int DepartmentID = 0, int EvalTemplateID = 0) { ViewBag.listEvalTempate = EvalTemplateBLL.GetList(a => true).OrderByDescending(a => a.ID).ToList() .Select(a => new SelectListItem() { Text = a.Name, Value = a.ID.ToString() }); var listDepartment = DepartmentBLL.GetList(a => true); if (!PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.查看所有学校)) { listDepartment = listDepartment.Where(a => a.ID == CurrentUser.DepartmentID); DepartmentID = CurrentUser.DepartmentID; } ViewBag.listDepartment = listDepartment.Select(a => new SelectListItem() { Text = a.Name, Value = a.ID.ToString() }); DateTime DateBegin = Function.GetRequestDateTime("DateBegin"); DateTime DateEnd = Function.GetRequestDateTime("DateEnd"); if (EvalTemplateID <= 0) { EvalTemplateID = EvalTemplateBLL.GetList(a => a.Enable).OrderByDescending(a => a.ID).FirstOrDefault().ID; } ViewBag.infoEvalTemplate = EvalTemplateBLL.GetList(a => a.ID == EvalTemplateID).FirstOrDefault(); ViewBag.DdlEvalTemplateID = EvalTemplateID; var list = ResearchPlanBLL.GetList(a => a.TypeEnum == (int)SysEnum.ResearchPlanType.组织调研); if (DepartmentID > 0) { list = list.Where(a => a.DepartmentID == DepartmentID); ViewBag.DdlDepartmentID = DepartmentID; } if (DateBegin > DicInfo.DateZone) { list = list.Where(a => DbFunctions.DiffDays(a.DateBegin, DateBegin) <= 0); ViewBag.TxtDateBegin = DateBegin.ToString("yyyy-MM-dd"); } if (DateEnd > DicInfo.DateZone) { list = list.Where(a => DbFunctions.DiffDays(a.DateEnd, DateEnd) <= 0); ViewBag.TxtDateEnd = DateEnd.ToString("yyyy-MM-dd"); } return(View(list)); }
protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); if (null != filterContext.Result) { return; } if (filterContext.ActionDescriptor.IsDefined(typeof(AllowAnonymousAttribute), true) || filterContext.ActionDescriptor.ControllerDescriptor.IsDefined(typeof(AllowAnonymousAttribute), true)) { return; } #region 权限校验 if (CurrentUser.Name.ToLower() == "admin") { return; } if (!CurrentUser.Enable) { filterContext.Result = Redirect(Url.Action("PowerLimit", "Error", new { Msg = "您的帐户已被禁用,请联系管理员" })); } string URLShortConsole = URLShort.Replace("/Wechat/", "/MP/"); string URLFullConsole = URLFull.Replace("/Wechat/", "/MP/"); List <PowerActionInfo> CurrentPowerActions = PowerActionBLL.GetList(p => (p.Url.Contains(URLFull) || p.Url.Contains(URLFullConsole)) ).ToList(); if (null == CurrentPowerActions || CurrentPowerActions.Count == 0) { filterContext.Result = Redirect(Url.Action("PowerLimit", "Error", new { Msg = "系统不知道有这样的操作权限" })); return; } bool result = CurrentPowerActions.Any(a => PowerActionBLL.PowerCheck(a, CurrentUser)); if (!result) { filterContext.Result = Redirect(Url.Action("PowerLimit", "Error", new { Msg = "权限不足,用户已被禁止访问" })); return; } #endregion }
public ActionResult ResearchS() { DateTime DateBegin = Function.GetRequestDateTime("DateBegin"); DateTime DateEnd = Function.GetRequestDateTime("DateEnd"); int SubjectID = Function.GetRequestInt("SubjectID"); string Name = Function.GetRequestString("Name"); var listUser = UserBLL.GetList(a => a.Enable); var listResearch = ResearchBLL.GetList(a => true); if (SubjectID > 0) { listUser = listUser.Where(a => a.SubjectInfo.Select(s => s.ID).Contains(SubjectID)); ViewBag.DdlSubject = SubjectID; } if (!string.IsNullOrEmpty(Name)) { listUser = listUser.Where(a => a.Name.Contains(Name) || a.WechatNameNick.Contains(Name)); ViewBag.TxtName = Name; } var listUserFinal = listUser.ToList().Where(a => PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.KEY, a)); if (DateBegin != DicInfo.DateZone) { listResearch = listResearch.Where(a => DbFunctions.DiffDays(a.ResearchPlanInfo.DateBegin, DateBegin) <= 0); ViewBag.TxtDateBegin = DateBegin.ToString("yyyy-MM-dd"); } if (DateEnd != DicInfo.DateZone) { listResearch = listResearch.Where(a => DbFunctions.DiffDays(a.ResearchPlanInfo.DateBegin, DateEnd) >= 0); ViewBag.TxtDateEnd = DateEnd.ToString("yyyy-MM-dd"); } var templistUserFinalIDs = listUserFinal.Select(u => u.ID); listResearch = listResearch.Where(a => templistUserFinalIDs.Contains(a.UserID)); ViewBag.listResearch = listResearch; ViewBag.listUserFinal = listUserFinal; return(View()); }
private void GetSelectList() { ViewBag.listRule = RuleBLL.GetList(a => a.Enable).Select(p => new SelectListItem() { Text = p.Name, Value = p.ID.ToString() }).ToList(); ViewBag.listMemberGroup = MemberGroupBLL.GetList(a => a.Enable).Select(p => new SelectListItem() { Text = p.Name, Value = p.ID.ToString() }).ToList(); IEnumerable <SelectListItem> listDepartmentID = DepartmentBLL.GetList(p => p.Enable == true).Select(p => new SelectListItem { Text = p.Name, Value = p.ID.ToString() }).ToList(); if (!PowerActionBLL.PowerCheck(PowerInfo.P_系统管理.PP系统帐户管理.PPP用户管理.查看所有帐户)) { listDepartmentID = listDepartmentID.Where(a => a.Value == CurrentUser.ToString()); } ViewBag.listDepartment = listDepartmentID; }
public JsonResult GetLectureUser(int DepartmentID, int SubjectID) { DepartmentInfo info = DepartmentBLL.GetList(a => a.ID == DepartmentID).FirstOrDefault(); if (null == info) { return(Json(new APIJson(-1, "请选择学校"))); } var list = UserBLL.GetList(a => a.DepartmentID == DepartmentID && a.SubjectInfo.Any(s => s.ID == SubjectID)); if (PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.仅查看个人被评) && CurrentUser.Name != "admin") { list = list.Where(a => a.ID == CurrentUser.ID); } var result = list.OrderBy(a => a.Name) .Select(a => new { a.ID, a.Name }); return(Json(new APIJson(0, "", result))); }
public ActionResult Index(int page = 1) { infoHead.LeftURL = Url.Action("index", "home"); var list = ResearchPlanBLL.GetList(p => p.TypeEnum == (int)SysEnum.ResearchPlanType.组织调研); if (!PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.查看所有学校)) { if (PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.仅查看个人)) { list = list.Where(a => a.ResearchPlanUserInfo.Select(rpu => rpu.UserID).Contains(CurrentUser.ID)); } else { list = list.Where(a => CurrentUser.DepartmentID == a.DepartmentID); } } list = list.OrderByDescending(p => p.DateBegin).ThenByDescending(a => a.ID); IPagedList <ResearchPlanInfo> result = list.ToPagedList(page, PageSize); return(View(result)); }
/// <summary> /// 学校教师调研报表 /// </summary> public ActionResult ResearchLectureUser() { int DepartmentID = Function.GetRequestInt("DepartmentID"); int SubjectID = Function.GetRequestInt("SubjectID"); int LectureUserID = Function.GetRequestInt("LectureUserID"); int EvalTemplateID = Function.GetRequestInt("EvalTemplateID"); DateTime DateBegin = Function.GetRequestDateTime("DateBegin"); DateTime DateEnd = Function.GetRequestDateTime("DateEnd"); if (EvalTemplateID <= 0) { EvalTemplateID = EvalTemplateBLL.GetList(a => a.Enable).OrderByDescending(a => a.ID).FirstOrDefault().ID; } ViewBag.infoEvalTemplate = EvalTemplateBLL.GetList(a => a.ID == EvalTemplateID).FirstOrDefault(); ViewBag.DdlEvalTemplateID = EvalTemplateID; ViewBag.listEvalTempate = EvalTemplateBLL.GetList(a => true).OrderByDescending(a => a.ID).ToList() .Select(a => new SelectListItem() { Text = a.Name, Value = a.ID.ToString() }); var listDepartment = DepartmentBLL.GetList(a => true); if (!PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.查看所有学校)) { listDepartment = listDepartment.Where(a => a.ID == CurrentUser.DepartmentID); DepartmentID = CurrentUser.DepartmentID; } ViewBag.listDepartment = listDepartment.Select(a => new SelectListItem() { Text = a.Name, Value = a.ID.ToString() }); ViewBag.DdlDepartmentID = DepartmentID; ViewBag.DdlSubjectID = SubjectID; ViewBag.LectureUserID = LectureUserID; if (DateBegin > DicInfo.DateZone) { ViewBag.TxtDateBegin = DateBegin.ToString("yyyy-MM-dd"); } if (DateEnd > DicInfo.DateZone) { ViewBag.TxtDateEnd = DateEnd.ToString("yyyy-MM-dd"); } ViewBag.EvalTemplateID = EvalTemplateID; var listResearch = ResearchBLL.GetList(a => a.UserInfo.SubjectInfo.Any(s => s.ID == a.SubjectID)); if (LectureUserID > 0) { listResearch = listResearch.Where(a => a.lectureUserID == LectureUserID); var infoLectureUser = UserBLL.GetList(a => a.ID == LectureUserID).FirstOrDefault(); if (null != infoLectureUser) { ViewBag.TxtLectureUserID = infoLectureUser.Name; ViewBag.infoLectureUser = infoLectureUser; } } else { listResearch = listResearch.Where(a => false); } return(View(listResearch)); }
public ActionResult index(int PlanID) { infoHead.LeftURL = null == Url ? "" : Url.Action("index", "ResearchPlan", new { GoAction = "index", GoController = "Research" }); ResearchPlanInfo info = ResearchPlanBLL.GetList(p => p.ID == PlanID).FirstOrDefault(); ViewBag.listSubject = info.DepartmentInfo.DepartmentTypeInfo.SelectMany(a => a.SubjectInfo) .Select(p => new SelectListItem() { Text = p.Name, Value = p.ID.ToString() }).ToList(); ViewBag.listLessionNumber = Common.GetListOrderID(); ViewBag.listGrade = Common.EnumToSelectListItem(typeof(SysEnum.LessionGrade)); List <SelectListItem> listClass = new List <SelectListItem>(); for (int i = 1; i < 50; i++) { listClass.Add(new SelectListItem() { Text = i + "班", Value = i + "班" }); } ViewBag.listClass = listClass; ViewBag.infoPlan = info; var listResearch = info.ResearchInfo.Where(a => true); if (!PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.查看所有学科)) { listResearch = listResearch.Where(a => a.UserID == CurrentUser.ID || CurrentUser.SubjectInfo.Select(s => s.ID).Contains(a.SubjectID)); } if (PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.仅查看个人被评) && CurrentUser.Name != "admin") { listResearch = listResearch.Where(a => a.lectureUserID == CurrentUser.ID); } if (PowerActionBLL.PowerCheck(PowerInfo.P_评课管理.PP组织调研.PPP听评课管理.仅查看个人) && CurrentUser.Name != "admin") { listResearch = listResearch.Where(a => a.UserID == CurrentUser.ID); } string GradeS = Function.GetRequestString("GradeS"); string NameS = Function.GetRequestString("NameS"); int SubjectID = Function.GetRequestInt("SubjectID"); if (SubjectID > 0) { listResearch = listResearch.Where(a => a.SubjectID == SubjectID); ViewBag.DdlSubjectID = SubjectID; } if (!string.IsNullOrEmpty(GradeS)) { listResearch = listResearch.Where(a => a.GradeName == GradeS); ViewBag.DdlGradeS = GradeS; } if (!string.IsNullOrEmpty(NameS)) { var listlectureUser = UserBLL.GetList(a => a.DepartmentID == info.DepartmentID && a.Name.Contains(NameS)); listResearch = listResearch.Where(a => listlectureUser.Select(u => u.ID).Contains(a.lectureUserID)); ViewBag.TxtNameS = NameS; } listResearch = listResearch.OrderByDescending(a => a.ID); ViewBag.listResearch = listResearch; return(View()); }