RoadFlow2.1 临时演示

Body1.aspx.cs 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.UserApp
  8. {
  9. public partial class Body1 : Common.BasePage
  10. {
  11. protected string query = string.Empty;
  12. protected string AppID = string.Empty;
  13. protected string AppTypesOptions = string.Empty;
  14. protected Guid ParentID = Guid.Empty;
  15. protected string name = string.Empty;
  16. protected string type = string.Empty;
  17. protected string appid = string.Empty;
  18. protected string params1 = string.Empty;
  19. protected string ico = string.Empty;
  20. protected void Page_Load(object sender, EventArgs e)
  21. {
  22. query = "&id=" + Request.QueryString["id"] + "&appid=" + Request.QueryString["appid"] + "&roleid=" + Request.QueryString["roleid"] + "&userid=" + Request.QueryString["userid"];
  23. RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
  24. RoadFlow.Platform.RoleApp broleApp = new RoadFlow.Platform.RoleApp();
  25. RoadFlow.Platform.UsersApp buserApp = new RoadFlow.Platform.UsersApp();
  26. RoadFlow.Data.Model.UsersApp usersApp = null;
  27. string id = Request.QueryString["id"];
  28. Guid appID;
  29. if (id.IsGuid(out appID))
  30. {
  31. usersApp = buserApp.Get(appID);
  32. if (usersApp != null)
  33. {
  34. name = usersApp.Title;
  35. type = usersApp.AppID.HasValue ? bappLibrary.GetTypeByID(usersApp.AppID.Value) : "";
  36. appid = usersApp.AppID.ToString();
  37. params1 = usersApp.Params;
  38. ico = usersApp.Ico;
  39. ParentID = usersApp.ParentID;
  40. }
  41. }
  42. if (IsPostBack && usersApp != null)
  43. {
  44. if (!Request.Form["Save"].IsNullOrEmpty())
  45. {
  46. name = Request.Form["Name"];
  47. type = Request.Form["Type"];
  48. appid = Request.Form["AppID"];
  49. params1 = Request.Form["Params"];
  50. ico = Request.Form["Ico"];
  51. string oldXML = usersApp.Serialize();
  52. usersApp.Title = name.Trim();
  53. if (appid.IsGuid())
  54. {
  55. usersApp.AppID = appid.ToGuid();
  56. }
  57. else
  58. {
  59. usersApp.AppID = null;
  60. }
  61. usersApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim();
  62. if (!ico.IsNullOrEmpty())
  63. {
  64. usersApp.Ico = ico;
  65. }
  66. else
  67. {
  68. usersApp.Ico = null;
  69. }
  70. buserApp.Update(usersApp);
  71. buserApp.ClearCache();
  72. RoadFlow.Platform.Log.Add("修改了个人应用", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, usersApp.Serialize());
  73. string refreshID = usersApp.ParentID.ToString();
  74. Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('保存成功!'); parent.frames[0].reLoad('" + refreshID + "')", true);
  75. }
  76. if (!Request.Form["Delete"].IsNullOrEmpty())
  77. {
  78. int i = buserApp.DeleteAndAllChilds(usersApp.ID);
  79. buserApp.ClearCache();
  80. RoadFlow.Platform.Log.Add("删除了个人应用", usersApp.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
  81. string refreshID = usersApp.ParentID.ToString();
  82. var parent = buserApp.Get(usersApp.ParentID);
  83. string page = parent == null ? "Body.aspx" : "Body1.aspx";
  84. Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');window.location='" + page + "?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "&userid=" + Request.QueryString["userid"] + "';", true);
  85. }
  86. }
  87. AppID = appid;
  88. AppTypesOptions = bappLibrary.GetTypeOptions(type);
  89. }
  90. }
  91. }