public ActionResult DeleteConfirmed(int id) { ONG oNG = db.ONGs.Find(id); db.ONGs.Remove(oNG); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Nome,CPF")] ONG oNG) { if (ModelState.IsValid) { db.Entry(oNG).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(oNG)); }
public ActionResult Create([Bind(Include = "ID,Nome,CPF")] ONG oNG) { if (ModelState.IsValid) { db.ONGs.Add(oNG); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(oNG)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ONG oNG = db.ONGs.Find(id); if (oNG == null) { return(HttpNotFound()); } return(View(oNG)); }
public void Add(ONG ongs) { _ongRepositories.Add(ongs); }
public IActionResult Post([FromBody] ONG ongs) { _ongServices.Add(ongs); return(Ok(ongs)); }
public void Update(ONG ongs) { throw new NotImplementedException(); }
public void Add(ONG ongs) { var sql = "Insert into ongs (Id, Name, Email, Whatsapp, City, UF ) values(@Id, @Name, @Email, @Whatsapp, @City, @UF)"; _sqlConnection.Query <ONG>(sql, new { ongs.Id, ongs.Name, ongs.Email, ongs.Whatsapp, ongs.City, ongs.UF }); }