RoadFlow2.1 临时演示

Combox_GetOptions.ashx.cs 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace WebForm.Tests
  6. {
  7. /// <summary>
  8. /// Combox_GetOptions 的摘要说明
  9. /// </summary>
  10. public class Combox_GetOptions : IHttpHandler
  11. {
  12. public void ProcessRequest(HttpContext context)
  13. {
  14. context.Response.ContentType = "text/plain";
  15. string values=context.Request.QueryString["values"];
  16. string xx;
  17. var logs = new RoadFlow.Platform.Log().GetPagerData(out xx, "", "", "", "", "", "");
  18. System.Text.StringBuilder sb = new System.Text.StringBuilder();
  19. foreach (System.Data.DataRow dr in logs.Rows)
  20. {
  21. string selected= (","+values+",").Contains(","+ dr["ID"].ToString()+",", StringComparison.CurrentCultureIgnoreCase)
  22. ?" selected=\"selected\"":"";
  23. sb.AppendFormat("<option value=\"{0}\"{1}>{2}</option>", dr["ID"], selected, dr["Title"]);
  24. }
  25. context.Response.Write(sb.ToString());
  26. }
  27. public bool IsReusable
  28. {
  29. get
  30. {
  31. return false;
  32. }
  33. }
  34. }
  35. }