// GET: Departments/Create public ActionResult Create() { Department department = new Department(); //set default value var companyRepository = _unitOfWork.Repository<Company>(); ViewBag.CompanyId = new SelectList(companyRepository.Queryable(), "Id", "Name"); return View(department); }
public ActionResult Update(Department model) { if (ModelState.IsValid) { dept.EditDept(model); return RedirectToAction("Index"); } return View(model); }
public ActionResult Create(Department model) { if (ModelState.IsValid) { dept.SaveDept(model); return RedirectToAction("Index"); } return View(); }
public ActionResult Details(Department model) { return View(model); }
public ActionResult Create() { Department model = new Department(); return View(model); }