AddWorkflowAcl.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:5k
源码类别:
OA系统
开发平台:
C#
- //===========================================================================
- // This file was modified as part of an ASP.NET 2.0 Web project conversion.
- // The class name was changed and the class modified to inherit from the abstract base class
- // in file 'App_CodeMigratedconsoleStub_addworkflowacl_aspx_cs.cs'.
- // During runtime, this allows other classes in your web application to bind and access
- // the code-behind page using the abstract base class.
- // The associated content page 'consoleaddworkflowacl.aspx' was also modified to refer to the new class name.
- // For more information on this code pattern, please refer to http://go.microsoft.com/fwlink/?LinkId=46995
- //===========================================================================
- 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 AddWorkflowACL.
- /// </summary>
- public partial class AddWorkflowAcl : PortalPage
- {
- #region 参数
- private string GetWorkflowState
- {
- get
- {
- if(this.Request.QueryString[Param_WorkflowPackage] == null || this.Request.QueryString[Param_WorkflowPackage] == "")
- {
- return null;
- }
- else
- {
- return System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowPackage]);
- }
- }
- }
- private string WorkflowName
- {
- get
- {
- if(this.Request.QueryString[Param_WorkflowName] == null || this.Request.QueryString[Param_WorkflowName] == "")
- {
- return null;
- }
- else
- {
- return System.Web.HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowName]);
- }
- }
- }
- #endregion
- protected System.Web.UI.WebControls.CheckBox chkPublishNewVersion;
- protected System.Web.UI.WebControls.CheckBox chkViewReport;
- protected System.Web.UI.WebControls.CheckBox chkViewInstances;
- protected System.Web.UI.WebControls.CheckBox chkAdminInstances;
- protected void Page_Load(object sender, System.EventArgs e)
- {
- this.UserSelector.SelectUserUrl = PageName_SelectUser;
- this.UserSelector.SelectUserImageUrl = PageName_SelectUserImage;
- if(!this.IsPostBack)
- {
- if(!this.UserValidator.ValidateAdministrator())
- {
- this.NotifyMessage(LackOfAuth);
- }
- this.lblWorkflowPackage.Text = this.GetWorkflowState;
- this.lblWorkflowName.Text = this.WorkflowName;
- }
- }
- #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)
- {
- OThinker.H3.Acl.WorkflowAcl acl = new OThinker.H3.Acl.WorkflowAcl();
- string[] users = this.UserSelector.SelectedUsers;
- acl.UserID = (users == null || users.Length == 0) ? null : users[0];
- acl.WorkflowPackage = this.lblWorkflowPackage.Text;
- acl.WorkflowName = this.lblWorkflowName.Text;
- acl.Administrator = this.chkAdministrator.Checked;
- acl.CreateInstance = this.chkCreateInstance.Checked;
- // acl.PublishNewVersion = this.chkPublishNewVersion.Checked;
- // acl.ViewAllInstances = this.chkViewInstances.Checked;
- // acl.ViewReport = this.chkViewReport.Checked;
- // acl.AdminAllInstances = this.chkAdminInstances.Checked;
- acl.CreateBy = this.UserValidator.UserID;
- acl.CreateTime = System.DateTime.Now;
- if(OThinker.H3.Server.Engine.WorkflowAclManager.Add(acl))
- {
- // 添加成功
- this.Response.Redirect(
- PageName_WorkflowAcl + "?" +
- Param_WorkflowPackage + "=" + System.Web.HttpUtility.UrlEncode(this.GetWorkflowState) + "&" +
- Param_WorkflowName + "=" + System.Web.HttpUtility.UrlEncode(this.WorkflowName));
- }
- else
- {
- // 添加不成功
- this.lblError.Text = "添加不成功,请检查:1、是否设置了组织单元/组/用户名;2、该组织单元/组/用户的权限控制单元是否已经存在。";
- }
- }
- protected void btnCancel_Click(object sender, System.EventArgs e)
- {
- // 添加成功
- this.Response.Redirect(
- PageName_WorkflowAcl + "?" +
- Param_WorkflowPackage + "=" + System.Web.HttpUtility.UrlEncode(this.GetWorkflowState) + "&" +
- Param_WorkflowName + "=" + System.Web.HttpUtility.UrlEncode(this.WorkflowName));
- }
- }
- }