{ /// <summary> /// 在每个页面加载时判断用户访问该页面的权限 /// </summary> /// <param name="e"></param> protected override void OnPreLoad(EventArgs e) { base.OnPreLoad(e); if (!string.IsNullOrEmpty(User.Identity.Name)) { tb_Mem_Member currentUser = BizMember.GetMemberByID(long.Parse(User.Identity.Name)); tb_Pages currentPage = BizPage.GetPageByTitle(this.Title); if (!BALPermission.ValidateMemberPagePermission(currentUser, currentPage)) { Response.Redirect("~/Common/Aspx/ErrorPage.aspx"); } } else { Response.Redirect("~/Login.aspx"); } }
/// <summary> /// 更改密码 /// </summary> /// <param name="id">员工ID</param> /// <param name="newpw">新密码</param> public void ChangPw(long id, string newpw) { member = BizMember.GetMemberByID(id); member.MemLogPas = BizMember.Hash(newpw, id); DataContext.SaveChanges(); }