Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            WrittenConv writtenConv = db.WrittenConvs.Find(id);

            db.WrittenConvs.Remove(writtenConv);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Title,Body")] WrittenConv writtenConv)
 {
     if (ModelState.IsValid)
     {
         db.Entry(writtenConv).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(writtenConv));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Title,Body")] WrittenConv writtenConv)
        {
            if (ModelState.IsValid)
            {
                db.WrittenConvs.Add(writtenConv);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(writtenConv));
        }
Ejemplo n.º 4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WrittenConv writtenConv = db.WrittenConvs.Find(id);

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