public rEntrada() { InitializeComponent(); DataContext = Entrada; JuegoIdComboBox.ItemsSource = JuegosBLL.GetList(x => true); JuegoIdComboBox.SelectedValuePath = "JuegoId"; JuegoIdComboBox.DisplayMemberPath = "Descripcion"; }
public RegistroEntradas() { InitializeComponent(); JuegoIdComboBox.ItemsSource = JuegosBLL.GetList(); JuegoIdComboBox.SelectedValuePath = "JuegoId"; JuegoIdComboBox.DisplayMemberPath = "Descripcion"; Entrada = new Entradas(); this.DataContext = Entrada; }
public rPrestamos() { InitializeComponent(); DataContext = Prestamo; JuegoIdComboBox.ItemsSource = JuegosBLL.GetList(x => true); JuegoIdComboBox.SelectedValuePath = "JuegoId"; JuegoIdComboBox.DisplayMemberPath = "Descripcion"; AmigoComboBox.ItemsSource = AmigosBLL.GetList(x => true); AmigoComboBox.SelectedValuePath = "AmigoId"; AmigoComboBox.DisplayMemberPath = "Nombre"; }
public registroPrestamos() { InitializeComponent(); Prestamo = new Prestamos(); AmigoComboBox.ItemsSource = AmigosBLL.GetList(); AmigoComboBox.SelectedValuePath = "AmigoId"; AmigoComboBox.DisplayMemberPath = "Nombres"; JuegoComboBox.ItemsSource = JuegosBLL.GetList(); JuegoComboBox.SelectedValuePath = "JuegoId"; JuegoComboBox.DisplayMemberPath = "Descripcion"; this.DataContext = Prestamo; }
public rEntradas() { InitializeComponent(); this.DataContext = entradas; var Lista = JuegosBLL.GetList(x => true); this.JuegoIdComboBox.ItemsSource = Lista; this.JuegoIdComboBox.SelectedValuePath = "JuegoId"; this.JuegoIdComboBox.DisplayMemberPath = "Descripcion"; if (Lista.Count > 0) { this.JuegoIdComboBox.SelectedIndex = 0; } }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Juegos>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroComboBox.SelectedIndex) { case 0: try { listado = JuegosBLL.GetList(e => e.JuegoId == Utilidades.ToInt(CriterioTextBox.Text)); } catch (FormatException) { MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning); } break; case 1: try { listado = JuegosBLL.GetList(e => e.Descripcion.Contains(CriterioTextBox.Text)); } catch (FormatException) { MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning); } break; } } else { listado = JuegosBLL.GetList(c => true); } if (DesdeDatePicker.SelectedDate != null) { listado = JuegosBLL.GetList(c => c.FechaCompra.Date >= DesdeDatePicker.SelectedDate); } if (HastaDatePicker.SelectedDate != null) { listado = JuegosBLL.GetList(c => c.FechaCompra.Date <= HastaDatePicker.SelectedDate); } DatosDataGrid.ItemsSource = null; DatosDataGrid.ItemsSource = listado; }
private void ConsultarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Juegos>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroComboBox.SelectedIndex) { case 0: listado = JuegosBLL.GetList(e => true); break; case 1: listado = JuegosBLL.GetList(e => e.JuegoId == Convert.ToInt32(CriterioTextBox.Text)); break; case 2: listado = JuegosBLL.GetList(e => e.Descripcion.Contains(CriterioTextBox.Text)); break; case 3: listado = JuegosBLL.GetList(e => e.Precio == Convert.ToDecimal(CriterioTextBox.Text)); break; case 4: listado = JuegosBLL.GetList(e => e.Existencia == Convert.ToInt32(CriterioTextBox.Text)); break; } } else { listado = JuegosBLL.GetList(c => true); } if (DesdeDataPicker.SelectedDate != null) { listado = JuegosBLL.GetList(c => c.FechaCompra.Date >= DesdeDataPicker.SelectedDate); } if (HastaDatePicker.SelectedDate != null) { listado = JuegosBLL.GetList(c => c.FechaCompra.Date <= HastaDatePicker.SelectedDate); } DatosDataGrid.ItemsSource = null; DatosDataGrid.ItemsSource = listado; }
private void BuscarButton_Click(object sender, RoutedEventArgs e) { var listado = new List <Juegos>(); if (CriterioTextBox.Text.Trim().Length > 0) { switch (FiltroComboBox.SelectedIndex) { case 0: //JuegoId listado = JuegosBLL.GetList(j => j.JuegoId == Utilidades.ToInt(CriterioTextBox.Text)); break; case 1: //Descripcion listado = JuegosBLL.GetList(j => j.Descripcion.Contains(CriterioTextBox.Text, StringComparison.OrdinalIgnoreCase)); break; case 2: //Precio listado = JuegosBLL.GetList(j => j.Precio == Utilidades.ToInt(CriterioTextBox.Text)); break; case 3: //Existencia listado = JuegosBLL.GetList(j => j.Existencia == Utilidades.ToInt(CriterioTextBox.Text)); break; } } else { listado = JuegosBLL.GetList(c => true); } if (DesdeDataPicker.SelectedDate != null) { listado = JuegosBLL.GetList(j => j.FechaCompra.Date >= DesdeDataPicker.SelectedDate); } if (HastaDatePicker.SelectedDate != null) { listado = JuegosBLL.GetList(j => j.FechaCompra.Date <= HastaDatePicker.SelectedDate); } DatosDataGrid.ItemsSource = null; DatosDataGrid.ItemsSource = listado; }
private void BuscarButton_Click(object sender, RoutedEventArgs e) { Datos.ItemsSource = null; var listado = new List <Juegos>(); if (DesdeDate.SelectedDate != null) { listado = JuegosBLL.GetList(c => c.FechaCompra.Date >= DesdeDate.SelectedDate); } else { listado = JuegosBLL.GetList(c => true); } if (HastaDate.SelectedDate != null) { listado = JuegosBLL.GetList(c => c.FechaCompra.Date <= HastaDate.SelectedDate); } else { listado = JuegosBLL.GetList(c => true); } Datos.ItemsSource = listado; }