// GET: Files public ActionResult Index(int DeptClassId) { if (DeptClassId == null) { return(Redirect("/Admin/Index")); } FilesRepo filesRepo = new FilesRepo(context); FilesViewModel filesviewmodel = new FilesViewModel() { files = filesRepo.GetClassFiles(DeptClassId) }; ViewBag.DeptClassId = DeptClassId; return(View(filesviewmodel)); }
// GET: Files public ActionResult Index(int?DeptClassId) { if (DeptClassId.Equals(null)) { return(Redirect("/Admin/Index")); } FilesRepo filesRepo = new FilesRepo(context); IEnumerable <Files> enumerable = filesRepo.GetClassFiles(DeptClassId); FilesViewModel filesviewmodel = new FilesViewModel() { files = enumerable }; ViewBag.DeptClassId = DeptClassId; return(View(filesviewmodel)); }