示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MsgModels msgmodels = db.MsgModels.Find(id);

            db.MsgModels.Remove(msgmodels);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
        //
        // GET: /Msg/Delete/5

        public ActionResult Delete(int id = 0)
        {
            MsgModels msgmodels = db.MsgModels.Find(id);

            if (msgmodels == null)
            {
                return(HttpNotFound());
            }
            return(View(msgmodels));
        }
示例#3
0
 public ActionResult Edit(MsgModels msgmodels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(msgmodels).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(msgmodels));
 }
示例#4
0
        public ActionResult Create(MsgModels msgmodels)
        {
            if (ModelState.IsValid)
            {
                msgmodels.Date = DateTime.Today.Date;
                db.MsgModels.Add(msgmodels);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(msgmodels));
        }