public void GetListTest() { var lista = new List <Personas>(); lista = PersonasBLL.GetList(p => true); Assert.AreEqual(lista, lista); }
private void buttonBuscar_Click(object sender, EventArgs e) { List <Personas> Persona = new List <Personas>(); switch (comboBoxFiltrar.SelectedIndex) { case 0: Persona = PersonasBLL.GetList(i => i.Nombre == textBoxBuscar.Text); AddFiltrado(Persona); break; case 1: Persona = PersonasBLL.GetList(i => i.Apellidos == textBoxBuscar.Text); AddFiltrado(Persona); break; case 2: int Id = Int32.Parse(textBoxBuscar.Text); Persona = PersonasBLL.GetList(i => i.IdPersonas == Id); AddFiltrado(Persona); break; default: MessageBox.Show("Selecione un campo para filtrar"); break; } if (textBoxBuscar.Text == string.Empty) { dataGridViewClientes.Rows.Clear(); LlenaCampos(); } }
public void GetListTest() { var lista = new List <Personas>(); lista = PersonasBLL.GetList(p => true); Assert.IsNotNull(lista); }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Personas>(); string criterio = CriterioTextBox.Text.Trim(); if (criterio.Length > 0) { switch (FiltroComboBox.SelectedIndex) { case 0: listado = PersonasBLL.GetList(p => p.PersonaId == Utilities.ToInt(CriterioTextBox.Text)); break; // Al buscar en cualquier tabla con string, da error // case 1: // listado = PersonaBLL.GetList(p => p.Nombres.Contains(criterio, StringComparison.OrdinalIgnoreCase)); // break; } } else { listado = PersonasBLL.GetList(c => true); } DatosDataGrid.ItemsSource = null; DatosDataGrid.ItemsSource = listado; }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Persona>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroCombox.SelectedIndex) { //Todo case 0: listado = PersonasBLL.GetList(p => true); break; //Id case 1: int id = Convert.ToInt32(CriterioTextBox.Text); listado = PersonasBLL.GetList(p => p.Id == id); break; //Nombre case 2: listado = PersonasBLL.GetList(p => p.Nombre.Contains(CriterioTextBox.Text)); break; } listado = listado.Where(c => c.Fecha.Date >= DesdeDatePicker.SelectedDate && c.Fecha.Date <= HastaDatePicker.SelectedDate).ToList(); } else { listado = PersonasBLL.GetList(p => true); } ConsultaDataGrid.ItemsSource = null; ConsultaDataGrid.ItemsSource = listado; }
public void GetListTest() { List <Personas> persona = new List <Personas>(); persona = PersonasBLL.GetList(p => true); Assert.IsNotNull(persona); }
private void ConsultarButton_Click_1(object sender, RoutedEventArgs e) { var listado = new List <Personas>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltrarComboBox.SelectedIndex) { case 0: listado = PersonasBLL.GetList(p => true); break; case 1: int id; id = Convert.ToInt32(CriterioTextBox.Text); listado = PersonasBLL.GetList(p => p.PersonaId == id); break; case 2: listado = PersonasBLL.GetList(p => p.Nombre == CriterioTextBox.Text); break; } } else { listado = PersonasBLL.GetList(p => true); } ConsultaPersonasDataGrid.ItemsSource = null; ConsultaPersonasDataGrid.ItemsSource = listado; }
private void CargarResultados() { List <Persona> personasList = new List <Persona>(); if (!string.IsNullOrWhiteSpace(CriterioTextBox.Text)) { switch (FiltroComboBox.SelectedIndex) { case 0: //id int.TryParse(CriterioTextBox.Text, out int personaId); personasList = PersonasBLL.GetList(p => p.PersonaId == personaId); break; case 1: //Nombre personasList = PersonasBLL.GetList(p => p.Nombre.Contains(CriterioTextBox.Text)); break; } } else { personasList = PersonasBLL.GetList(p => true); } ResultadosDataGrid.ItemsSource = personasList; }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Persona>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroComboBox.SelectedIndex) { case 0: listado = PersonasBLL.GetList(p => true); break; case 1: int id = Convert.ToInt32(CriterioTextBox.Text); listado = PersonasBLL.GetList(p => p.PersonaID == id); break; case 2: listado = PersonasBLL.GetList(p => p.Nombre.Contains(CriterioTextBox.Text)); break; case 3: listado = PersonasBLL.GetList(p => p.Cedula.Contains(CriterioTextBox.Text)); break; case 4: listado = PersonasBLL.GetList(p => p.Direccion.Contains(CriterioTextBox.Text)); break; } } }
private void BuscarButton_Click(object sender, EventArgs e) { int id; if (FiltrarComboBox.SelectedIndex == 0) { id = int.Parse(CriterioTextBox.Text); filtrar = t => t.IdPersona == id; } else if (FiltrarComboBox.SelectedIndex == 1) { filtrar = t => t.Nombre.Contains(CriterioTextBox.Text); } else if (FiltrarComboBox.SelectedIndex == 2) { filtrar = t => t.Apellido.Contains(CriterioTextBox.Text); } else if (FiltrarComboBox.SelectedIndex == 3) { filtrar = t => t.Telefono.Contains(CriterioTextBox.Text); } else if (FiltrarComboBox.SelectedIndex == 4) { filtrar = t => t.Direccion.Contains(CriterioTextBox.Text); } else if (FiltrarComboBox.SelectedIndex == 5) { filtrar = t => t.Email.Contains(CriterioTextBox.Text); } TiposDePersonasDataGridView.DataSource = PersonasBLL.GetList(filtrar); }
public rPrestamos() { InitializeComponent(); PersonaIdComboBox.ItemsSource = PersonasBLL.GetList(p => true); PersonaIdComboBox.SelectedValuePath = "PersonaId"; PersonaIdComboBox.DisplayMemberPath = "Nombres"; this.DataContext = Prestamos; }
private void LlenarComboPersonas() { var ListaPersonas = PersonasBLL.GetList(p => true); PersonaComboBox.DataSource = ListaPersonas; PersonaComboBox.ValueMember = "PersonaId"; PersonaComboBox.DisplayMember = "Nombres"; }
private void LlenarComboBox() { var listado = new List <Persona>(); listado = PersonasBLL.GetList(p => true); UsuariocomboBox.DataSource = listado; UsuariocomboBox.DisplayMember = "Usuario"; UsuariocomboBox.ValueMember = "UsuarioId"; }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { List <Persona> listado = new List <Persona>(); listado = PersonasBLL.GetList(persona => true); ConsultaDataGrid.ItemsSource = null; ConsultaDataGrid.ItemsSource = listado; }
public rPrestamos() { InitializeComponent(); PersonaIdComboBox.ItemsSource = PersonasBLL.GetList(p => true); PersonaIdComboBox.SelectedValuePath = "PersonaId"; PersonaIdComboBox.DisplayMemberPath = "Nombres"; prestamos.Monto += prestamos.Balance; this.DataContext = prestamos; // Personas personas = new Personas(); }
private void BuscarButton_Click(object sender, EventArgs e) { //Si el filtro de la fecha se encuentra marcado, va a tomar en cuenta le rango de fecha if (UsarCheckBox.Checked) { if (!String.IsNullOrWhiteSpace(CriterioTextBox.Text)) { switch (FiltroComboBox.SelectedIndex) { case 0: //CategoriaId lista = PersonasBLL.GetList(r => r.PersonaId == Utilidades.ToInt(CriterioTextBox.Text) && (r.Fecha >= DesdeDateTimePicker.Value && r.Fecha <= HastaDateTimePicker.Value)); break; case 1: //Nombre lista = PersonasBLL.GetList(r => r.Nombres.Contains(CriterioTextBox.Text) && (r.Fecha >= DesdeDateTimePicker.Value && r.Fecha <= HastaDateTimePicker.Value)); break; } } else { lista = PersonasBLL.GetList(r => (r.Fecha >= DesdeDateTimePicker.Value && r.Fecha <= HastaDateTimePicker.Value)); } } else { if (!String.IsNullOrWhiteSpace(CriterioTextBox.Text)) { switch (FiltroComboBox.SelectedIndex) { case 0: //PersonaId lista = PersonasBLL.GetList(r => r.PersonaId == Utilidades.ToInt(CriterioTextBox.Text)); break; case 1: //Nombre lista = PersonasBLL.GetList(r => r.Nombres.Contains(CriterioTextBox.Text)); break; } } //En caso de que no haya nada en el textBox, se imprimirán todos los categorias else { lista = PersonasBLL.GetList(r => true); } } ConsultaDataGridView.DataSource = null; ConsultaDataGridView.DataSource = lista; }
private void CargarResultados() { var listado = new List <Persona>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroComboBox.SelectedIndex) { case 0: //Todo listado = PersonasBLL.GetList(p => true); break; case 1: //ID int id; int.TryParse(CriterioTextBox.Text, out id); listado = PersonasBLL.GetList(p => p.PersonaID == id); break; case 2: //Nombre listado = PersonasBLL.GetList(p => p.Nombre.Contains(CriterioTextBox.Text)); break; case 3: //Cédula listado = PersonasBLL.GetList(p => p.Cedula.Contains(CriterioTextBox.Text)); break; case 4: //Dirección listado = PersonasBLL.GetList(p => p.Direccion.Contains(CriterioTextBox.Text)); break; } if (!string.IsNullOrWhiteSpace(DesdeDatePicker.SelectedDate.ToString()) && !string.IsNullOrWhiteSpace(HastaDatePicker.SelectedDate.ToString())) { listado = listado.Where(p => p.FechaNacimiento >= DesdeDatePicker.SelectedDate && p.FechaNacimiento <= HastaDatePicker.SelectedDate).ToList(); } } else { listado = PersonasBLL.GetList(p => true); if (!string.IsNullOrWhiteSpace(DesdeDatePicker.SelectedDate.ToString()) && !string.IsNullOrWhiteSpace(HastaDatePicker.SelectedDate.ToString())) { listado = listado.Where(p => p.FechaNacimiento >= DesdeDatePicker.SelectedDate && p.FechaNacimiento <= HastaDatePicker.SelectedDate).ToList(); } } ResultadosDataGrid.ItemsSource = listado; //ResultadosDataGrid.ItemsSource = null; }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Personas>(); if (CriterioTextBox.Text.Trim().Length > 0) { listado = PersonasBLL.GetList(p => p.Nombres.Contains(CriterioTextBox.Text)); } else { listado = PersonasBLL.GetList(p => true); } ConsultaDataGrid.ItemsSource = listado; }
private void ButtonConsultar_Click(object sender, RoutedEventArgs e) { var listado = new List <Personas>(); if (TextBoxCriterio.Text.Trim().Length > 0) { listado = PersonasBLL.GetList(p => true); } else { listado = PersonasBLL.GetList(p => true); } ConsultaDataGridView.ItemsSource = listado; //ConsultaDataGridView.ItemsSource = null; }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var Listado = new List <Personas>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroComboBox.SelectedIndex) { case 0: //Todo Listado = PersonasBLL.GetList(p => true); break; case 1: //Id try { int id = Convert.ToInt32(CriterioTextBox.Text); Listado = PersonasBLL.GetList(p => p.PersonaId == id); MessageBox.Show("ID"); } catch (FormatException) { MessageBox.Show("Por favor, ingrese un ID valido"); } break; case 2: //Nombre Listado = PersonasBLL.GetList(p => p.Nombres.Contains(CriterioTextBox.Text)); break; case 3: //Cedula Listado = PersonasBLL.GetList(p => p.Cedula.Contains(CriterioTextBox.Text)); break; case 4: //Direccion Listado = PersonasBLL.GetList(p => p.Direccion.Contains(CriterioTextBox.Text)); break; } Listado = Listado.Where(c => c.FechaNacimiento.Date >= DesdeDataPicker.SelectedDate.Value && c.FechaNacimiento.Date <= HastaDataPicker.SelectedDate.Value).ToList(); } else { Listado = PersonasBLL.GetList(p => true); } ConsultaDataGrid.ItemsSource = null; ConsultaDataGrid.ItemsSource = Listado; }
public void GetListTest() { bool paso; var lista = PersonasBLL.GetList(x => true); if (lista != null) { paso = true; } else { paso = false; } Assert.AreEqual(paso, true); }
private void ConsultaButton_Click(object sender, EventArgs e) { var listado = new List <Persona>(); if (CriteriosTextBox.Text.Trim().Length > 0) { switch (FiltrarComboBox.SelectedIndex) { case 0: listado = PersonasBLL.GetList(p => true); break; case 1: int id = Convert.ToInt32(CriteriosTextBox.Text); listado = PersonasBLL.GetList(P => P.UsuarioId == id); break; case 2: listado = PersonasBLL.GetList(p => p.Nombres.Contains(CriteriosTextBox.Text)); break; case 3: listado = PersonasBLL.GetList(p => p.Email.Contains(CriteriosTextBox.Text)); break; case 4: listado = PersonasBLL.GetList(p => p.NivelUsuario.Contains(CriteriosTextBox.Text)); break; case 5: listado = PersonasBLL.GetList(p => p.Usuario.Contains(CriteriosTextBox.Text)); break; case 6: listado = PersonasBLL.GetList(p => p.Clave.Contains(CriteriosTextBox.Text)); break; } listado = listado.Where(c => c.FechaIngreso.Date >= DesdedateTimePicker.Value.Date && c.FechaIngreso.Date <= HastadateTimePicker.Value.Date).ToList(); } else { listado = PersonasBLL.GetList(p => true); } ConsultaDataGridView.DataSource = null; ConsultaDataGridView.DataSource = listado; }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var Listado = new List <Personas>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroComboBox.SelectedIndex) { //Todo case 0: Listado = PersonasBLL.GetList(p => true); break; //ID case 1: int id = Convert.ToInt32(CriterioTextBox.Text); Listado = PersonasBLL.GetList(p => p.PersonaId == id); break; //Nombre case 2: Listado = PersonasBLL.GetList(p => p.Nombres.Contains(CriterioTextBox.Text)); break; //Cedula case 3: Listado = PersonasBLL.GetList(p => p.Cedula.Contains(CriterioTextBox.Text)); break; //Direccion case 4: Listado = PersonasBLL.GetList(p => p.Direccion.Contains(CriterioTextBox.Text)); break; } Listado = Listado.Where(c => c.FechaNacimiento.Date >= DesdeDatePicker.SelectedDate && c.FechaNacimiento.Date <= HastaDatePicker.SelectedDate).ToList(); } else { Listado = PersonasBLL.GetList(p => true); } ConsultaDataGrid.ItemsSource = null; ConsultaDataGrid.ItemsSource = Listado; }
public void GetListTest() { bool Lista; List <Personas> List = new List <Personas>(); List = PersonasBLL.GetList(P => true); if (List != null) { Lista = true; } else { Lista = false; } Assert.IsTrue(Lista); }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Personas>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltrarComboBox.SelectedIndex) { case 0: listado = PersonasBLL.GetList(p => true); break; case 1: int id = Convert.ToInt32(CriterioTextBox.Text); listado = PersonasBLL.GetList(p => p.PersonaId == id); break; case 2: listado = PersonasBLL.GetList(p => p.Nombre.Contains(CriterioTextBox.Text)); break; case 3: listado = PersonasBLL.GetList(p => p.Cedula.Contains(CriterioTextBox.Text)); break; case 4: listado = PersonasBLL.GetList(p => p.Direccion.Contains(CriterioTextBox.Text)); break; } if (DesdeDatePicker.SelectedDate != null && HastaDatePicker.SelectedDate != null) { listado = listado.Where(c => c.FechaNacimiento.Date >= DesdeDatePicker.SelectedDate.Value.Date && c.FechaNacimiento.Date <= HastaDatePicker.SelectedDate.Value.Date).ToList(); } } else { listado = PersonasBLL.GetList(p => true); } ConsultaDataGrid.ItemsSource = listado; }
private void BotonConsultar_Click(object sender, RoutedEventArgs e) { var Listado = new List <Personas>(); if (TextBoxCriterio.Text.Trim().Length > 0) { switch (ComboBoxFiltrar.SelectedIndex) { case 0: //Todo Listado = PersonasBLL.GetList(p => true); break; case 1: //Id int Id = Convert.ToInt32(TextBoxCriterio.Text); Listado = PersonasBLL.GetList(p => p.PersonaId == Id); break; case 2: //Nombre Listado = PersonasBLL.GetList(p => p.Nombre.Contains(TextBoxCriterio.Text)); break; case 3: //Cedula Listado = PersonasBLL.GetList(p => p.Cedula.Contains(TextBoxCriterio.Text)); break; case 4: //Direccion Listado = PersonasBLL.GetList(p => p.Direccion.Contains(TextBoxCriterio.Text)); break; } Listado = Listado.Where(c => c.FechaNacimiento.Date >= DesdeDataPicker.SelectedDate && c.FechaNacimiento.Date <= HastaDataPicker.SelectedDate).ToList(); } else { Listado = PersonasBLL.GetList(p => true); } DataGridConsulta.ItemsSource = Listado; DataGridConsulta.ItemsSource = null; }
private void BuscarButton_Click(object sender, RoutedEventArgs e) { Datos.ItemsSource = null; var listado = new List <Personas>(); if (DesdeDate.SelectedDate != null) { listado = PersonasBLL.GetList(c => c.Fecha.Date >= DesdeDate.SelectedDate); } else { listado = PersonasBLL.GetList(c => true); } if (HastaDate.SelectedDate != null) { listado = PersonasBLL.GetList(c => c.Fecha.Date <= HastaDate.SelectedDate); } else { listado = PersonasBLL.GetList(c => true); } Datos.ItemsSource = listado; }
private void buscarbutton_Click(object sender, EventArgs e) { int id; String Nombre; if (FiltrarComboBox.SelectedIndex == 0) { id = int.Parse(CriterioTextBox.Text); filter = t => t.personaID == id; } if (FiltrarComboBox.SelectedIndex == 1) { Nombre = CriterioTextBox.Text; filter = t => t.nombre == Nombre; } if (FiltrarComboBox.SelectedIndex == 2) { filter = t => (t.fecha >= FechaInicialDateTimePicker.Value) && (t.fecha <= FechaFinalDateTimePicker.Value); } ConsultarDataGridView.DataSource = PersonasBLL.GetList(filter); }
public void GetListTest() { var lista = PersonasBLL.GetList(x => true); Assert.IsNotNull(lista); }
private void ImprimirButton_Click(object sender, EventArgs e) { ImprimirPersonas ip = new ImprimirPersonas(PersonasBLL.GetList(filtrar)); ip.Show(); }