Пример #1
0
        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));
        }
Пример #2
0
        public ActionResult RQKosLD(string id)
        {
            RQKosModel model = GetModel(id, "rqld");

            if ((ViewBag.locPath == null) || (ViewBag.locPath == ""))
            {
                ViewBag.locPath = new RQLib.RQKos.Classifications.SubjClass(model.RQKosSet.GetItem(0)._class.ClassID, model.RQKosSet.GetItem(0)._class.ClassDataClient).ClassPath;
            }
            return(View("ServRQKos", model.RQKosSet));
        }
Пример #3
0
        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));
            }
        }
Пример #4
0
        public ActionResult ServiceRQKosBranch(string serviceId, string id, string verb)
        {
            if (verb == "dt")
            {
                return(View(GetModel(id, verb).RQKosSet));
            }
            else
            {
                RQKosModel model = GetModel(id, serviceId);

                if ((ViewBag.locPath == null) || (ViewBag.locPath == ""))
                {
                    ViewBag.locPath = new RQLib.RQKos.Classifications.SubjClass(model.RQKosSet.GetItem(0)._class.ClassID, model.RQKosSet.GetItem(0)._class.ClassDataClient).ClassPath;
                }
                if (serviceId != null)
                {
                    switch (serviceId)
                    {
                    case "rqld":
                        EnableXmlAttribute.XSLTransform = "~/xslt/rqkos2rdf.xslt";
                        break;

                    case "rq":
                        EnableXmlAttribute.XSLTransform = "";
                        break;

                    default:
                        throw new NotImplementedException("RiQuest data service not yet implemented for unknown format.");
                    }
                }
                else
                {
                    EnableXmlAttribute.XSLTransform = "";
                }
                return(View("ServRQKos", model.RQKosSet));
            }
        }