private void confirmarExcluirButton_Click(object sender, EventArgs e) { Cliente cliente = (Cliente)listaDataGridView.CurrentRow.DataBoundItem; cliente.Id = Convert.ToInt32(idTextBox.Text); var db = new ClienteDb(); db.Excluir(cliente.Id); ExibirGrid(); }
public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here var db = new ClienteDb(); db.Excluir(id); return(RedirectToAction("Index")); } catch { return(View(id)); } }