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

            suspensoes.Ativo = (OpcaoStatusSuspensoes)1;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,Nome,Ativo")] Suspensoes suspensoes)
 {
     if (ModelState.IsValid)
     {
         db.Entry(suspensoes).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(suspensoes));
 }
示例#3
0
 public ActionResult Create([Bind(Include = "Id,Nome,Ativo")] Suspensoes suspensoes)
 {
     if (ModelState.IsValid)
     {
         db.Suspensoes.Add(suspensoes);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(suspensoes));
 }
示例#4
0
        // GET: Suspensoes/Delete
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Suspensoes suspensoes = db.Suspensoes.Find(id);

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