public EmpTB InsertEmployee(EmpTB objemp) { dc.EmpTBs.InsertOnSubmit(objemp); dc.SubmitChanges(); return(objemp); }
public EmpTB EditEmployee(int id, EmpTB objemp) { var q3 = dc.EmpTBs.SingleOrDefault(s => s.Id == id); q3.EmpName = objemp.EmpName; q3.Salary = objemp.Salary; q3.Gender = objemp.Gender; q3.DeptId = objemp.DeptId; dc.SubmitChanges(); return(q3); }
public ActionResult Edit(int id, EmpTB objemps) { try { wc.EditEmployee(id, objemps); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(EmpTB emp) { try { wc.InsertEmployee(emp); return(RedirectToAction("Index")); } catch { return(View()); } }
public IActionResult Post(EmpTB empTB) { libraryContext.Add(empTB); libraryContext.SaveChanges(); return(Ok(empTB)); }