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

OA系统

开发平台:

C#

  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Web;
  7. using System.Web.SessionState;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.HtmlControls;
  11. namespace OThinker.H3.Portal
  12. {
  13. /// <summary>
  14. /// Summary description for UpdateWorkflowACL.
  15. /// </summary>
  16. public partial class UpdateWorkflowAcl : PortalPage
  17. {
  18. #region 参数
  19.         private string ACLID
  20. {
  21. get
  22. {
  23. if(this.Request.QueryString[Param_AclID] == null || this.Request.QueryString[Param_AclID] == "")
  24. {
  25. // ERROR,这里应该导到错误页面上
  26. return OThinker.H3.Acl.Acl.NullObjectID;
  27. }
  28. else
  29. {
  30. return this.Request.QueryString[Param_AclID];
  31. }
  32. }
  33. }
  34. #endregion
  35. protected System.Web.UI.WebControls.CheckBox chkAdminCases;
  36. protected System.Web.UI.WebControls.CheckBox chkViewCases;
  37. protected System.Web.UI.WebControls.CheckBox chkViewReport;
  38. protected System.Web.UI.WebControls.CheckBox chkPublishNewVersion;
  39. private OThinker.H3.Acl.WorkflowAcl CurrentAcl
  40. {
  41. get
  42. {
  43. if(this.Session[OThinker.H3.WorkSheet.Sessions.GetWorkflowACL(this.ACLID)] == null)
  44. {
  45.  this.Session[OThinker.H3.WorkSheet.Sessions.GetWorkflowACL(this.ACLID)] = OThinker.H3.Server.Engine.WorkflowAclManager.GetWorkflowAcl(this.ACLID);
  46. }
  47. return (OThinker.H3.Acl.WorkflowAcl)this.Session[OThinker.H3.WorkSheet.Sessions.GetWorkflowACL(this.ACLID)];
  48. }
  49. }
  50. protected void Page_Load(object sender, System.EventArgs e)
  51. {
  52. if(!this.IsPostBack)
  53. {
  54.                 // 验证是否具有管理员权限
  55.                 if (!this.UserValidator.ValidateAdministrator())
  56.                 {
  57.                     this.NotifyMessage(LackOfAuth);
  58.                 }
  59. if(this.CurrentAcl == null)
  60. {
  61.                     this.NotifyMessage("Acl不存在");
  62. }
  63. else
  64. {
  65. this.lblUserAlias.Text = OThinker.H3.Server.Engine.Organization.GetFullName(this.CurrentAcl.UserID);
  66. this.lblWorkflowPackage.Text = this.CurrentAcl.WorkflowPackage;
  67. this.lblWorkflowName.Text = this.CurrentAcl.WorkflowName;
  68. this.chkAdministrator.Checked = this.CurrentAcl.Administrator;
  69. this.chkCreateInstance.Checked = this.CurrentAcl.CreateInstance;
  70. // this.chkAdminCases.Checked = this.CurrentACL.AdminAllCases;
  71. // this.chkPublishNewVersion.Checked = this.CurrentACL.PublishNewVersion;
  72. // this.chkViewCases.Checked = this.CurrentACL.ViewAllCases;
  73. // this.chkViewReport.Checked = this.CurrentACL.ViewReport;
  74. }
  75. }
  76. }
  77. #region Web Form Designer generated code
  78. override protected void OnInit(EventArgs e)
  79. {
  80. //
  81. // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  82. //
  83. InitializeComponent();
  84. base.OnInit(e);
  85. }
  86. /// <summary>
  87. /// Required method for Designer support - do not modify
  88. /// the contents of this method with the code editor.
  89. /// </summary>
  90. private void InitializeComponent()
  91. {    
  92. }
  93. #endregion
  94. protected void btnOk_Click(object sender, System.EventArgs e)
  95. {
  96. this.CurrentAcl.Administrator = this.chkAdministrator.Checked;
  97. this.CurrentAcl.CreateInstance = this.chkCreateInstance.Checked;
  98. // this.CurrentACL.AdminAllCases = this.chkAdminCases.Checked;
  99. // this.CurrentACL.PublishNewVersion = this.chkPublishNewVersion.Checked;
  100. // this.CurrentACL.ViewAllCases = this.chkViewCases.Checked;
  101. // this.CurrentACL.ViewReport = this.chkViewReport.Checked;
  102.             this.CurrentAcl.LastModifyTime = System.DateTime.Now;
  103.             this.CurrentAcl.ModifyBy = this.UserValidator.UserID;
  104. OThinker.H3.Server.Engine.WorkflowAclManager.Update(new OThinker.H3.Acl.WorkflowAcl[]{this.CurrentAcl});
  105. this.Response.Redirect(
  106.                 PageName_WorkflowAcl + "?" + 
  107. Param_WorkflowPackage + "=" + System.Web.HttpUtility.UrlEncode(this.CurrentAcl.WorkflowPackage) + "&" + 
  108. Param_WorkflowName + "=" + System.Web.HttpUtility.UrlEncode(this.CurrentAcl.WorkflowName));
  109. }
  110. protected void btnCancel_Click(object sender, System.EventArgs e)
  111. {
  112. this.Response.Redirect(
  113.                 PageName_WorkflowAcl + "?" + 
  114. Param_WorkflowPackage + "=" + System.Web.HttpUtility.UrlEncode(this.CurrentAcl.WorkflowPackage) + "&" + 
  115. Param_WorkflowName + "=" + System.Web.HttpUtility.UrlEncode(this.CurrentAcl.WorkflowName));
  116. }
  117. }
  118. }