コード例 #1
0
        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;
            }
        }
コード例 #3
0
        public ActionResult Deleta(String Codigo)
        {
            PessoaDAL pd  = new PessoaDAL();
            int       cod = Convert.ToInt32(Codigo);

            pd.Excluir(cod);
            return(RedirectToAction("Index"));
        }
コード例 #4
0
        public int Excluir(int codigo)
        {
            try
            {
                int result = pessoaDAL.Excluir(codigo);

                return(result);
            }catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
        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;
            }
        }
コード例 #7
0
        //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;
            }
        }
コード例 #8
0
        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;
            }
        }
コード例 #9
0
        //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;
            }
        }
コード例 #10
0
        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;
            }
        }
コード例 #11
0
ファイル: PessoaBLL.cs プロジェクト: Papifa/ProgramaGoDev
 public MessageResponse Excluir(long idPessoa)
 {
     return dal.Excluir(idPessoa);
 }
コード例 #12
0
 public void Excluir(int id)
 {
     _dal.Excluir(id);
 }