Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            WrittenConvComment writtenConvComment = db.WrittenConvComments.Find(id);

            db.WrittenConvComments.Remove(writtenConvComment);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id,Text,Date")] WrittenConvComment writtenConvComment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(writtenConvComment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(writtenConvComment));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "Id,Text")] WrittenConvComment writtenConvComment)
        {
            if (ModelState.IsValid)
            {
                db.WrittenConvComments.Add(writtenConvComment);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(writtenConvComment));
        }
Exemple #4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WrittenConvComment writtenConvComment = db.WrittenConvComments.Find(id);

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