public ActionResult AddPerson() { //Переходи на страницу добавления работника DataAccessModel model = new DataAccessModel(); ViewBag.Positions = new SelectList(model.DropDownPositions(), "Value", "Text"); ViewBag.Companies = new SelectList(model.DropDowmCompanies(), "Value", "Text"); return(View()); }
public ActionResult EditPerson(int id) { // Получаем работника для редактирования DataAccessModel model = new DataAccessModel(); ViewBag.Positions = new SelectList(model.DropDownPositions(), "Value", "Text"); ViewBag.Companies = new SelectList(model.DropDowmCompanies(), "Value", "Text"); return(View(model.SelectPerson(id))); }