public ActionResult DeleteConfirmed(int id) { PayInfo payInfo = db.PayInfoes.Find(id); db.PayInfoes.Remove(payInfo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PayStubId,EmployeeID,Month,Pay")] PayInfo payInfo) { if (ModelState.IsValid) { db.Entry(payInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeID = new SelectList(db.EmplyeeInfoes, "EmployeeID", "EmployeeName", payInfo.EmployeeID); return(View(payInfo)); }
public ActionResult Create([Bind(Include = "PayStubId,EmployeeID,Pay,Month")] PayInfo payInfo) { if (ModelState.IsValid) { db.PayInfoes.Add(payInfo); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeID = new SelectList(db.EmplyeeInfoes, "EmployeeID", "EmployeeName", payInfo.EmployeeID); return(View(payInfo)); }
// GET: PayInfoes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PayInfo payInfo = db.PayInfoes.Find(id); if (payInfo == null) { return(HttpNotFound()); } return(View(payInfo)); }
// GET: PayInfoes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PayInfo payInfo = db.PayInfoes.Find(id); if (payInfo == null) { return(HttpNotFound()); } ViewBag.EmployeeID = new SelectList(db.EmplyeeInfoes, "EmployeeID", "EmployeeName", payInfo.EmployeeID); return(View(payInfo)); }