Ejemplo n.º 1
0
 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();
     }
 }
Ejemplo n.º 2
0
 public ActionResult add(Timesheet sheet)
 {
     try
      {
      using (var db = new Timesheet1())
      {
      db.entry.Add(sheet);
       db.SaveChanges();
      }
      return RedirectToAction("Index");
       }
       catch
       {
     return View();
       }
 }