private void Preencher_Grid() { try { this.Recarregar_Grid(); Creditos_Aprovados_DinheiroBUS busCreditosAprovadosDinheiro = new Creditos_Aprovados_DinheiroBUS(); if (this.radRomaneio.Checked) { if (this.txtRomaneio.Text == string.Empty) { MessageBox.Show("Informe o número do romaneio de venda.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtRomaneio.Focus(); return; } if (this.txtRomaneio.Text.ToInteger() == 0) { MessageBox.Show("Número do romaneio de venda inválido.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtRomaneio.Focus(); return; } this.Grid.DataSource = busCreditosAprovadosDinheiro.Consultar_DataTable_Creditos_Aprovados_Dinheiro( Exibicao_Listagem.Romaneio.DefaultInteger(), 0, this.txtRomaneio.Text.DefaultInteger(), 0, 0, 0, 0, 0, new DateTime(1900, 1, 1), new DateTime(1900, 1, 1), new DateTime(1900, 1, 1), new DateTime(1900, 1, 1), new DateTime(1900, 1, 1), new DateTime(1900, 1, 1)); } else { if (this.Validar_Filtro_Outros() == false) { return; } this.Grid.DataSource = busCreditosAprovadosDinheiro.Consultar_DataTable_Creditos_Aprovados_Dinheiro( this.cboTipoExibicao.SelectedValue.DefaultInteger(), this.cboLoja.SelectedValue.DefaultInteger(), 0, this.cboUsuarioAprovacao.SelectedValue.DefaultInteger(), this.txtValorInicial.Text.DefaultDecimal(), this.txtValorFinal.Text.DefaultDecimal(), this.txtValorIndevidoInicial.Text.DefaultDecimal(), this.txtValorIndevidoFinal.Text.DefaultDecimal(), (this.chkPeriodo.Checked && this.cboTipoPeriodo.SelectedValue.DefaultInteger() == Tipo_Data.Data_Geracao.DefaultInteger()) ? this.dtpDataInicial.Value : new DateTime(1900, 1, 1), (this.chkPeriodo.Checked && this.cboTipoPeriodo.SelectedValue.DefaultInteger() == Tipo_Data.Data_Geracao.DefaultInteger()) ? this.dtpDataFinal.Value : new DateTime(1900, 1, 1), (this.chkPeriodo.Checked && this.cboTipoPeriodo.SelectedValue.DefaultInteger() == Tipo_Data.Data_Liberacao.DefaultInteger()) ? this.dtpDataInicial.Value : new DateTime(1900, 1, 1), (this.chkPeriodo.Checked && this.cboTipoPeriodo.SelectedValue.DefaultInteger() == Tipo_Data.Data_Liberacao.DefaultInteger()) ? this.dtpDataFinal.Value : new DateTime(1900, 1, 1), (this.chkPeriodo.Checked && this.cboTipoPeriodo.SelectedValue.DefaultInteger() == Tipo_Data.Data_Aprovacao.DefaultInteger()) ? this.dtpDataInicial.Value : new DateTime(1900, 1, 1), (this.chkPeriodo.Checked && this.cboTipoPeriodo.SelectedValue.DefaultInteger() == Tipo_Data.Data_Aprovacao.DefaultInteger()) ? this.dtpDataFinal.Value : new DateTime(1900, 1, 1)); } if (this.Grid.Rows.Count == 0) { MessageBox.Show("Não há itens a serem exibidos.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { this.Grid.Focus(); } } catch (Exception) { throw; } }