RoadFlow2.1 临时演示

Default.aspx.cs 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.WorkFlowButtons
  8. {
  9. public partial class Default : Common.BasePage
  10. {
  11. protected IEnumerable<RoadFlow.Data.Model.WorkFlowButtons> workFlowButtonsList;
  12. protected string Query1 = string.Empty;
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. string name = string.Empty;
  16. Query1 = string.Format("&appid={0}&tabid={1}", Request.QueryString["appid"], Request.QueryString["tabid"]);
  17. RoadFlow.Platform.WorkFlowButtons bworkFlowButtons = new RoadFlow.Platform.WorkFlowButtons();
  18. if (IsPostBack)
  19. {
  20. if (!Request.Form["DeleteBut"].IsNullOrEmpty())
  21. {
  22. string ids = Request.Form["checkbox_app"];
  23. foreach (string id in ids.Split(','))
  24. {
  25. Guid bid;
  26. if (!id.IsGuid(out bid))
  27. {
  28. continue;
  29. }
  30. var but = bworkFlowButtons.Get(bid);
  31. if (but != null)
  32. {
  33. bworkFlowButtons.Delete(bid);
  34. RoadFlow.Platform.Log.Add("删除了流程按钮", but.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
  35. }
  36. }
  37. bworkFlowButtons.ClearCache();
  38. }
  39. workFlowButtonsList = bworkFlowButtons.GetAll();
  40. if (!Request.Form["Search"].IsNullOrEmpty())
  41. {
  42. name = Request.Form["Name"];
  43. if (!name.IsNullOrEmpty())
  44. {
  45. workFlowButtonsList = workFlowButtonsList.Where(p => p.Title.IndexOf(name) >= 0);
  46. }
  47. }
  48. }
  49. else
  50. {
  51. workFlowButtonsList = bworkFlowButtons.GetAll();
  52. }
  53. }
  54. }
  55. }