public ActionResult RQKosBranch(string id, string verb) { RQKosModel model = GetModel(!string.IsNullOrEmpty(id) ? id : RQKosModel.GetActiveModelID()); if (Mvc5RQ.Helpers.AccessRightsResolver.HasAddAccess()) { ViewBag.AccessRights = "EDITOR"; } ViewBag.locPath = HttpContext.Request.QueryString.Get("p"); ViewBag.docNo = HttpContext.Request.QueryString.Get("d"); if (string.IsNullOrEmpty(ViewBag.locPath) && string.IsNullOrEmpty(ViewBag.docNo)) { if (HttpContext.Request.Cookies.Get("dynatree-active") != null) { string cc = HttpUtility.UrlDecode(HttpContext.Request.Cookies.Get("dynatree-active").Value); if (!string.IsNullOrEmpty(cc)) { model = GetModel(cc.Substring(0, cc.IndexOf('$'))); } } } if (string.IsNullOrEmpty(ViewBag.docNo)) { ViewBag.docNo = RQKosModel.GetActiveDocumentID(); } if (string.IsNullOrEmpty(ViewBag.locPath)) { ViewBag.locPath = new RQLib.RQKos.Classifications.SubjClass(model.RQKosSet.GetItem(0)._class.ClassID, model.RQKosSet.GetItem(0)._class.ClassDataClient).ClassPath; } ViewBag.HasAddPermit = Mvc5RQ.Helpers.AccessRightsResolver.HasAddAccess(); // Enable the add new button if user is allowed to add RQItems to the database. ViewBag.GetRQItemVerb = "BrowseItem"; // Tell GetRQItem() in ResultViewer the appropiate verb for saving the user state. return(View("Index", model.RQKosSet)); }
public ActionResult RQKosBranch(string id, string verb) { if (MvcRQ.Helpers.AccessRightsResolver.HasAddAccess()) { ViewBag.AccessRights = "EDITOR"; } if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "edit"))) { if (ViewBag.AccessRights == "EDITOR") { ViewBag.RQKosId = id; return(View("ClientRQKosEditor", new RQKosEditModel(id).RQKosEditSet)); } else { throw new System.AccessViolationException(RQResources.Views.Shared.SharedStrings.err_not_authorized); } } else if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "dt"))) { return(View("Index", GetModel(id, verb).RQKosSet)); } else { RQKosModel model = GetModel(!string.IsNullOrEmpty(id)? id : RQKosModel.GetActiveModelID()); ViewBag.locPath = HttpContext.Request.QueryString.Get("p"); ViewBag.docNo = HttpContext.Request.QueryString.Get("d"); if (string.IsNullOrEmpty(ViewBag.locPath) && string.IsNullOrEmpty(ViewBag.docNo)) { if (HttpContext.Request.Cookies.Get("dynatree-active") != null) { string cc = HttpUtility.UrlDecode(HttpContext.Request.Cookies.Get("dynatree-active").Value); if (!string.IsNullOrEmpty(cc)) { model = GetModel(cc.Substring(0, cc.IndexOf('$'))); } } } if (string.IsNullOrEmpty(ViewBag.docNo)) { ViewBag.docNo = RQKosModel.GetActiveDocumentID(); } if (string.IsNullOrEmpty(ViewBag.locPath)) { ViewBag.locPath = new RQLib.RQKos.Classifications.SubjClass(model.RQKosSet.GetItem(0)._class.ClassID, model.RQKosSet.GetItem(0)._class.ClassDataClient).ClassPath; } ViewBag.HasAddPermit = MvcRQ.Helpers.AccessRightsResolver.HasAddAccess(); // Enable the add new button if user is allowed to add RQItems to the database. ViewBag.GetRQItemVerb = "BrowseItem"; // Tell GetRQItem() in ResultViewer the appropiate verb for saving the user state. return(View("Index", model.RQKosSet)); } }