예제 #1
0
 public ActionResult Edit(Notice notice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(notice).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(notice);
 }
예제 #2
0
        public ActionResult Create(Notice notice)
        {
            if (ModelState.IsValid)
            {
                notice.AddDate = DateTime.Now;
                db.Notices.Add(notice);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(notice);
        }