UpdateSystemAcl.aspx.cs
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Collections;
  3. using System.Configuration;
  4. using System.Data;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.HtmlControls;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.WebControls.WebParts;
  11. namespace OThinker.H3.Portal
  12. {
  13.     public partial class UpdateSystemAcl : PortalPage
  14.     {
  15.         private OThinker.H3.Acl.SystemAcl _Acl = null;
  16.         private OThinker.H3.Acl.SystemAcl Acl
  17.         {
  18.             get
  19.             {
  20.                 if (this._Acl == null)
  21.                 {
  22.                     string aclId = this.Request.QueryString[Param_AclID];
  23.                     this._Acl = OThinker.H3.Server.Engine.SystemAclManager.GetSystemAcl(aclId);
  24.                 }
  25.                 return this._Acl;
  26.             }
  27.         }
  28.         protected void Page_Load(object sender, EventArgs e)
  29.         {
  30.             if (!this.IsPostBack)
  31.             {
  32.                 // 验证是否具有管理员权限
  33.                 if (!this.UserValidator.ValidateAdministrator())
  34.                 {
  35.                     this.NotifyMessage(LackOfAuth);
  36.                 }
  37.                 if (this.Acl == null)
  38.                 {
  39.                     this.NotifyMessage("权限控制单元不存在");
  40.                 }
  41.                 this.lblUser.Text = OThinker.H3.Server.Engine.Organization.GetFullName(this.Acl.UserID);
  42.                 this.chkAdministrator.Checked = this.Acl.Administrator;
  43.                 this.chkPublishWorkflow.Checked = this.Acl.PublishWorkflow;
  44.                 this.chkViewReport.Checked = this.Acl.ViewReport;
  45.             }
  46.         }
  47.         protected void btnOk_Click(object sender, EventArgs e)
  48.         {
  49.             this.Acl.Administrator = this.chkAdministrator.Checked;
  50.             this.Acl.PublishWorkflow = this.chkPublishWorkflow.Checked;
  51.             this.Acl.ViewReport = this.chkViewReport.Checked;
  52.             this.Acl.LastModifyTime = System.DateTime.Now;
  53.             this.Acl.ModifyBy = this.UserValidator.UserID;
  54.             OThinker.H3.Server.Engine.SystemAclManager.Update(new OThinker.H3.Acl.SystemAcl[] { this.Acl });
  55.             this.NotifyMessage("更新成功");
  56.         }
  57.     }
  58. }