WorkflowPackageReport.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 WorkflowPackageReport.
- /// </summary>
- public partial class WorkflowPackageReport : WorkflowReportBase
- {
- protected void Page_Load(object sender, System.EventArgs e)
- {
- this.OriginatorSelector.SelectUserUrl = PageName_SelectUser;
- this.OriginatorSelector.SelectUserImageUrl = PageName_SelectUserImage;
- if(!this.IsPostBack)
- {
- // 验证是否具有管理员权限
- if (!this.UserValidator.ValidateViewReport())
- {
- this.NotifyMessage(LackOfAuth);
- }
- // 设置默认的搜索时间
- System.DateTime today = System.DateTime.Now;
- System.DateTime tomorrow = today.Add(new System.TimeSpan(1, 0, 0, 0, 0));
- this.txtFromTime.Text = today.ToShortDateString();
- this.txtToTime.Text = tomorrow.ToShortDateString();
- string[] catalogs = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflowPackages();
- // 添加一空元素表示全部
- this.lstWorkflowPackage.Items.Add(NullItemValue);
- foreach(string catalog in catalogs)
- {
- this.lstWorkflowPackage.Items.Add(catalog);
- }
- }
- }
- protected override string ReportTableSessionName
- {
- get
- {
- return OThinker.H3.WorkSheet.Sessions.GetWorkflowPackagePerformance();
- }
- }
- #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()
- {
- this.btnQuery.Click += new System.Web.UI.ImageClickEventHandler(this.btnQuery_Click);
- this.btnExport.Click += new System.Web.UI.ImageClickEventHandler(this.btnExport_Click);
- }
- #endregion
- private void btnQuery_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- this.Query();
- }
- protected void lnkQuery_Click(object sender, System.EventArgs e)
- {
- this.Query();
- }
- protected void btnExport_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- this.Export();
- }
- protected void lnkExport_Click(object sender, System.EventArgs e)
- {
- this.Export();
- }
- private void Query()
- {
- string selectedCatalog = this.ParseWorkflowPackage(this.lstWorkflowPackage.SelectedValue);
- System.DateTime from = this.ParseFromTime(this.txtFromTime.Text);
- System.DateTime to = this.ParseToTime(this.txtToTime.Text);
- // 获得发起人
- string[] originators = this.ParseOriginators(this.OriginatorSelector.SelectedUser);
- // 设置查询的结果表
- this.ReportTable = this.CreatePerformanceTable();
- if(selectedCatalog == null)
- {
- string[] catalogs = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflowPackages();
- if(catalogs != null)
- {
- foreach(string catalog in catalogs)
- {
- this.GetPerformance(
- this.ReportTable,
- catalog,
- null,
- OThinker.H3.WorkflowTemplate.WorkflowTemplate.AllWorkflowVersion,
- originators,
- from,
- to);
- }
- }
- }
- else
- {
- this.GetPerformance(
- this.ReportTable,
- selectedCatalog,
- null,
- OThinker.H3.WorkflowTemplate.WorkflowTemplate.AllWorkflowVersion,
- originators,
- from,
- to);
- }
- this.PerformanceGrid.DataSource = this.ReportTable;
- this.PerformanceGrid.DataBind();
- }
- }
- }