WorkflowPackageReport.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 WorkflowPackageReport.
  15. /// </summary>
  16.     public partial class WorkflowPackageReport : WorkflowReportBase
  17. {
  18. protected void Page_Load(object sender, System.EventArgs e)
  19. {
  20.             this.OriginatorSelector.SelectUserUrl = PageName_SelectUser;
  21.             this.OriginatorSelector.SelectUserImageUrl = PageName_SelectUserImage;
  22. if(!this.IsPostBack)
  23. {
  24.                 // 验证是否具有管理员权限
  25.                 if (!this.UserValidator.ValidateViewReport())
  26.                 {
  27.                     this.NotifyMessage(LackOfAuth);
  28.                 }
  29. // 设置默认的搜索时间
  30. System.DateTime today = System.DateTime.Now;
  31. System.DateTime tomorrow = today.Add(new System.TimeSpan(1, 0, 0, 0, 0));
  32. this.txtFromTime.Text = today.ToShortDateString();
  33. this.txtToTime.Text = tomorrow.ToShortDateString();
  34.                 string[] catalogs = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflowPackages();
  35. // 添加一空元素表示全部
  36. this.lstWorkflowPackage.Items.Add(NullItemValue);
  37. foreach(string catalog in catalogs)
  38. {
  39. this.lstWorkflowPackage.Items.Add(catalog);
  40. }
  41. }
  42. }
  43. protected override string ReportTableSessionName
  44. {
  45. get
  46. {
  47. return OThinker.H3.WorkSheet.Sessions.GetWorkflowPackagePerformance();
  48. }
  49. }
  50. #region Web Form Designer generated code
  51. override protected void OnInit(EventArgs e)
  52. {
  53. //
  54. // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  55. //
  56. InitializeComponent();
  57. base.OnInit(e);
  58. }
  59. /// <summary>
  60. /// Required method for Designer support - do not modify
  61. /// the contents of this method with the code editor.
  62. /// </summary>
  63. private void InitializeComponent()
  64. {    
  65. this.btnQuery.Click += new System.Web.UI.ImageClickEventHandler(this.btnQuery_Click);
  66. this.btnExport.Click += new System.Web.UI.ImageClickEventHandler(this.btnExport_Click);
  67. }
  68. #endregion
  69. private void btnQuery_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  70. {
  71. this.Query();
  72. }
  73. protected void lnkQuery_Click(object sender, System.EventArgs e)
  74. {
  75. this.Query();
  76. }
  77. protected void btnExport_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  78. {
  79. this.Export();
  80. }
  81. protected void lnkExport_Click(object sender, System.EventArgs e)
  82. {
  83. this.Export();
  84. }
  85. private void Query()
  86. {
  87. string selectedCatalog = this.ParseWorkflowPackage(this.lstWorkflowPackage.SelectedValue);
  88. System.DateTime from = this.ParseFromTime(this.txtFromTime.Text);
  89. System.DateTime to = this.ParseToTime(this.txtToTime.Text);
  90. // 获得发起人
  91. string[] originators = this.ParseOriginators(this.OriginatorSelector.SelectedUser);
  92. // 设置查询的结果表
  93. this.ReportTable = this.CreatePerformanceTable();
  94. if(selectedCatalog == null)
  95. {
  96.                 string[] catalogs = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflowPackages();
  97. if(catalogs != null)
  98. {
  99. foreach(string catalog in catalogs)
  100. {
  101. this.GetPerformance(
  102. this.ReportTable, 
  103. catalog, 
  104. null, 
  105. OThinker.H3.WorkflowTemplate.WorkflowTemplate.AllWorkflowVersion, 
  106. originators, 
  107. from, 
  108. to);
  109. }
  110. }
  111. }
  112. else
  113. {
  114. this.GetPerformance(
  115. this.ReportTable, 
  116. selectedCatalog, 
  117. null, 
  118. OThinker.H3.WorkflowTemplate.WorkflowTemplate.AllWorkflowVersion, 
  119. originators, 
  120. from, 
  121. to);
  122. }
  123. this.PerformanceGrid.DataSource = this.ReportTable;
  124. this.PerformanceGrid.DataBind();
  125. }
  126. }
  127. }