예제 #1
0
        public ActionResult Create(Notate notate)
        {
            db.Notates.Add(notate);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult Delete(int id)
        {
            Notate n = db.Notates.Find(id);

            if (n == null)
            {
                return(HttpNotFound());
            }
            return(View(n));
        }
예제 #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Notate n = db.Notates.Find(id);

            if (n == null)
            {
                return(HttpNotFound());
            }
            db.Notates.Remove(n);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #4
0
        public ActionResult ChangeN(int id)
        {
            Notate n = db.Notates.Find(id);

            if (n == null)
            {
                return(HttpNotFound());
            }
            var notates = db.Notates;

            ViewBag.Notates = notates;
            return(View(n));
        }