private void btnSalvar_Click(object sender, EventArgs e) { if (ValidarCampos()) { tb_movimento ObjMov = new tb_movimento(); MovimentoDAO objDao = new MovimentoDAO(); ObjMov.id_usuario = Usuario.codigoLogado; ObjMov.data_movimento = dtpDataLancameto.Value.Date; ObjMov.tipo_movimento = Convert.ToInt16(cbTipoLanc.SelectedIndex); ObjMov.valor_movimento = Convert.ToDecimal(txtValor.Text); ObjMov.id_categoria = Convert.ToInt32(cbCategoria.SelectedValue); ObjMov.id_empresa = Convert.ToInt32(cbEmpresa.SelectedValue); if (cbConta.SelectedIndex != -1) { ObjMov.id_conta = Convert.ToInt32(cbConta.SelectedValue); } ObjMov.ob_movimento = txtbObservacao.Text.Trim(); ObjMov.data_cadastro = DateTime.Now; try { //entiti //objDao.LancarMovimento(ObjMov); //LimparCampos(); //Util.ExibirMsg(Util.TipoMsg.Sucesso); //usando proc int ret = objDao.LancarMovimentoProc(ObjMov); if (ret == 1) { LimparCampos(); Util.ExibirMsg(Util.TipoMsg.Sucesso); CarregarCombos(); } else { Util.ExibirMsg(Util.TipoMsg.Erro); } } catch { Util.ExibirMsg(Util.TipoMsg.Erro); } } }