public ActionResult DeleteConfirmed(int id) { OcorrenciaGre ocorrenciaGre = db.OcorrenciaGres.Find(id); db.OcorrenciaGres.Remove(ocorrenciaGre); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "OcorrenciaGreId,latitude,longitude,logradouro,numero,bairro,cep,cidade,estado,Data,TipoOcorrenciaGreId,DescricaoOcorrenciaGreId,GreId")] OcorrenciaGre ocorrenciaGre) { if (ModelState.IsValid) { db.Entry(ocorrenciaGre).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DescricaoOcorrenciaGreId = new SelectList(db.DescricaoOcorrenciaGres, "DescricaoOcorrenciaGreId", "Descricao", ocorrenciaGre.DescricaoOcorrenciaGreId); ViewBag.GreId = new SelectList(db.Gres, "GreId", "Regional", ocorrenciaGre.GreId); ViewBag.TipoOcorrenciaGreId = new SelectList(db.TipoOcorrenciaGres, "TipoOcorrenciaGreId", "Tipo", ocorrenciaGre.TipoOcorrenciaGreId); return(View(ocorrenciaGre)); }
// GET: OcorrenciaGre/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OcorrenciaGre ocorrenciaGre = db.OcorrenciaGres.Find(id); if (ocorrenciaGre == null) { return(HttpNotFound()); } return(View(ocorrenciaGre)); }
// GET: OcorrenciaGre/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OcorrenciaGre ocorrenciaGre = db.OcorrenciaGres.Find(id); if (ocorrenciaGre == null) { return(HttpNotFound()); } ViewBag.DescricaoOcorrenciaGreId = new SelectList(db.DescricaoOcorrenciaGres, "DescricaoOcorrenciaGreId", "Descricao", ocorrenciaGre.DescricaoOcorrenciaGreId); ViewBag.GreId = new SelectList(db.Gres, "GreId", "Regional", ocorrenciaGre.GreId); ViewBag.TipoOcorrenciaGreId = new SelectList(db.TipoOcorrenciaGres, "TipoOcorrenciaGreId", "Tipo", ocorrenciaGre.TipoOcorrenciaGreId); return(View(ocorrenciaGre)); }