public ActionResult Sort(FormCollection collection) { RoadFlow.Platform.RoleApp broleApp = new RoadFlow.Platform.RoleApp(); List <RoadFlow.Data.Model.RoleApp> roleAppList = new List <RoadFlow.Data.Model.RoleApp>(); string id = Request.QueryString["id"]; var roleApp = broleApp.Get(id.Convert <Guid>()); roleAppList = broleApp.GetChild(roleApp.ParentID); if (collection != null) { string srots = Request.Form["sortapp"]; if (srots.IsNullOrEmpty()) { return(View(roleAppList)); } string[] sortArray = srots.Split(new char[] { ',' }); for (int i = 0; i < sortArray.Length; i++) { Guid guid; if (!sortArray[i].IsGuid(out guid)) { continue; } broleApp.UpdateSort(guid, i + 1); } broleApp.ClearAllDataTableCache(); string rid = roleApp.ParentID.ToString(); ViewBag.Script = "parent.frames[0].reLoad('" + rid + "');"; roleAppList = broleApp.GetChild(roleApp.ParentID); } return(View(roleAppList)); }
protected void Page_Load(object sender, EventArgs e) { RoadFlow.Platform.RoleApp broleApp = new RoadFlow.Platform.RoleApp(); string id = Request.QueryString["id"]; var roleApp = broleApp.Get(id.ToGuid()); //RoleAppList = broleApp.GetChild(roleApp.ParentID); if (IsPostBack) { string srots = Request.Form["sortapp"]; if (srots.IsNullOrEmpty()) { return; } string[] sortArray = srots.Split(new char[] { ',' }); for (int i = 0; i < sortArray.Length; i++) { Guid guid; if (!sortArray[i].IsGuid(out guid)) { continue; } broleApp.UpdateSort(guid, i + 1); } broleApp.ClearAllDataTableCache(); string rid = roleApp.ParentID.ToString(); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + rid + "');", true); } RoleAppList = broleApp.GetChild(roleApp.ParentID); }
public ActionResult AddApp(FormCollection collection) { RoadFlow.Platform.AppLibraryBLL bappLibrary = new RoadFlow.Platform.AppLibraryBLL(); RoadFlow.Platform.RoleApp broleApp = new RoadFlow.Platform.RoleApp(); RoadFlow.Data.Model.RoleApp roleApp = null; string id = Request.QueryString["id"]; if (collection != null) { roleApp = broleApp.Get(id.Convert <Guid>()); if (!Request.Form["Save"].IsNullOrEmpty()) { string name = Request.Form["Name"]; string type = Request.Form["Type"]; string appid = Request.Form["AppID"]; string params1 = Request.Form["Params"]; string ico = Request.Form["Ico"]; RoadFlow.Data.Model.RoleApp roleApp1 = new RoadFlow.Data.Model.RoleApp(); roleApp1.ID = Guid.NewGuid(); roleApp1.ParentID = id.Convert <Guid>(); roleApp1.RoleID = roleApp.RoleID; roleApp1.Title = name.Trim(); roleApp1.ParentID = roleApp.ID; roleApp1.Sort = broleApp.GetMaxSort(roleApp.ID); roleApp1.Type = 0; if (appid.IsGuid()) { roleApp1.AppID = appid.Convert <Guid>(); } else { roleApp1.AppID = null; } roleApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim(); if (!ico.IsNullOrEmpty()) { roleApp1.Ico = ico; } broleApp.Add(roleApp1); broleApp.ClearAllDataTableCache(); RoadFlow.Platform.Log.Add("添加了应用模板", roleApp1.Serialize(), RoadFlow.Platform.Log.Types.角色应用); string refreshID = id; ViewBag.Script = "alert('添加成功');parent.frames[0].reLoad('" + refreshID + "');"; } } ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions(); return(View()); }
protected void Page_Load(object sender, EventArgs e) { RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary(); RoadFlow.Platform.RoleApp broleApp = new RoadFlow.Platform.RoleApp(); RoadFlow.Data.Model.RoleApp roleApp = null; string id = Request.QueryString["id"]; if (IsPostBack) { roleApp = broleApp.Get(id.ToGuid()); if (!Request.Form["Save"].IsNullOrEmpty()) { string name = Request.Form["Name"]; string type = Request.Form["Type"]; string appid = Request.Form["AppID"]; string params1 = Request.Form["Params"]; string ico = Request.Form["Ico"]; RoadFlow.Data.Model.RoleApp roleApp1 = new RoadFlow.Data.Model.RoleApp(); roleApp1.ID = Guid.NewGuid(); roleApp1.ParentID = id.ToGuid(); roleApp1.RoleID = roleApp.RoleID; roleApp1.Title = name.Trim(); roleApp1.ParentID = roleApp.ID; roleApp1.Sort = broleApp.GetMaxSort(roleApp.ID); roleApp1.Type = 0; if (appid.IsGuid()) { roleApp1.AppID = appid.ToGuid(); } else { roleApp1.AppID = null; } roleApp1.Params = params1.IsNullOrEmpty() ? null : params1.Trim(); if (!ico.IsNullOrEmpty()) { roleApp1.Ico = ico; } broleApp.Add(roleApp1); broleApp.ClearAllDataTableCache(); RoadFlow.Platform.Log.Add("添加了应用模板", roleApp1.Serialize(), RoadFlow.Platform.Log.Types.角色应用); string refreshID = id; Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('添加成功');parent.frames[0].reLoad('" + refreshID + "');", true); } } this.AppTypesOptions.Text = bappLibrary.GetTypeOptions(); }
public ActionResult Body(FormCollection collection) { RoadFlow.Platform.AppLibraryBLL bappLibrary = new RoadFlow.Platform.AppLibraryBLL(); RoadFlow.Platform.RoleApp broleApp = new RoadFlow.Platform.RoleApp(); RoadFlow.Data.Model.RoleApp roleApp = null; string id = Request.QueryString["id"]; string name = string.Empty; string type = string.Empty; string appid = string.Empty; string params1 = string.Empty; string ico = string.Empty; Guid appID; if (id.IsGuid(out appID)) { roleApp = broleApp.Get(appID); } if (!Request.Form["Save"].IsNullOrEmpty()) { name = Request.Form["Name"]; type = Request.Form["Type"]; appid = Request.Form["AppID"]; params1 = Request.Form["Params"]; ico = Request.Form["Ico"]; string oldXML = roleApp.Serialize(); roleApp.Title = name.Trim(); if (appid.IsGuid()) { roleApp.AppID = appid.Convert <Guid>(); } else { roleApp.AppID = null; } roleApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim(); if (!ico.IsNullOrEmpty()) { roleApp.Ico = ico; } else { roleApp.Ico = null; } broleApp.Update(roleApp); broleApp.ClearAllDataTableCache(); RoadFlow.Platform.Log.Add("修改了应用模板", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, roleApp.Serialize()); string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString(); ViewBag.Script = "parent.frames[0].reLoad('" + refreshID + "');alert('保存成功!');"; } if (!Request.Form["Delete"].IsNullOrEmpty()) { int i = broleApp.DeleteAndAllChilds(roleApp.ID); broleApp.ClearAllDataTableCache(); RoadFlow.Platform.Log.Add("删除了模板及其所有下级共" + i.ToString() + "项", roleApp.Serialize(), RoadFlow.Platform.Log.Types.角色应用); string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString(); ViewBag.Script = "parent.frames[0].reLoad('" + refreshID + "');window.location='Body?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "';"; } if (roleApp != null && roleApp.AppID.HasValue) { var app = new RoadFlow.Platform.AppLibraryBLL().Get(roleApp.AppID.Value); if (app != null) { type = app.Type.ToString(); } } ViewBag.AppTypesOptions = bappLibrary.GetTypeOptions(type); ViewBag.AppID = roleApp.AppID.ToString(); return(View(roleApp)); }
protected void Page_Load(object sender, EventArgs e) { RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary(); RoadFlow.Platform.RoleApp broleApp = new RoadFlow.Platform.RoleApp(); string id = Request.QueryString["id"]; string name = string.Empty; string type = string.Empty; string appid = string.Empty; string params1 = string.Empty; string ico = string.Empty; Guid appID; if (id.IsGuid(out appID)) { roleApp = broleApp.Get(appID); } if (IsPostBack) { if (!Request.Form["Save"].IsNullOrEmpty()) { name = Request.Form["Name"]; type = Request.Form["Type"]; appid = Request.Form["AppID"]; params1 = Request.Form["Params"]; ico = Request.Form["Ico"]; string oldXML = roleApp.Serialize(); roleApp.Title = name.Trim(); if (appid.IsGuid()) { roleApp.AppID = appid.ToGuid(); } else { roleApp.AppID = null; } roleApp.Params = params1.IsNullOrEmpty() ? null : params1.Trim(); if (!ico.IsNullOrEmpty()) { roleApp.Ico = ico; } else { roleApp.Ico = null; } broleApp.Update(roleApp); broleApp.ClearAllDataTableCache(); RoadFlow.Platform.Log.Add("修改了应用模板", "", RoadFlow.Platform.Log.Types.角色应用, oldXML, roleApp.Serialize()); string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString(); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');alert('保存成功!');", true); } if (!Request.Form["Delete"].IsNullOrEmpty()) { int i = broleApp.DeleteAndAllChilds(roleApp.ID); broleApp.ClearAllDataTableCache(); RoadFlow.Platform.Log.Add("删除了模板及其所有下级共" + i.ToString() + "项", roleApp.Serialize(), RoadFlow.Platform.Log.Types.角色应用); string refreshID = roleApp.ParentID == Guid.Empty ? roleApp.ID.ToString() : roleApp.ParentID.ToString(); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');window.location='Body.aspx?id=" + refreshID + "&appid=" + Request.QueryString["appid"] + "&tabid=" + Request.QueryString["tabid"] + "';", true); } } if (roleApp != null && roleApp.AppID.HasValue) { var app = new RoadFlow.Platform.AppLibrary().Get(roleApp.AppID.Value); if (app != null) { type = app.Type.ToString(); } } if (roleApp != null) { this.Name.Value = roleApp.Title; this.Params.Value = roleApp.Params; this.Ico.Value = roleApp.Ico; } this.AppTypesOptions.Text = bappLibrary.GetTypeOptions(type); AppID = roleApp.AppID.ToString(); }