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

            //return View();
        }
예제 #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();
     }
 }
예제 #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();
       }
 }