protected void btnRemover_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtCodigo.Value))
     {
         DespesaFacade facade = new DespesaFacade();
         facade.DespesaDeletar(int.Parse(txtCodigo.Value));
         carregarGrid(facade);
         limparCampos();
     }
 }
 protected void btnGravar_Click(object sender, EventArgs e)
 {
     DespesaFacade facade = new DespesaFacade();
     if (string.IsNullOrEmpty(txtCodigo.Value))
     {
         facade.DespesaInserir(txtDescricao.Text);
     }
     else
     {
         facade.DespesaAlterar(int.Parse(txtCodigo.Value), txtDescricao.Text);
     }
     carregarGrid(facade);
     limparCampos();
 }
 private void carregarGrid(DespesaFacade facade)
 {
     GridViewDespesa.DataSource = facade.Obter();
     GridViewDespesa.DataBind();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     DespesaFacade facade = new DespesaFacade();
        carregarGrid(facade);
 }