private void buttonBuscar_click(object sender, EventArgs e) { String mail = textBox3.Text.Trim(); String nroDoc = textBox4.Text.Trim(); KeyValuePair <String, Boolean> estado = new KeyValuePair <String, Boolean>(); estado = new KeyValuePair <String, Boolean>("Habilitado", true); String tipoDoc = ""; RepositorioCliente repositorioClientes = new RepositorioCliente(); if (comboBoxTipoDoc.SelectedItem != null) { tipoDoc = (String)comboBoxTipoDoc.SelectedItem; } List <Cliente> clientes = repositorioClientes.getByQuery("", "", tipoDoc, nroDoc, estado, mail); //MEJORA DE PERFORMANCE DEL DGV dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing; dataGridView1.RowHeadersVisible = false; dataGridView1.DataSource = clientes; dataGridView1.RowHeadersVisible = true; //ESTO LO TENGO QUE HACER PARA QUE NO APAREZCA SIEMPRE SELECCIONADO EL PRIMER ITEM dataGridView1.CurrentCell = null; dataGridView1.ClearSelection(); //ESTO ES PARA QUE ME ACTUALICE LA LISTA DE DOCUMENTOS POSIBLES RepositorioIdentidad repoIdentidad = new RepositorioIdentidad(); comboBoxTipoDoc.DataSource = repoIdentidad.getAllTiposDocsClientes(); comboBoxTipoDoc.SelectedValue = ""; }
private void ListadoClientes_Load(object sender, EventArgs e) { dataGridView1.DataSource = null; RepositorioIdentidad repoIdentidad = new RepositorioIdentidad(); comboBoxTipoDoc.ValueMember = "Value"; comboBoxTipoDoc.DisplayMember = "Key"; comboBoxTipoDoc.DataSource = repoIdentidad.getAllTiposDocsClientes(); comboBoxTipoDoc.SelectedValue = ""; }
private void limpiarBusquedaYResultados() { textBox3.Text = ""; textBox4.Text = ""; comboBoxTipoDoc.SelectedValue = ""; dataGridView1.DataSource = null; this.botonReservar.Enabled = false; //ESTO ES PARA QUE ME ACTUALICE LA LISTA DE DOCUMENTOS POSIBLES RepositorioIdentidad repoIdentidad = new RepositorioIdentidad(); comboBoxTipoDoc.DataSource = repoIdentidad.getAllTiposDocsClientes(); comboBoxTipoDoc.SelectedValue = ""; }
private void button2_Click(object sender, EventArgs e) { botonBuscar.Enabled = false; String nombre = textBox1.Text.Trim(); String apellido = textBox2.Text.Trim(); String mail = textBox3.Text.Trim(); String nroDoc = textBox4.Text.Trim(); KeyValuePair <String, Boolean> estado = new KeyValuePair <String, Boolean>(); String tipoDoc = ""; RepositorioCliente repositorioClientes = new RepositorioCliente(); if (comboBoxEstados.SelectedItem != null) { estado = (KeyValuePair <String, Boolean>)comboBoxEstados.SelectedItem; } if (comboBoxTipoDoc.SelectedItem != null) { tipoDoc = (String)comboBoxTipoDoc.SelectedItem; } List <Cliente> clientes = repositorioClientes.getByQuery(nombre, apellido, tipoDoc, nroDoc, estado, mail); //MEJORA DE PERFORMANCE DEL DGV dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing; dataGridView1.RowHeadersVisible = false; dataGridView1.DataSource = clientes; dataGridView1.RowHeadersVisible = true; //ESTO LO TENGO QUE HACER PARA QUE NO APAREZCA SIEMPRE SELECCIONADO EL PRIMER ITEM dataGridView1.CurrentCell = null; dataGridView1.ClearSelection(); //PONGO ESTO ACA PARA QUE DESPUES DE DAR DE ALTA, MODIFICAR O DAR DE BAJA //Y SE VUELVA A CARGAR LA LISTA, NO SE PUEDA MODIFICAR O DAR DE BAJA //UN CLIENTE NULL... this.button4.Enabled = false; this.button5.Enabled = false; //ESTO ES PARA QUE ME ACTUALICE LA LISTA DE DOCUMENTOS POSIBLES RepositorioIdentidad repoIdentidad = new RepositorioIdentidad(); comboBoxTipoDoc.DataSource = repoIdentidad.getAllTiposDocsClientes(); comboBoxTipoDoc.SelectedValue = ""; botonBuscar.Enabled = true; }
private void ListadoClientes_Load(object sender, EventArgs e) { dataGridView1.DataSource = null; List <KeyValuePair <String, Boolean> > estados = new List <KeyValuePair <String, Boolean> >(); estados.Add(new KeyValuePair <String, Boolean>("Habilitado", true)); estados.Add(new KeyValuePair <String, Boolean>("Inhabilitado", false)); comboBoxEstados.ValueMember = "Value"; comboBoxEstados.DisplayMember = "Key"; comboBoxEstados.DataSource = estados; comboBoxEstados.SelectedValue = ""; RepositorioIdentidad repoIdentidad = new RepositorioIdentidad(); comboBoxTipoDoc.ValueMember = "Value"; comboBoxTipoDoc.DisplayMember = "Key"; comboBoxTipoDoc.DataSource = repoIdentidad.getAllTiposDocsClientes(); comboBoxTipoDoc.SelectedValue = ""; }