Example #1
0
    protected void GridView2_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
    {
        int codigo = 0;

        switch (e.CommandName)
        {
        case "Alterar":
            codigo        = Convert.ToInt32(e.CommandArgument);
            Session["ID"] = codigo;
            Response.Redirect("Alterar.aspx");
            break;

        case "Deletar":

            codigo = Convert.ToInt32(e.CommandArgument);
            ClienteBD bd = new ClienteBD();
            bd.Delete(codigo);
            Carrega();

            break;

        default:
            break;
        }
    }
Example #2
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int codigo = 0;

            switch (e.CommandName)
            {
            case "Deletar":
                codigo = Convert.ToInt32(e.CommandArgument);
                ClienteBD bd = new ClienteBD();
                bd.Delete(codigo);
                Carrega();
                break;

            default:
                break;
            }
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int Codigo = 0;

            switch (e.CommandName)
            {
            case "Alterar":
                Codigo        = Convert.ToInt32(e.CommandArgument);
                Session["ID"] = Codigo;
                Response.Redirect("../Alterar/AlterarCliente.aspx");

                break;

            case "Deletar":
                Codigo = Convert.ToInt32(e.CommandArgument);
                ClienteBD bd = new ClienteBD();
                bd.Delete(Codigo);
                Carrega("");
                break;

            default:
                break;
            }
        }