public ActionResult Delete(int id) { using (var db = new Timesheet1()) { return View(db.entry.Find(id)); } }
// // GET: /timesheet/ public ActionResult Index() { using (var db = new Timesheet1()) { return View(db.entry.ToList()); } //return View(); }
public ActionResult Delete(int id, Timesheet sheet) { try { using (var db = new Timesheet1()) { db.Entry(sheet ).State = System.Data.Entity. EntityState.Deleted; db.SaveChanges(); } return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult add(Timesheet sheet) { try { using (var db = new Timesheet1()) { db.entry.Add(sheet); db.SaveChanges(); } return RedirectToAction("Index"); } catch { return View(); } }