protected void imgDeletar_Click(object sender, ImageClickEventArgs e) { ClienteBLL clienteBLL = new ClienteBLL(); clienteBLL.Excluir(int.Parse(((ImageButton)sender).CommandArgument)); this.CarregarTelaCliente(); }
static void Excluir() { MostrarListaClientes(); Cliente c = BuscarClienteDigitacao(); bll.Excluir(c); Console.WriteLine("Cliente excluído com sucesso!"); }
private void excluirCliente(object sender, EventArgs e) { DataGridViewRow linhaAtual = gridClientes.CurrentRow; int indice = linhaAtual.Index; dto.IdCliente = Int32.Parse(gridClientes.Rows[indice].Cells[0].Value.ToString()); bll.Excluir(dto); carregarGrid(); }
public ActionResult Excluir(string id, FormCollection form) { try { bll.Excluir(id); return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); return(View(bll.ObterPorId(id))); } }
private void confirmarExcluirButton_Click(object sender, EventArgs e) { try { bll.Excluir(idTextBox.Text); clienteDataGridView.DataSource = null; clienteDataGridView.DataSource = bll.Listar(); voltarButton.PerformClick(); } catch (Exception ex) { MessageBox.Show("Erro:" + ex.Message); } }
private void btnExcluir_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Tem certeza que quer excluir?", "Atenção", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); if (result == DialogResult.No) { return; } Cliente c = new Cliente(int.Parse(txtID.Text), "", "", "", "", "", "", ""); MessageBox.Show(bll.Excluir(c)); cbBusca.DataSource = bll.LerTodos(); FormCleaner.Clear(this); }
private void btnExcluir_Click(object sender, EventArgs e) { if (txtID.Text != "") { var result = MessageBox.Show("Deseja realmente excluir o registro selecionado?", "Exclusão Cliente", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == System.Windows.Forms.DialogResult.Yes) { bll.Excluir(txtID.Text); MessageBox.Show("O cliente foi excluido com sucesso", "Excluido com Sucesso!", MessageBoxButtons.OK, MessageBoxIcon.Information); LimparTela(); CarregarGrid(); } } }
//Excluir dados private void btnExcluir_Click(object sender, EventArgs e) { int id; id = Convert.ToInt32(txtCod.Text.ToString()); if (MessageBox.Show("Deseja Realmente Excluir?", "Warning", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { ClienteBLL obj = new ClienteBLL(); lblStatus.Text = obj.Excluir(id); AtualizaGrid(); Limpa(); } else { MessageBox.Show("Operação cancelada...", "Warning"); } }
protected void Button2_Click(object sender, EventArgs e) { /* try * {*/ if (txtid.Text != "") { objCliente.Id = int.Parse(txtid.Text); objCliente.Excluir(); CarregarGrid(); Limpar(); } // } /* catch (Exception ex) * { * MessageBox.Show(this, "Erro ao finalizar o sistema: " + ex.Message.ToString(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); * }*/ }
private void btnExcluir_Click(object sender, EventArgs e) { try { DialogResult d = MessageBox.Show("Deseja excluir o registro?", "Aviso", MessageBoxButtons.YesNo); if (d.ToString() == "Yes") { //obj para gravar dados no bd ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão); ClienteBLL bll = new ClienteBLL(conexao); bll.Excluir(Convert.ToInt32(cli_idTextBox.Text)); this.LimpaTela(); this.alterarBotoes(1); } }//try catch { MessageBox.Show("Impossível excluir o registro.\n O registro está sendo utilizado em outro local."); this.alterarBotoes(3); } }
protected void GridClientes_RowDeleting(object sender, GridViewDeleteEventArgs e) { clienteDTO.Id = Convert.ToInt32(GridClientes.DataKeys[e.RowIndex].Value.ToString()); clienteBLL.Excluir(clienteDTO); }