public RedirectToRouteResult Delete() { RoadFlow.Platform.AppLibraryBLL bappLibrary = new RoadFlow.Platform.AppLibraryBLL(); string deleteID = Request.Form["checkbox_app"]; System.Text.StringBuilder delxml = new System.Text.StringBuilder(); foreach (string id in deleteID.Split(',')) { Guid gid; if (id.IsGuid(out gid)) { var app = bappLibrary.Get(gid); if (app != null) { delxml.Append(app.Serialize()); bappLibrary.Delete(gid); } } } RoadFlow.Platform.Log.Add("删除了一批应用程序库", delxml.ToString(), RoadFlow.Platform.Log.Types.角色应用); return(RedirectToAction("List", Common.Tools.GetRouteValueDictionary())); }
public ActionResult Edit(FormCollection collection) { string editID = Request.QueryString["id"]; string type = Request.QueryString["typeid"]; RoadFlow.Platform.AppLibraryBLL bappLibrary = new RoadFlow.Platform.AppLibraryBLL(); RoadFlow.Data.Model.AppLibraryModel appLibrary = null; if (editID.IsGuid()) { appLibrary = bappLibrary.Get(editID.Convert <Guid>()); } bool isAdd = !editID.IsGuid(); string oldXML = string.Empty; if (appLibrary == null) { appLibrary = new RoadFlow.Data.Model.AppLibraryModel(); appLibrary.ID = Guid.NewGuid(); ViewBag.TypeOptions = new RoadFlow.Platform.AppLibraryBLL().GetTypeOptions(type); ViewBag.OpenOptions = new RoadFlow.Platform.DictionaryBLL().GetOptionsByCode("appopenmodel", value: ""); } else { oldXML = appLibrary.Serialize(); ViewBag.TypeOptions = new RoadFlow.Platform.AppLibraryBLL().GetTypeOptions(appLibrary.Type.ToString()); ViewBag.OpenOptions = new RoadFlow.Platform.DictionaryBLL().GetOptionsByCode("appopenmodel", value: appLibrary.OpenMode.ToString()); } if (collection != null) { string title = collection["title"]; string address = collection["address"]; string openModel = collection["openModel"]; string width = collection["width"]; string height = collection["height"]; string params1 = collection["Params"]; string note = collection["note"]; string useMember = collection["UseMember"]; type = collection["type"]; appLibrary.Address = address.Trim(); appLibrary.Height = height.ToIntOrNull(); appLibrary.Note = note; appLibrary.OpenMode = openModel.Convert <int>(); appLibrary.Params = params1; appLibrary.Title = title; appLibrary.Type = type.Convert <Guid>(); 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.角色应用); ViewBag.Script = "alert('添加成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();"; } else { bappLibrary.Update(appLibrary); RoadFlow.Platform.Log.Add("修改了应用程序库", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, appLibrary.Serialize()); ViewBag.Script = "alert('修改成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();"; } //bappLibrary.UpdateUseMemberCache(appLibrary.ID.Value); //bappLibrary.ClearCache(); //new RoadFlow.Platform.RoleApp().ClearAllDataTableCache(); } return(View(appLibrary)); }