public ActionResult DeleteConfirmed(int id) { MyExperiences myExperiences = db.MyExperiences.Find(id); db.MyExperiences.Remove(myExperiences); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,ActivitiesId,Comments")] MyExperiences myExperiences) { if (ModelState.IsValid) { db.Entry(myExperiences).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(myExperiences)); }
public ActionResult Create([Bind(Include = "Id,ActivitiesId,Comments")] MyExperiences myExperiences) { if (ModelState.IsValid) { db.MyExperiences.Add(myExperiences); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(myExperiences)); }
// GET: MyExperiences/Create public ActionResult Create() { MyExperiences NewExperience = new MyExperiences(); NewExperience.MyImages = new List <Image>(); Image newImage = new Image(); NewExperience.MyImages.Add(newImage); db.MyExperiences.Add(NewExperience); db.SaveChanges(); return(View(NewExperience)); }
// GET: MyExperiences/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MyExperiences myExperiences = db.MyExperiences.Find(id); if (myExperiences == null) { return(HttpNotFound()); } return(View(myExperiences)); }