Exemplo n.º 1
0
        public ActionResult Create(Notate notate)
        {
            db.Notates.Add(notate);
            db.SaveChanges();

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

            if (n == null)
            {
                return(HttpNotFound());
            }
            return(View(n));
        }
Exemplo 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"));
        }
Exemplo n.º 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));
        }