Пример #1
0
        private void Preencher_Combo_Usuario_Aprovacao()
        {
            try
            {
                DataTable dttUsuarioAprovacao = new Creditos_Aprovados_DinheiroBUS().Consultar_DataTable_Usuarios_Credito_Aprovacao();

                Utilitario.Preencher_ComboBox_DataTable(ref this.cboUsuarioAprovacao, dttUsuarioAprovacao, "Usuario_Nome_Completo", "Usuario_Aprovacao_ID", "0", "Todos");
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        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;
            }
        }