RoadFlow2.1 临时演示

Delete.ashx.cs 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.SessionState;
  6. namespace WebForm.Platform.WorkFlowTasks
  7. {
  8. /// <summary>
  9. /// Delete 的摘要说明
  10. /// </summary>
  11. public class Delete : IHttpHandler, IReadOnlySessionState
  12. {
  13. public void ProcessRequest(HttpContext context)
  14. {
  15. context.Response.ContentType = "text/plain";
  16. string flowid = context.Request.QueryString["flowid1"];
  17. string groupid = context.Request.QueryString["groupid"];
  18. Guid fid, gid;
  19. if (flowid.IsGuid(out fid) && groupid.IsGuid(out gid))
  20. {
  21. System.Text.StringBuilder delxml = new System.Text.StringBuilder();
  22. var tasks = new RoadFlow.Platform.WorkFlowTask().GetTaskList(fid, gid);
  23. foreach (var task in tasks)
  24. {
  25. delxml.Append(task.Serialize());
  26. }
  27. new RoadFlow.Platform.WorkFlowTask().DeleteInstance(fid, gid);
  28. RoadFlow.Platform.Log.Add("管理员删除了流程实例", delxml.ToString(), RoadFlow.Platform.Log.Types.流程相关);
  29. context.Response.Write("删除成功!");
  30. }
  31. else
  32. {
  33. context.Response.Write("参数错误!");
  34. }
  35. }
  36. public bool IsReusable
  37. {
  38. get
  39. {
  40. return false;
  41. }
  42. }
  43. }
  44. }