Exemplo n.º 1
0
 public ActionResult Delete(int id)
 {
     using (var db = new Timesheet1())
     {
         return View(db.entry.Find(id));
     }
 }
Exemplo n.º 2
0
        //
        // GET: /timesheet/
        public ActionResult Index()
        {
            using (var db = new Timesheet1())
            {
                return View(db.entry.ToList());
            }

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