public ActionResult GetItemByIdBasic(string id, bool addinverse)
        {
            XElement res = SObjects.GetItemByIdBasic(id, addinverse);

            return(new ContentResult {
                ContentType = "text/xml", Content = res.ToString()
            });
        }
示例#2
0
        public IActionResult Portrait(string id, string eid) // eid (external id) - ид айтема, в котором есть список, в котором есть id
        {
            DateTime tt0 = DateTime.Now;

            //string id = Request.Query["id"];//.Params["id"];
            if (string.IsNullOrEmpty(id))
            {
                return(new RedirectResult("~/Home/Index"));
            }

            XElement special = SObjects.GetItemByIdBasic(id, false);

            if (special == null || special.Attribute("type") == null)
            {
                return(new RedirectResult("~/Home/Index"));
            }
            string type = special.Attribute("type").Value;

            if (type == "http://fogid.net/o/person")
            {
                return(View("PortraitPerson", new PortraitPersonModel(id)));
            }
            else if (type == "http://fogid.net/o/collection")
            {
                return(View("PortraitCollection", new PortraitCollectionModel(id)));
            }
            else if (type == "http://fogid.net/o/org-sys")
            {
                return(View("PortraitOrg", new PortraitOrgModel(id)));
            }
            else if (type == "http://fogid.net/o/document" || type == "http://fogid.net/o/photo-doc")
            {
                return(View("PortraitDocument", new PortraitDocumentModel(id, eid)));
            }
            else if (type == "http://fogid.net/o/city" || type == "http://fogid.net/o/country")
            {
                return(View("PortraitGeo", new PortraitGeoModel(id)));
            }
            else
            {
                //@RenderPage("PortraitAny.cshtml", new { id = id, type = type })
            }

            return(View());
        }