Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            user_entry user_entry = db.user_entry.Single(u => u.entry_id == id);

            db.user_entry.DeleteObject(user_entry);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        //
        // GET: /UserEntry/Edit/5

        public ActionResult Edit(int id = 0)
        {
            user_entry user_entry = db.user_entry.Single(u => u.entry_id == id);

            if (user_entry == null)
            {
                return(HttpNotFound());
            }
            return(View(user_entry));
        }
Beispiel #3
0
        public ActionResult Reports(user_entry model)
        {
            if (ModelState.IsValid)
            {
                return(RedirectToAction("Login", "Account"));
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Beispiel #4
0
        public ActionResult Create(user_entry user_entry)
        {
            if (ModelState.IsValid)
            {
                db.user_entry.AddObject(user_entry);
                db.SaveChanges();
                return(RedirectToAction("Edit", new { id = user_entry.entry_id }));
            }

            return(View(user_entry));
        }
Beispiel #5
0
 public ActionResult Edit(user_entry user_entry)
 {
     if (user_entry.entry_id == 0)
     {
         if (user_entry.work_date == null)
         {
             user_entry.work_date = Convert.ToDateTime(this.Session["ssworkdate"]);
         }
         db.user_entry.AddObject(user_entry);
         db.SaveChanges();
         return(RedirectToAction("Edit", new { id = user_entry.entry_id }));
     }
     if (ModelState.IsValid)
     {
         db.user_entry.Attach(user_entry);
         db.ObjectStateManager.ChangeObjectState(user_entry, EntityState.Modified);
         db.SaveChanges();
         return(RedirectToAction("Edit", new { id = user_entry.entry_id }));
     }
     return(View(user_entry));
 }