RoadFlow2.1 临时演示

TestLineSqlWhere.ashx.cs 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. /// TestLineSqlWhere 的摘要说明
  9. /// </summary>
  10. public class TestLineSqlWhere : IHttpHandler
  11. {
  12. public void ProcessRequest(HttpContext context)
  13. {
  14. context.Response.ContentType = "text/plain";
  15. string connid = context.Request["connid"];
  16. string table = context.Request["table"];
  17. string tablepk = context.Request["tablepk"];
  18. string where = context.Request["where"];
  19. RoadFlow.Platform.DBConnection dbconn = new RoadFlow.Platform.DBConnection();
  20. if (!connid.IsGuid())
  21. {
  22. context.Response.Write("流程未设置数据连接!");
  23. return;
  24. }
  25. var conn = dbconn.Get(connid.ToGuid());
  26. if (conn == null)
  27. {
  28. context.Response.Write("未找到连接!");
  29. return;
  30. }
  31. string sql = "SELECT * FROM " + table + " WHERE 1=1 AND " + where;
  32. if (dbconn.TestSql(conn, sql))
  33. {
  34. context.Response.Write("SQL条件正确!");
  35. return;
  36. }
  37. else
  38. {
  39. context.Response.Write("SQL条件错误!");
  40. return;
  41. }
  42. }
  43. public bool IsReusable
  44. {
  45. get
  46. {
  47. return false;
  48. }
  49. }
  50. }
  51. }