UpdateWorkflowAcl.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:4k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- namespace OThinker.H3.Portal
- {
- /// <summary>
- /// Summary description for UpdateWorkflowACL.
- /// </summary>
- public partial class UpdateWorkflowAcl : PortalPage
- {
- #region 参数
- private string ACLID
- {
- get
- {
- if(this.Request.QueryString[Param_AclID] == null || this.Request.QueryString[Param_AclID] == "")
- {
- // ERROR,这里应该导到错误页面上
- return OThinker.H3.Acl.Acl.NullObjectID;
- }
- else
- {
- return this.Request.QueryString[Param_AclID];
- }
- }
- }
- #endregion
- protected System.Web.UI.WebControls.CheckBox chkAdminCases;
- protected System.Web.UI.WebControls.CheckBox chkViewCases;
- protected System.Web.UI.WebControls.CheckBox chkViewReport;
- protected System.Web.UI.WebControls.CheckBox chkPublishNewVersion;
- private OThinker.H3.Acl.WorkflowAcl CurrentAcl
- {
- get
- {
- if(this.Session[OThinker.H3.WorkSheet.Sessions.GetWorkflowACL(this.ACLID)] == null)
- {
- this.Session[OThinker.H3.WorkSheet.Sessions.GetWorkflowACL(this.ACLID)] = OThinker.H3.Server.Engine.WorkflowAclManager.GetWorkflowAcl(this.ACLID);
- }
- return (OThinker.H3.Acl.WorkflowAcl)this.Session[OThinker.H3.WorkSheet.Sessions.GetWorkflowACL(this.ACLID)];
- }
- }
- protected void Page_Load(object sender, System.EventArgs e)
- {
- if(!this.IsPostBack)
- {
- // 验证是否具有管理员权限
- if (!this.UserValidator.ValidateAdministrator())
- {
- this.NotifyMessage(LackOfAuth);
- }
- if(this.CurrentAcl == null)
- {
- this.NotifyMessage("Acl不存在");
- }
- else
- {
- this.lblUserAlias.Text = OThinker.H3.Server.Engine.Organization.GetFullName(this.CurrentAcl.UserID);
- this.lblWorkflowPackage.Text = this.CurrentAcl.WorkflowPackage;
- this.lblWorkflowName.Text = this.CurrentAcl.WorkflowName;
- this.chkAdministrator.Checked = this.CurrentAcl.Administrator;
- this.chkCreateInstance.Checked = this.CurrentAcl.CreateInstance;
- // this.chkAdminCases.Checked = this.CurrentACL.AdminAllCases;
- // this.chkPublishNewVersion.Checked = this.CurrentACL.PublishNewVersion;
- // this.chkViewCases.Checked = this.CurrentACL.ViewAllCases;
- // this.chkViewReport.Checked = this.CurrentACL.ViewReport;
- }
- }
- }
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN: This call is required by the ASP.NET Web Form Designer.
- //
- InitializeComponent();
- base.OnInit(e);
- }
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- }
- #endregion
- protected void btnOk_Click(object sender, System.EventArgs e)
- {
- this.CurrentAcl.Administrator = this.chkAdministrator.Checked;
- this.CurrentAcl.CreateInstance = this.chkCreateInstance.Checked;
- // this.CurrentACL.AdminAllCases = this.chkAdminCases.Checked;
- // this.CurrentACL.PublishNewVersion = this.chkPublishNewVersion.Checked;
- // this.CurrentACL.ViewAllCases = this.chkViewCases.Checked;
- // this.CurrentACL.ViewReport = this.chkViewReport.Checked;
- this.CurrentAcl.LastModifyTime = System.DateTime.Now;
- this.CurrentAcl.ModifyBy = this.UserValidator.UserID;
- OThinker.H3.Server.Engine.WorkflowAclManager.Update(new OThinker.H3.Acl.WorkflowAcl[]{this.CurrentAcl});
- this.Response.Redirect(
- PageName_WorkflowAcl + "?" +
- Param_WorkflowPackage + "=" + System.Web.HttpUtility.UrlEncode(this.CurrentAcl.WorkflowPackage) + "&" +
- Param_WorkflowName + "=" + System.Web.HttpUtility.UrlEncode(this.CurrentAcl.WorkflowName));
- }
- protected void btnCancel_Click(object sender, System.EventArgs e)
- {
- this.Response.Redirect(
- PageName_WorkflowAcl + "?" +
- Param_WorkflowPackage + "=" + System.Web.HttpUtility.UrlEncode(this.CurrentAcl.WorkflowPackage) + "&" +
- Param_WorkflowName + "=" + System.Web.HttpUtility.UrlEncode(this.CurrentAcl.WorkflowName));
- }
- }
- }