public ActionResult DeleteConfirmed(string id) { OngModel ongModel = db.OngModels.Find(id); db.OngModels.Remove(ongModel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "cnpj,nome,cep,estado,cidade,bairro,rua,numero,telefone,email,senha")] OngModel ongModel) { if (ModelState.IsValid) { db.Entry(ongModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ongModel)); }
public ActionResult Create([Bind(Include = "cnpj,nome,cep,estado,cidade,bairro,rua,numero,telefone,email,senha")] OngModel ongModel) { if (ModelState.IsValid) { ongModel.cadastro = DateTime.Now; db.OngModels.Add(ongModel); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ongModel)); }
// GET: Ong/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OngModel ongModel = db.OngModels.Find(id); if (ongModel == null) { return(HttpNotFound()); } return(View(ongModel)); }