protected void Button1_Click(object sender, EventArgs e) { string title = Request.Form["title1"]; string address = Request.Form["address"]; string openModel = Request.Form["openModel"]; string width = Request.Form["width"]; string height = Request.Form["height"]; string params1 = Request.Form["Params"]; string note = Request.Form["note"]; string useMember = Request.Form["UseMember"]; string type = Request.Form["type"]; bool isAdd = false; string oldXML = string.Empty; if (appLibrary == null) { isAdd = true; appLibrary = new RoadFlow.Data.Model.AppLibrary(); appLibrary.ID = Guid.NewGuid(); } else { oldXML = appLibrary.Serialize(); } appLibrary.Address = address.Trim(); appLibrary.Height = height.ToIntOrNull(); appLibrary.Note = note; appLibrary.OpenMode = openModel.ToInt(); appLibrary.Params = params1; appLibrary.Title = title; appLibrary.Type = type.ToGuid(); appLibrary.Width = width.ToIntOrNull(); if (!useMember.IsNullOrEmpty()) { appLibrary.UseMember = useMember; } else { appLibrary.UseMember = null; } if (isAdd) { bappLibrary.Add(appLibrary); RoadFlow.Platform.Log.Add("添加了应用程序库", appLibrary.Serialize(), RoadFlow.Platform.Log.Types.角色应用); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('添加成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();", true); } else { bappLibrary.Update(appLibrary); RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, appLibrary.Serialize()); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('修改成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();", true); } bappLibrary.UpdateUseMemberCache(appLibrary.ID); bappLibrary.ClearCache(); new RoadFlow.Platform.RoleApp().ClearAllDataTableCache(); }
public string Delete() { RoadFlow.Platform.AppLibrary appLibrary1 = new RoadFlow.Platform.AppLibrary(); string str1 = this.Request.Form["ids"]; StringBuilder stringBuilder = new StringBuilder(); using (TransactionScope transactionScope = new TransactionScope()) { string str2 = str1; char[] chArray = new char[1] { ',' }; foreach (string str3 in str2.Split(chArray)) { Guid test; if (str3.IsGuid(out test)) { RoadFlow.Data.Model.AppLibrary appLibrary2 = appLibrary1.Get(test, false); if (appLibrary2 != null) { stringBuilder.Append(appLibrary2.Serialize()); appLibrary1.Delete(test); new RoadFlow.Platform.AppLibraryButtons1().DeleteByAppID(test); new RoadFlow.Platform.AppLibrarySubPages().DeleteByAppID(test); } } } new RoadFlow.Platform.Menu().ClearAllDataTableCache(); new RoadFlow.Platform.AppLibraryButtons1().ClearCache(); new RoadFlow.Platform.AppLibrarySubPages().ClearCache(); RoadFlow.Platform.Log.Add("删除了一批应用程序库", stringBuilder.ToString(), RoadFlow.Platform.Log.Types.菜单权限, "", "", (RoadFlow.Data.Model.Users)null); transactionScope.Complete(); } return("删除成功!"); }