RoadFlow2.1 临时演示

GetTables.ashx.cs 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. /// GetTables 的摘要说明
  9. /// </summary>
  10. public class GetTables : IHttpHandler
  11. {
  12. public void ProcessRequest(HttpContext context)
  13. {
  14. context.Response.ContentType = "text/plain";
  15. context.Response.Charset = "utf-8";
  16. string connID = context.Request.QueryString["connid"];
  17. if (!connID.IsGuid())
  18. {
  19. context.Response.Write("[]");
  20. }
  21. List<string> tables = new RoadFlow.Platform.DBConnection().GetTables(connID.ToGuid());
  22. System.Text.StringBuilder sb = new System.Text.StringBuilder("[", 1000);
  23. foreach (string table in tables)
  24. {
  25. sb.Append("{\"name\":");
  26. sb.AppendFormat("\"{0}\"", table);
  27. sb.Append("},");
  28. }
  29. context.Response.Write(sb.ToString().TrimEnd(',') + "]");
  30. }
  31. public bool IsReusable
  32. {
  33. get
  34. {
  35. return false;
  36. }
  37. }
  38. }
  39. }