public ActionResult DeleteConfirmed(int id) { visiting visiting = db.visitings.Find(id); db.visitings.Remove(visiting); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,title,description_visiting,date_visiting")] visiting visiting) { if (ModelState.IsValid) { db.Entry(visiting).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(visiting)); }
public ActionResult Create([Bind(Include = "id,title,description_visiting,date_visiting")] visiting visiting) { if (ModelState.IsValid) { db.visitings.Add(visiting); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(visiting)); }
// GET: visitings/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } visiting visiting = db.visitings.Find(id); if (visiting == null) { return(HttpNotFound()); } return(View(visiting)); }