Example #1
0
        private void buscar_Click(object sender, EventArgs e)
        {
            Dictionary <String, String> like = new Dictionary <string, string>();
            Dictionary <String, Object> exac = new Dictionary <string, Object>();
            List <TextBox> noNulos           = FormHelper.getNoNulos(todos);

            foreach (TextBox tb in noNulos)
            {
                if (tb.Tag != null && tb.Tag.ToString() == "LIKE")
                {
                    like.Add(tb.Name, tb.Text);
                }
                else
                {
                    exac.Add(tb.Name, tb.Text);
                }
            }

            if (like.Count() == 0 && exac.Count() == 0)
            {
                cargarDataGrid();
                return;
            }

            List <Usuario> proveedores = data.FilterSelect(like, exac, out exError);

            if (exError == null)
            {
                dataGridProveedores.DataSource         = proveedores;
                dataGridProveedores.Columns[0].Visible = false;
            }
            else
            {
                MessageBox.Show("No se pudo obtener la lista de Usuarios, " + exError.Message);
            }
        }