Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Humane humane = db.Humanes.Find(id);

            db.Humanes.Remove(humane);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit(Humane humane)
 {
     if (ModelState.IsValid)
     {
         db.Entry(humane).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(humane));
 }
Exemplo n.º 3
0
        public ActionResult Create(Humane humane)
        {
            if (ModelState.IsValid)
            {
                db.Humanes.Add(humane);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(humane));
        }
Exemplo n.º 4
0
        // GET: Restaurant/Details/id
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Humane humane = db.Humanes.Find(id);

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