RoadFlow2.1 临时演示

InstanceList.aspx.cs 3.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. namespace WebForm.Platform.WorkFlowTasks
  8. {
  9. public partial class InstanceList : Common.BasePage
  10. {
  11. protected RoadFlow.Platform.WorkFlowTask bworkFlowTask = new RoadFlow.Platform.WorkFlowTask();
  12. protected RoadFlow.Platform.WorkFlow bworkFlow = new RoadFlow.Platform.WorkFlow();
  13. protected IEnumerable<RoadFlow.Data.Model.WorkFlowTask> taskList;
  14. protected string query = string.Empty;
  15. protected void Page_Load(object sender1, EventArgs e)
  16. {
  17. string title = "";
  18. string flowid = "";
  19. string sender = "";
  20. string date1 = "";
  21. string date2 = "";
  22. string status = "";
  23. string typeid = Request.QueryString["typeid"];
  24. if (IsPostBack)
  25. {
  26. title = Request.Form["Title1"];
  27. flowid = Request.Form["FlowID"];
  28. sender = Request.Form["SenderID"];
  29. date1 = Request.Form["Date1"];
  30. date2 = Request.Form["Date2"];
  31. status = Request.Form["Status"];
  32. }
  33. else
  34. {
  35. title = Request.QueryString["Title"];
  36. flowid = Request.QueryString["FlowID"];
  37. sender = Request.QueryString["SenderID"];
  38. date1 = Request.QueryString["Date1"];
  39. date2 = Request.QueryString["Date2"];
  40. status = Request.QueryString["Status"];
  41. }
  42. string query1 = string.Format("&appid={0}&tabid={1}&title={2}&flowid={3}&sender={4}&date1={5}&date2={6}&status={7}&typeid={8}",
  43. Request.QueryString["appid"], Request.QueryString["tabid"], title.UrlEncode(), flowid, sender, date1, date2, status, typeid);
  44. query = string.Format("{0}&pagesize={1}&pagenumber={2}", query1, Request.QueryString["pagesize"], Request.QueryString["pagenumber"]);
  45. string pager;
  46. List<System.Web.UI.WebControls.ListItem> statusItems = new List<System.Web.UI.WebControls.ListItem>();
  47. statusItems.Add(new System.Web.UI.WebControls.ListItem() { Text = "==全部==", Value = "0", Selected = "0" == status });
  48. statusItems.Add(new System.Web.UI.WebControls.ListItem() { Text = "未完成", Value = "1", Selected = "1" == status });
  49. statusItems.Add(new System.Web.UI.WebControls.ListItem() { Text = "已完成", Value = "2", Selected = "2" == status });
  50. this.Status.Items.AddRange(statusItems.ToArray());
  51. //可管理的流程ID数组
  52. var flows = bworkFlow.GetInstanceManageFlowIDList(RoadFlow.Platform.Users.CurrentUserID, typeid);
  53. List<Guid> flowids = new List<Guid>();
  54. foreach (var flow in flows.OrderBy(p => p.Value))
  55. {
  56. flowids.Add(flow.Key);
  57. }
  58. Guid[] manageFlows = flowids.ToArray();
  59. this.FlowOptions.Text = bworkFlow.GetOptions(flows, typeid, flowid);
  60. taskList = bworkFlowTask.GetInstances(manageFlows, new Guid[] { },
  61. sender.IsNullOrEmpty() ? new Guid[] { } : new Guid[] { sender.Replace(RoadFlow.Platform.Users.PREFIX, "").ToGuid() },
  62. out pager, query1, title, flowid, date1, date2, status.ToInt());
  63. this.Pager.Text = pager;
  64. }
  65. }
  66. }