MyWorkItem2.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:6k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- namespace OThinker.H3.Portal
- {
- public partial class MyWorkItem2 : PortalPage
- {
- protected DataTable WorkItemTable
- {
- get
- {
- return (DataTable)Session[OThinker.H3.WorkSheet.Sessions.GetMyWorkItemTable()];
- }
- set
- {
- Session[OThinker.H3.WorkSheet.Sessions.GetMyWorkItemTable()] = value;
- }
- }
- protected OThinker.H3.WorkItem.WorkItemState State
- {
- get
- {
- string strState = this.Request.QueryString[Param_State];
- if (strState == null || strState == "")
- {
- return OThinker.H3.WorkItem.WorkItemState.Unspecified;
- }
- else
- {
- return OThinker.H3.WorkItem.WorkItemStateConvertor.ToState(strState);
- }
- }
- }
- private OThinker.Data.BoolMatchValue Approval
- {
- get
- {
- string strApproval = this.Request.QueryString[Param_Approval];
- if (strApproval == null || strApproval == "")
- {
- return OThinker.Data.BoolMatchValue.Unspecified;
- }
- else
- {
- try
- {
- return (OThinker.Data.BoolMatchValue)Enum.Parse(typeof(OThinker.Data.BoolMatchValue), strApproval);
- }
- catch
- {
- return OThinker.Data.BoolMatchValue.Unspecified;
- }
- }
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!this.IsPostBack)
- {
- // 工作流模板的包
- string[] packages = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflowPackages();
- this.lstWorkflowPackage.Items.Add(new ListItem("所有", "All"));
- if (packages != null)
- {
- foreach (string package in packages)
- {
- this.lstWorkflowPackage.Items.Add(package);
- }
- }
- this.lstWorkflowPackage_SelectedIndexChanged(this, new EventArgs());
- // 设置搜索日期
- this.StartTime.TimeValue = System.DateTime.Now.Subtract(new TimeSpan(7, 0, 0, 0));
- this.EndTime.TimeValue = System.DateTime.Now.AddDays(1);
- // 搜索默认的工作项表
- this.WorkItemTable = Query.QueryWorkItem(
- null,
- null,
- OThinker.H3.WorkflowTemplate.WorkflowTemplate.NullWorkflowVersion,
- null,
- null,
- this.UserValidator.Delegants2,
- System.DateTime.MinValue,
- System.DateTime.MaxValue,
- this.State,
- OThinker.H3.Instance.PriorityType.Unspecified,
- null,
- null,
- this.Approval,
- OThinker.Data.BoolMatchValue.Unspecified);
- }
- this.WorkItemGrid.BindDataGrid(this.WorkItemTable);
- }
- protected void lstWorkflowPackage_SelectedIndexChanged(object sender, EventArgs e)
- {
- this.lstWorkflowName.Items.Clear();
- this.lstWorkflowName.Items.Add(new ListItem("所有", "All"));
- if (this.lstWorkflowPackage.SelectedItem != null)
- {
- string selectedPackage = this.lstWorkflowPackage.SelectedItem.Value;
- if (selectedPackage != null && selectedPackage != "" && selectedPackage != "All")
- {
- string[] names = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflowNames(selectedPackage, OThinker.H3.WorkflowTemplate.WorkflowState.Active);
- if (names != null)
- {
- foreach (string name in names)
- {
- this.lstWorkflowName.Items.Add(name);
- }
- }
- }
- }
- }
- protected void btnSearch_Click(object sender, EventArgs e)
- {
- // 工作流模板参数
- string workflowPackage = null;
- string workflowName = null;
- if (this.lstWorkflowPackage.SelectedItem.Value == "All")
- {
- }
- else
- {
- workflowPackage = this.lstWorkflowPackage.SelectedItem.Value;
- if (this.lstWorkflowName.SelectedItem.Value == "All")
- {
- }
- else
- {
- workflowName = this.lstWorkflowName.SelectedItem.Value;
- }
- }
- // 时间
- System.DateTime startTime = System.DateTime.MinValue;
- System.DateTime endTime = System.DateTime.MaxValue;
- try
- {
- startTime = this.StartTime.TimeValue;
- }
- catch
- {
- }
- try
- {
- endTime = System.DateTime.Parse(this.EndTime.Text);
- }
- catch
- {
- }
- // 查找
- this.WorkItemTable = Query.QueryWorkItem(
- workflowPackage,
- workflowName,
- WorkflowTemplate.WorkflowTemplate.NullWorkflowVersion,
- null,
- null,
- this.UserValidator.Delegants2,
- startTime,
- endTime,
- this.State,
- OThinker.H3.Instance.PriorityType.Unspecified,
- this.txtName.Text.Trim(),
- null,
- this.Approval,
- OThinker.Data.BoolMatchValue.Unspecified);
- this.WorkItemGrid.BindDataGrid(this.WorkItemTable);
- }
- }
- }