コード例 #1
0
        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();
        }
コード例 #2
0
 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));
     }
 }