RoadFlow2.1 临时演示

Default.aspx.cs 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. namespace WebForm.Platform.OnlineUsers
  8. {
  9. public partial class Default : Common.BasePage
  10. {
  11. protected List<RoadFlow.Data.Model.OnlineUsers> UserList = new List<RoadFlow.Data.Model.OnlineUsers>();
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14. RoadFlow.Platform.OnlineUsers bou = new RoadFlow.Platform.OnlineUsers();
  15. string name = string.Empty;
  16. if (IsPostBack)
  17. {
  18. name = Request.Form["Name"];
  19. if (!Request.Form["ClearAll"].IsNullOrEmpty())
  20. {
  21. bou.RemoveAll();
  22. }
  23. if (!Request.Form["ClearSelect"].IsNullOrEmpty())
  24. {
  25. string userids = Request.Form["checkbox_app"];
  26. if (!userids.IsNullOrEmpty())
  27. {
  28. foreach (string userid in userids.Split(','))
  29. {
  30. Guid uid;
  31. if (userid.IsGuid(out uid))
  32. {
  33. bou.Remove(uid);
  34. }
  35. }
  36. }
  37. }
  38. }
  39. else
  40. {
  41. name = Request.QueryString["Name"];
  42. }
  43. UserList = bou.GetAll();
  44. this.Count.Text = UserList.Count.ToString();
  45. if (!name.IsNullOrEmpty())
  46. {
  47. UserList = UserList.Where(p => p.UserName.IndexOf(name) >= 0).ToList();
  48. }
  49. }
  50. }
  51. }