// GET: Students/Create public ActionResult Create() { DeptRepo repo = new DeptRepo(); ViewBag.Dept = new SelectList(repo.GetDept(), "DeptId", "Name"); return(View()); }
// GET: Students/Edit/5 public ActionResult Edit(int id) { StudentRepo repo = new StudentRepo(); DeptRepo drepo = new DeptRepo(); ViewBag.Dept = new SelectList(drepo.GetDept(), "DeptId", "Name"); return(View(repo.GetStudent().ToList().Find(d => d.StudentId == id))); }
public ActionResult Index() { DeptRepo repo = new DeptRepo(); ModelState.Clear(); return(View(repo.GetDept())); }
public ActionResult Edit(int id) { DeptRepo repo = new DeptRepo(); return(View(repo.GetDept().Find(d => d.DeptId == id))); }