// GET: Audits
        public ActionResult Index(int?id)
        {
            var audits = from s in db.Audits select s;

            if (id != null)
            {
                audits = audits.Where(audit => audit.ProjectId == id);
            }

            ViewBag.IsCreateEnable = AccessUtility.IsCreateEnable(db, User.Identity.Name);
            return(View(audits.Include(a => a.Project).ToList()));
        }
        // GET: Projects
        public ActionResult Index(string sortOrder, string searchString)
        {
            ViewBag.NameSortParm = string.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date";

            var projects = from s in db.Projects select s;

            if (!string.IsNullOrEmpty(searchString))
            {
                projects = projects.Where(s => s.Name.Contains(searchString));
            }

            var audits = from s in db.Audits select s;

            var projectView = HelperForProject.CreateProjectView(projects.ToList(), audits.ToList());

            switch (sortOrder)
            {
            case "name_desc":
                projectView = projectView.OrderByDescending(s => s.Project.Name);
                break;

            //case "Date":
            //    projects = projects.OrderBy(s => s.PlannedDate);
            //    break;
            //case "date_desc":
            //    projects = projects.OrderByDescending(s => s.PlannedDate);
            //    break;
            default:
                projectView = projectView.OrderBy(s => s.Project.Name);
                break;
            }

            ViewBag.IsCreateEnable = AccessUtility.IsCreateEnable(db, User.Identity.Name);
            return(View(projectView.ToList()));
        }