Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MyExperiences myExperiences = db.MyExperiences.Find(id);

            db.MyExperiences.Remove(myExperiences);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        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));
        }
Exemple #4
0
        // 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));
        }
Exemple #5
0
        // 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));
        }