protected void btnGravar_Click1(object sender, EventArgs e) { AdiantamentoFacade facade = new AdiantamentoFacade(); if (string.IsNullOrEmpty(txtCodigo.Value)) { facade.AdiantamentoInserir(int.Parse(cbxFuncionario.SelectedItem.Value), txtDescricao.Text, dpcDataAdiantamento.SelectedDate, dpcDataPrestacao.SelectedDate); } else { facade.AdiantamentoAlterar(int.Parse(txtCodigo.Value), int.Parse(cbxFuncionario.SelectedItem.Value), txtDescricao.Text, dpcDataAdiantamento.SelectedDate, dpcDataPrestacao.SelectedDate); } carregarGrid(facade); limparCampos(); }