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")); }
// // 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)); }
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)); }
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)); }
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)); }