protected void btnExcluir_Click(object sender, EventArgs e) { try { if (!String.IsNullOrEmpty(txtCodigo.Text)) { int codigo = Convert.ToInt32(txtCodigo.Text); PessoaDAL dAL = new PessoaDAL(); dAL.Excluir(codigo); txtNome.Text = string.Empty; txtEmail.Text = string.Empty; txtEndereco.Text = string.Empty; txtCodigo.Text = string.Empty; txtCodigo.Focus(); } else { lblMensagem.Text = "Informe um código válido !"; } } catch (Exception ex) { lblMensagem.Text = ex.Message; } }
protected void btnExcluirPessoa(object sender, EventArgs e) { try { int Codigo = Convert.ToInt32(txtCodigo.Text); Pessoa p = new Pessoa(); PessoaDAL d = new PessoaDAL(); d.Excluir(Codigo); lblMemsagem.Text = "Estagiário(a)" + p.Nome + "Excluido com sucesso!"; txtCodigo.Text = string.Empty; txtNome.Text = string.Empty; txtHobby.Text = string.Empty; txtEsporte.Text = string.Empty; txtFilme.Text = string.Empty; txtDesejo.Text = string.Empty; txtMedo.Text = string.Empty; txtComida.Text = string.Empty; } catch (Exception ex) { lblMensagem.Text = ex.Message; } }
public ActionResult Deleta(String Codigo) { PessoaDAL pd = new PessoaDAL(); int cod = Convert.ToInt32(Codigo); pd.Excluir(cod); return(RedirectToAction("Index")); }
public int Excluir(int codigo) { try { int result = pessoaDAL.Excluir(codigo); return(result); }catch (Exception ex) { throw new Exception(ex.Message); } }
protected void btnExcluirCliente(object sender, EventArgs e) { try { int cod = Convert.ToInt32(txtCodigo.Text); PessoaDAL d = new PessoaDAL(); d.Excluir(cod); pnlDados.Visible = false; lblMensagem.Text = "Cliente excluido com sucesso!"; txtCodigo.Text = string.Empty; } catch (Exception ex) { lblMensagem.Text = ex.Message; } }
protected void BtnExclui(object sender, EventArgs e) { try { int codigo = Convert.ToInt32(txtCodigo.Text); dal.Excluir(codigo); txtNome.Text = string.Empty; txtEndereco.Text = string.Empty; txtEmail.Text = string.Empty; lblMensagem.Text = p.Nome + " excluído(a) com sucesso"; } catch (Exception ex) { lblMensagem.Text = ex.Message; } }
//excluir protected void btnExcluirCliente(object sender, EventArgs e) { try { int codigo = Convert.ToInt32(txtCodigo.Text); Pessoa p = new Pessoa(); PessoaDAL d = new PessoaDAL(); d.Excluir(codigo); lblMensagem.Text = "pessoa excuida com sucesso"; txtNome.Text = String.Empty; txtEndereco.Text = String.Empty; txtEmail.Text = String.Empty; } catch (Exception ex) { lblMensagem.Text = ex.Message; } }
protected void btnExclui_Click(object sender, EventArgs e) { try { int codigo = Convert.ToInt32(txtCodigo.Text); PessoaDAL pessoaDal = new PessoaDAL(); pessoaDal.Excluir(codigo); lblMensagem.Text = "Cliente excluído com sucesso"; txtCodigo.Text = string.Empty; txtNome.Text = string.Empty; txtEndereco.Text = string.Empty; txtEmail.Text = string.Empty; } catch (Exception ex) { lblMensagem.Text = ex.Message; } }
//Ação do Botão Excluir: protected void btnExcluirCliente(object sender, EventArgs e) { try { int Codigo = Convert.ToInt32(txtCodigo.Text); Pessoa p = new Pessoa(); PessoaDAL d = new PessoaDAL(); d.Excluir(Codigo); lblMensagem.Text = "Cliente " + p.Nome + "Excluído com Sucesso!"; txtCodigo.Text = string.Empty; txtNome.Text = string.Empty; txtEndereco.Text = string.Empty; txtEmail.Text = string.Empty; } catch (Exception ex) { lblMensagem.Text = ex.Message; } }
protected void BntExcluirClientes(object sender, EventArgs e) { try { int Codigo = Convert.ToInt32(textCodigo.Text); Pessoa p = new Pessoa(); PessoaDAL d = new PessoaDAL(); d.Excluir(Codigo); lblMensagem.Text = "Cliente excluido com sucesso, Atualize a pagina para nova pesquisa"; textCodigo.Text = string.Empty; txtNome.Text = string.Empty; txtEndereco.Text = string.Empty; txtEmail.Text = string.Empty; } catch (Exception ex) { lblMensagem.Text = ex.Message; } }
public MessageResponse Excluir(long idPessoa) { return dal.Excluir(idPessoa); }
public void Excluir(int id) { _dal.Excluir(id); }