Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Sesh sesh = db.Seshes.Find(id);

            db.Seshes.Remove(sesh);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "SeshID,Date,Time,Venue")] Sesh sesh)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sesh).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sesh));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "SeshID,Date,Time,Venue")] Sesh sesh)
        {
            if (ModelState.IsValid)
            {
                db.Seshes.Add(sesh);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sesh));
        }
Ejemplo n.º 4
0
        // GET: Seshes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Sesh sesh = db.Seshes.Find(id);

            if (sesh == null)
            {
                return(HttpNotFound());
            }
            return(View(sesh));
        }