// // GET: /Employee/Edit/5 public ActionResult Edit(int id = 0) { EmployMvcPresentation.Models.EmployeeViewModel employee = Repository.FetchById(id).ToViewModel(); if (employee == null) { return(HttpNotFound()); } return(View(employee)); }
public ActionResult Create(EmployMvcPresentation.Models.EmployeeViewModel employee) { if (ModelState.IsValid) { Repository.Add(employee.ToDataContract()); return(RedirectToAction("Index")); } return(View(employee)); }