public ActionResult DeleteConfirmed(int id) { tblBenefit tblBenefit = db.tblBenefits.Find(id); db.tblBenefits.Remove(tblBenefit); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BenefitCode,EmpCode,BenefitAmount,BenefitDate,BenefitType,PreviousNetSalary,NewNetSalary,Gross,Basic,HouseRent,Medical,ConvenceAll,CashIntensive,launceAllowance,otherAllowance,StateStatus,BenifitActiveDate,Remarks")] tblBenefit tblBenefit) { if (ModelState.IsValid) { db.Entry(tblBenefit).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmpCode = new SelectList(db.tblEmployees, "EmpCode", "EmpName", tblBenefit.EmpCode); return(View(tblBenefit)); }
// GET: Benefits/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblBenefit tblBenefit = db.tblBenefits.Find(id); if (tblBenefit == null) { return(HttpNotFound()); } return(View(tblBenefit)); }
// GET: Benefits/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblBenefit tblBenefit = db.tblBenefits.Find(id); if (tblBenefit == null) { return(HttpNotFound()); } ViewBag.EmpCode = new SelectList(db.tblEmployees, "EmpCode", "EmpName", tblBenefit.EmpCode); return(View(tblBenefit)); }