Ejemplo n.º 1
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int codigo = 0;

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

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

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

        default:
            break;
        }
    }