RoadFlow2.1 临时演示

WorkGroup.aspx.cs 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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.Members
  8. {
  9. public partial class WorkGroup : Common.BasePage
  10. {
  11. protected RoadFlow.Platform.WorkGroup bwg = new RoadFlow.Platform.WorkGroup();
  12. protected string name = string.Empty;
  13. protected string members = string.Empty;
  14. protected string note = string.Empty;
  15. protected string users = string.Empty;
  16. protected void Page_Load(object sender, EventArgs e)
  17. {
  18. string id = Request.QueryString["id"];
  19. Guid wid;
  20. RoadFlow.Data.Model.WorkGroup wg = null;
  21. name = string.Empty;
  22. members = string.Empty;
  23. note = string.Empty;
  24. users = string.Empty;
  25. if (!id.IsGuid(out wid) || wid == Guid.Empty)
  26. {
  27. Response.End();
  28. }
  29. wg = bwg.Get(wid);
  30. if (wg != null)
  31. {
  32. name = wg.Name;
  33. members = wg.Members;
  34. note = wg.Note;
  35. users = bwg.GetUsersNames(wg.Members, '、');
  36. }
  37. if (!Request.Form["Save"].IsNullOrEmpty() && IsPostBack && wg != null)
  38. {
  39. string oldxml = wg.Serialize();
  40. name = Request.Form["Name"];
  41. members = Request.Form["Members"];
  42. note = Request.Form["Note"];
  43. wg.Name = name.Trim();
  44. wg.Members = members;
  45. if (!note.IsNullOrEmpty())
  46. {
  47. wg.Note = note;
  48. }
  49. bwg.Update(wg);
  50. users = bwg.GetUsersNames(wg.Members, '、');
  51. string query = Request.Url.Query;
  52. RoadFlow.Platform.Log.Add("修改了工作组", "修改了工作组", RoadFlow.Platform.Log.Types.组织机构, oldxml, wg.Serialize());
  53. Page.ClientScript.RegisterStartupScript(Page.GetType(), "OK", "alert('保存成功!');", true);
  54. }
  55. //删除
  56. if (!Request.Form["DeleteBut"].IsNullOrEmpty() && IsPostBack && wg != null)
  57. {
  58. string oldxml = wg.Serialize();
  59. bwg.Delete(wg.ID);
  60. string query = Request.Url.Query;
  61. RoadFlow.Platform.Log.Add("删除了工作组", oldxml, RoadFlow.Platform.Log.Types.组织机构);
  62. Page.ClientScript.RegisterStartupScript(Page.GetType(), "OK", "parent.frames[0].treecng('1');alert('删除成功!');window.location = 'Empty.aspx' + '" + query + "';", true);
  63. }
  64. }
  65. }
  66. }