Beispiel #1
0
        public ActionResult View(int id)
        {
            if (id == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var dataItem = dataItemService.GetDataItem(id);

            if (dataItem == null)
            {
                return(HttpNotFound());
            }

            var relatedItems = dataItemService.GetRelatedDataItems(dataItem).ToList();

            ViewBag.RelatedItems = relatedItems;
            if (TempData["fromMenu"] != null)
            {
                ViewBag.fromMenu = TempData["fromMenu"];
                TempData.Keep("fromMenu");
            }
            return(View(dataItem));
        }