// GET: Projects/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var project = db.Projects.Find(id);

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

            ViewBag.IsEditEnable   = AccessUtility.IsEditEnable(db, User.Identity.Name);
            ViewBag.IsDeleteEnable = AccessUtility.IsDeleteEnable(db, User.Identity.Name);
            return(View(project));
        }
Пример #2
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));
        }