public ActionResult DeleteConfirmed(int id) { DailyLogMileageAndFuelReport dailyLogMileageAndFuelReport = db.DailyLogMileageAndFuelReports.Find(id); db.DailyLogMileageAndFuelReports.Remove(dailyLogMileageAndFuelReport); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Driver,DateofWork,Owner,Tractornumber,Trailernumber,Pronumber,State,Totalmilesdriven,Totalgaspurchased,Routestraveled,Odometerstart,Odometerfinish")] DailyLogMileageAndFuelReport dailyLogMileageAndFuelReport) { if (ModelState.IsValid) { db.Entry(dailyLogMileageAndFuelReport).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dailyLogMileageAndFuelReport)); }
// GET: DailyLogMileageAndFuelReports/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DailyLogMileageAndFuelReport dailyLogMileageAndFuelReport = db.DailyLogMileageAndFuelReports.Find(id); if (dailyLogMileageAndFuelReport == null) { return(HttpNotFound()); } return(View(dailyLogMileageAndFuelReport)); }