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

            db.Mesages.Remove(mesages);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "id,texts,writer_name,writer_email")] Mesages mesages)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mesages).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mesages));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "id,texts,writer_name,writer_email")] Mesages mesages)
        {
            if (ModelState.IsValid)
            {
                db.Mesages.Add(mesages);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mesages));
        }
Exemple #4
0
        // GET: Admin/Mesages/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mesages mesages = db.Mesages.Find(id);

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