Ejemplo n.º 1
0
        private void LLenarComboMeta()
        {
            var ListaColectas = ColectasBLL.GetList(p => true);

            MetaComboBox.DataSource    = ListaColectas;
            MetaComboBox.ValueMember   = "ColectasId";
            MetaComboBox.DisplayMember = "Descripcion";
        }
Ejemplo n.º 2
0
        private void ConsultarButton_Click(object sender, EventArgs e)
        {
            //Si el filtro de la fecha se encuentra marcado, va a tomar en cuenta le rango de fecha
            if (FechaCheckBox.Checked)
            {
                if (!String.IsNullOrWhiteSpace(CriterioTextBox.Text))
                {
                    switch (FiltroComboBox.SelectedIndex)
                    {
                    case 0:     //Aportes
                        lista = ColectasBLL.GetList(r => r.ColectasId == Utilidades.ToInt(CriterioTextBox.Text) && (r.Vence >= DesdeDateTimePicker.Value && r.Vence <= HastaDateTimePicker.Value));
                        break;

                    case 1:     //Persona
                        lista = ColectasBLL.GetList(r => r.Descripcion.Contains(CriterioTextBox.Text) && (r.Vence >= DesdeDateTimePicker.Value && r.Vence <= HastaDateTimePicker.Value));
                        break;
                    }
                }
                else
                {
                    lista = ColectasBLL.GetList(r => (r.Vence >= DesdeDateTimePicker.Value && r.Vence <= HastaDateTimePicker.Value));
                }
            }
            else
            {
                if (!String.IsNullOrWhiteSpace(CriterioTextBox.Text))
                {
                    switch (FiltroComboBox.SelectedIndex)
                    {
                    case 0:     //Aportes
                        lista = ColectasBLL.GetList(r => r.ColectasId == Utilidades.ToInt(CriterioTextBox.Text));
                        break;

                    case 1:     //Persona
                        lista = ColectasBLL.GetList(r => r.Descripcion.Contains(CriterioTextBox.Text) && (r.Vence >= DesdeDateTimePicker.Value && r.Vence <= HastaDateTimePicker.Value));
                        break;
                    }
                }
                //En caso de que no haya nada en el textBo
                else
                {
                    lista = ColectasBLL.GetList(r => true);
                }
            }


            ConsultaDataGridView.DataSource = null;
            ConsultaDataGridView.DataSource = lista;
        }