Example #1
0
        protected void grudUsuario_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Excluir")
            {
                int _index = int.Parse((string)e.CommandArgument);

                string _chave = grudUsuario.DataKeys[_index]["IdDoacao"].ToString();

                DoacaoDTO _dto = new DoacaoDTO();
                if (!String.IsNullOrEmpty(_chave))
                {
                    _dto.IdDoacao = long.Parse(_chave);
                }

                DoacaoBLL _bll = new DoacaoBLL();
                if (_bll.deleteDoacao(_dto))
                {
                    preencherGrid();
                }
            }
            else if (e.CommandName == "Atualizar")
            {
                //        int _index = int.Parse((string)e.CommandArgument);


                //        string _chave = grudUsuario.DataKeys[_index]["IdDoador"].ToString();

                //        string _cpf = Server.HtmlDecode(grudUsuario.Rows[_index].Cells[1].Text);
                //        string _nome = Server.HtmlDecode(grudUsuario.Rows[_index].Cells[2].Text);
                //        string _endereco = Server.HtmlDecode(grudUsuario.Rows[_index].Cells[3].Text);
                //        string _telefone = Server.HtmlDecode(grudUsuario.Rows[_index].Cells[4].Text);
                //        string _email = Server.HtmlDecode(grudUsuario.Rows[_index].Cells[5].Text);
                //        string _senha = Server.HtmlDecode(grudUsuario.Rows[_index].Cells[6].Text);

                //        txtCpf.Text = _cpf;
                //        txtCpf.Focus();
                //        txtNome.Text = _nome;
                //        txtNome.Focus();
                //        txtEndereco.Text = _endereco;
                //        txtEndereco.Focus();
                //        txtTelefone.Text = _telefone;
                //        txtTelefone.Focus();
                //        txtEmail.Text = _email;
                //        txtEmail.Focus();
                //        txtSenha.Text = _senha;
                //        txtSenha.Focus();

                //        IDoadorDTO _dto = new DoadorDTO();
                //        if (!String.IsNullOrEmpty(_chave))
                //            _dto.IdDoador = long.Parse(_chave);

                //        DoadorBLL _bll = new DoadorBLL();
                //        if (_bll.updateDoador(_dto))
                //            //Response.Redirect("About.aspx");
                //            preencherGrid();
            }
        }
Example #2
0
        protected void grudUsuario_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "MudarStatus")
            {
                int _index = int.Parse((string)e.CommandArgument);

                string _chave = grudUsuario.DataKeys[_index]["IdDoacao"].ToString();

                DoacaoDTO _dto = new DoacaoDTO();
                if (!String.IsNullOrEmpty(_chave))
                {
                    _dto.IdDoacao = long.Parse(_chave);
                }

                DoacaoBLL _bll = new DoacaoBLL();
                if (_bll.alterarStatus(_dto))
                {
                    preencherGrid();
                }
            }
        }