public ActionResult DeleteConfirmed(int id) { HourBreakdown hourBreakdown = db.HourBreakdowns.Find(id); db.HourBreakdowns.Remove(hourBreakdown); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Driver,Hoursworked,VehicleNumbers,Signature,CoDriver,OnDutyHours,OffDutyHours,OnDutyHours2,OffDutyHours2,OnDutyHours3,OffDutyHours3,TotalHours")] HourBreakdown hourBreakdown) { if (ModelState.IsValid) { db.Entry(hourBreakdown).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hourBreakdown)); }
// GET: HourBreakdowns/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HourBreakdown hourBreakdown = db.HourBreakdowns.Find(id); if (hourBreakdown == null) { return(HttpNotFound()); } return(View(hourBreakdown)); }