RoadFlow2.1 临时演示

Edit.aspx.cs 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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.AppLibrary
  8. {
  9. public partial class Edit : Common.BasePage
  10. {
  11. RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
  12. RoadFlow.Data.Model.AppLibrary appLibrary = null;
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. string editID = Request.QueryString["id"];
  16. string type = Request.QueryString["typeid"];
  17. if (editID.IsGuid())
  18. {
  19. appLibrary = bappLibrary.Get(editID.ToGuid());
  20. }
  21. if (!IsPostBack)
  22. {
  23. if (appLibrary != null)
  24. {
  25. this.Title1.Value = appLibrary.Title;
  26. this.Address.Value = appLibrary.Address;
  27. this.TypeOptions.Text = new RoadFlow.Platform.AppLibrary().GetTypeOptions(appLibrary.Type.ToString());
  28. this.OpenModelOptions.Text = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel", value: appLibrary.OpenMode.ToString());
  29. this.Params.Value = appLibrary.Params;
  30. this.Width.Value = appLibrary.Width.ToString();
  31. this.Height.Value = appLibrary.Height.ToString();
  32. this.UseMember.Value = appLibrary.UseMember;
  33. this.Note.Value = appLibrary.Note;
  34. }
  35. else
  36. {
  37. this.TypeOptions.Text = new RoadFlow.Platform.AppLibrary().GetTypeOptions("");
  38. this.OpenModelOptions.Text = new RoadFlow.Platform.Dictionary().GetOptionsByCode("appopenmodel");
  39. }
  40. }
  41. }
  42. protected void Button1_Click(object sender, EventArgs e)
  43. {
  44. string title = Request.Form["title1"];
  45. string address = Request.Form["address"];
  46. string openModel = Request.Form["openModel"];
  47. string width = Request.Form["width"];
  48. string height = Request.Form["height"];
  49. string params1 = Request.Form["Params"];
  50. string note = Request.Form["note"];
  51. string useMember = Request.Form["UseMember"];
  52. string type = Request.Form["type"];
  53. bool isAdd = false;
  54. string oldXML = string.Empty;
  55. if (appLibrary == null)
  56. {
  57. isAdd = true;
  58. appLibrary = new RoadFlow.Data.Model.AppLibrary();
  59. appLibrary.ID = Guid.NewGuid();
  60. }
  61. else
  62. {
  63. oldXML = appLibrary.Serialize();
  64. }
  65. appLibrary.Address = address.Trim();
  66. appLibrary.Height = height.ToIntOrNull();
  67. appLibrary.Note = note;
  68. appLibrary.OpenMode = openModel.ToInt();
  69. appLibrary.Params = params1;
  70. appLibrary.Title = title;
  71. appLibrary.Type = type.ToGuid();
  72. appLibrary.Width = width.ToIntOrNull();
  73. if (!useMember.IsNullOrEmpty())
  74. {
  75. appLibrary.UseMember = useMember;
  76. }
  77. else
  78. {
  79. appLibrary.UseMember = null;
  80. }
  81. if (isAdd)
  82. {
  83. bappLibrary.Add(appLibrary);
  84. RoadFlow.Platform.Log.Add("添加了应用程序库", appLibrary.Serialize(), RoadFlow.Platform.Log.Types.角色应用);
  85. Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('添加成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();", true);
  86. }
  87. else
  88. {
  89. bappLibrary.Update(appLibrary);
  90. RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, appLibrary.Serialize());
  91. Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('修改成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();", true);
  92. }
  93. bappLibrary.UpdateUseMemberCache(appLibrary.ID);
  94. bappLibrary.ClearCache();
  95. new RoadFlow.Platform.RoleApp().ClearAllDataTableCache();
  96. }
  97. }
  98. }