public ActionResult Create(EmployeeSearch empSearch) { Step2017Entities1 ent = new Step2017Entities1(); ent.EmployeeSearches.Add(empSearch); ent.SaveChanges(); return(RedirectToAction("List")); }
public ActionResult Delete(int id) { Step2017Entities1 ent = new Step2017Entities1(); var resultDelete = ent.EmployeeSearches.Where(c => c.Id == id).FirstOrDefault(); ent.EmployeeSearches.Remove(resultDelete); ent.SaveChanges(); return(RedirectToAction("List")); }
public ActionResult Edit(EmployeeSearch empSearch) { Step2017Entities1 ent = new Step2017Entities1(); EmployeeSearch es = ent.EmployeeSearches.Where(c => c.Id == empSearch.Id).FirstOrDefault(); es.Name = empSearch.Name; es.Address = empSearch.Address; es.Salary = empSearch.Salary; ent.SaveChanges(); return(RedirectToAction("List")); }