public ActionResult Delete(int id) { bussinesslayer b = new bussinesslayer(); b.deleteemploye(id); return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { bussinesslayer b = new bussinesslayer(); employee em = b.bemployee.Single(x => x.ID == id); return(View(em)); }
// GET: Employee public ActionResult Index() { bussinesslayer b = new bussinesslayer(); List <employee> e = b.bemployee.ToList(); return(View(e)); }
public ActionResult Edit_post(int id) { bussinesslayer b = new bussinesslayer(); employee em = b.bemployee.Single(x => x.ID == id); UpdateModel(em, new string[] { "Gender", "City" }); if (ModelState.IsValid) { b.updateemployee(em); return(RedirectToAction("Index")); } return(View(em)); }
public ActionResult Create_Post(employee em) { if (ModelState.IsValid) { bussinesslayer bemp = new bussinesslayer(); bemp.addemployee(em); return(RedirectToAction("Index")); } else { return(View()); } }