public ActionResult AddEmployees() { UIEmployee uiEmployee = new UIEmployee(); uiEmployee.lstCountry = mvcDemoEntities.Countries.ToList(); uiEmployee.lstGender = mvcDemoEntities.Genders.ToList(); uiEmployee.lstState = mvcDemoEntities.States.ToList(); return(View(uiEmployee)); }
public ActionResult AddEmployees(UIEmployee uiEmployee) { mvcDemoEntities.Employees.Add(uiEmployee.Employee); mvcDemoEntities.SaveChanges(); return(RedirectToAction("AddEmployees")); }