RoadFlow2.1 临时演示

GetNames.ashx.cs 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace WebForm.Controls.SelectDictionary
  6. {
  7. /// <summary>
  8. /// GetNames 的摘要说明
  9. /// </summary>
  10. public class GetNames : IHttpHandler
  11. {
  12. public void ProcessRequest(HttpContext context)
  13. {
  14. context.Response.ContentType = "text/plain";
  15. string values = context.Request.QueryString["values"] ?? "";
  16. RoadFlow.Platform.Dictionary Dict = new RoadFlow.Platform.Dictionary();
  17. System.Text.StringBuilder sb = new System.Text.StringBuilder();
  18. foreach (string value in values.Split(','))
  19. {
  20. var dict = Dict.Get(value.ToGuid(), true);
  21. if (dict != null)
  22. {
  23. sb.Append(dict.Title);
  24. sb.Append(',');
  25. }
  26. }
  27. context.Response.Write(sb.ToString().TrimEnd(','));
  28. }
  29. public bool IsReusable
  30. {
  31. get
  32. {
  33. return false;
  34. }
  35. }
  36. }
  37. }