public ActionResult SaveEmployee(Employee3 e, string BtnSubmit) { switch (BtnSubmit) { case "Save Employee": this.Validate(e); if (ModelState.IsValid) { // return RedirectToAction("Index"); using (var dc = new NDBContext()) { dc.Save(e); } return RedirectToAction("Index"); } else { CreateEmployeeViewModel vm = new CreateEmployeeViewModel(); vm.FirstName = e.FirstName; vm.LastName = e.LastName; // if (e.Salary.HasValue) // { vm.Salary = e.Salary.ToString(); // } // else // { vm.Salary = ModelState["Salary"].Value.AttemptedValue; // } return View("CreateEmployee", vm); // Day 4 Change - Passing e here } //return Content(e.FirstName + "|" + e.LastName + "|" + e.Salary); return RedirectToAction("Index"); case "Cancel": return RedirectToAction("Index"); } return new HttpStatusCodeResult(HttpStatusCode.NotFound); return new EmptyResult(); }