Exemple #1
0
        // GET: Locations/Details/5
        public ActionResult Details(int id)
        {
            try
            {
                if (User.IsInRole("Admin"))
                {
                    if (id > 0)
                    {
                        var record = _repo.Get(id);
                        if (record.LocationId < 1)
                        {
                            return(RedirectToAction("Error404", "Home"));
                        }

                        return(View(record));
                    }

                    return(RedirectToAction("Error404", "Home"));
                }

                return(RedirectToAction("Login", "Account"));
            }
            catch (Exception ex)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.ToString()));
            }
        }