RoadFlow2.1 临时演示

GetNote.ashx.cs 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace WebForm.Controls.SelectMember
  6. {
  7. /// <summary>
  8. /// GetNote 的摘要说明
  9. /// </summary>
  10. public class GetNote : IHttpHandler
  11. {
  12. public void ProcessRequest(HttpContext context)
  13. {
  14. context.Response.ContentType = "text/plain";
  15. string id = context.Request.QueryString["id"];
  16. Guid gid;
  17. if (id.IsNullOrEmpty())
  18. {
  19. context.Response.Write("");
  20. }
  21. RoadFlow.Platform.Organize borg = new RoadFlow.Platform.Organize();
  22. RoadFlow.Platform.Users buser = new RoadFlow.Platform.Users();
  23. if (id.StartsWith(RoadFlow.Platform.Users.PREFIX))
  24. {
  25. Guid uid = buser.RemovePrefix1(id).ToGuid();
  26. context.Response.Write(string.Concat(borg.GetAllParentNames(buser.GetMainStation(uid)), " / ", buser.GetName(uid)));
  27. }
  28. else if (id.StartsWith(RoadFlow.Platform.WorkGroup.PREFIX))
  29. {
  30. context.Response.Write(new RoadFlow.Platform.WorkGroup().GetUsersNames(RoadFlow.Platform.WorkGroup.RemovePrefix(id).ToGuid(), '、'));
  31. }
  32. else if (id.IsGuid(out gid))
  33. {
  34. context.Response.Write(borg.GetAllParentNames(gid));
  35. }
  36. context.Response.Write("");
  37. }
  38. public bool IsReusable
  39. {
  40. get
  41. {
  42. return false;
  43. }
  44. }
  45. }
  46. }