RoadFlow2.1 临时演示

GetJSON.ashx.cs 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace WebForm.Platform.WorkFlowDesigner
  6. {
  7. /// <summary>
  8. /// GetJSON 的摘要说明
  9. /// </summary>
  10. public class GetJSON : IHttpHandler
  11. {
  12. public void ProcessRequest(HttpContext context)
  13. {
  14. context.Response.ContentType = "text/plain";
  15. string flowid = context.Request.QueryString["flowid"];
  16. string type = context.Request.QueryString["type"];
  17. if (!flowid.IsGuid())
  18. {
  19. context.Response.Write("{}");
  20. return;
  21. }
  22. var flow = new RoadFlow.Platform.WorkFlow().Get(flowid.ToGuid());
  23. if (flow == null)
  24. {
  25. context.Response.Write("{}");
  26. }
  27. else
  28. {
  29. context.Response.Write("0" == type ? flow.RunJSON : flow.DesignJSON);
  30. }
  31. }
  32. public bool IsReusable
  33. {
  34. get
  35. {
  36. return false;
  37. }
  38. }
  39. }
  40. }