// // GET: /Department/Create public ActionResult Create() { InstructorBo instBo = new InstructorBo(ModelState); ViewBag.PersonID = new SelectList(instBo.Get(orderBy: q => q.OrderBy(d => d.LastName)), "PersonID ", "FullName"); return View(); }
public ActionResult Create(Department department) { if (departmentBo.Insert(department)) { return RedirectToAction("Index"); } InstructorBo instBo = new InstructorBo(ModelState); ViewBag.PersonID = new SelectList(instBo.Get(orderBy: q => q.OrderBy(d => d.LastName)), "PersonID ", "FullName", department.PersonID); return View(department); }
// // GET: /Department/Edit/5 public ActionResult Edit(int id = 0) { Department department = departmentBo.GetByID(id); if (department == null) { return HttpNotFound(); } InstructorBo instBo = new InstructorBo(ModelState); ViewBag.PersonID = new SelectList(instBo.Get(orderBy: q => q.OrderBy(d => d.LastName)), "PersonID ", "FullName", department.PersonID); return View(department); }