public ActionResult DeleteConfirmed(int id) { InformacoesRoubos informacoesRoubos = db.InformacoesRoubos.Find(id); informacoesRoubos.Ativo = (OpcaoStatusInformacoesRoubos)1; db.SaveChanges(); return(RedirectToAction("ListaUsuario", "InformacoesRoubos")); }
public ActionResult Create([Bind(Include = "Id,Cidade,Estado,Relato,LocalAdicional,DataRoubo,BicicletasId,Ativo")] InformacoesRoubos informacoesRoubos) { if (ModelState.IsValid) { db.InformacoesRoubos.Add(informacoesRoubos); db.SaveChanges(); return(RedirectToAction("ListaUsuario", "InformacoesRoubos")); } ViewBag.BicicletasId = new SelectList(db.Bicicletas, "Id", "Modelo", informacoesRoubos.BicicletasId); return(View(informacoesRoubos)); }
// GET: InformacoesRoubos/Details public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InformacoesRoubos informacoesRoubos = db.InformacoesRoubos.Find(id); if (informacoesRoubos == null) { return(HttpNotFound()); } return(View(informacoesRoubos)); }
// GET: InformacoesRoubos/Edit public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InformacoesRoubos informacoesRoubos = db.InformacoesRoubos.Find(id); if (informacoesRoubos == null) { return(HttpNotFound()); } ViewBag.BicicletasId = new SelectList(db.Bicicletas.Where(w => w.Ativo == 0), "Id", "Modelo", informacoesRoubos.BicicletasId); return(View(informacoesRoubos)); }