Ejemplo n.º 1
0
        // GET: Audits/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var audit = db.Audits.Include(s => s.Project).Include(s => s.Files).SingleOrDefault(s => s.AuditId == id);

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

            ViewBag.IsAddResultEnable = AccessUtility.IsAddResultEnable(db, User.Identity.Name) &&
                                        (audit.Status == AuditStatuses.Planned || audit.Status == AuditStatuses.InProgress);
            ViewBag.IsEditEnable   = AccessUtility.IsEditEnable(db, User.Identity.Name);
            ViewBag.IsDeleteEnable = AccessUtility.IsDeleteEnable(db, User.Identity.Name);
            return(View(audit));
        }