Ejemplo n.º 1
0
        private void btn_refresh_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(tb_search.Text))
            {
                return;
            }
            if (DatePicker.SelectedDate == null)
            {
                return;
            }

            DataGrid_Shipments.ItemsSource = null;
            DataGrid_Shipments.ItemsSource = cb_sort.SelectedIndex switch
            {
                0 => _shipmentController.GetShipments(DatePicker.SelectedDate.Value),
                1 => _shipmentController.GetShipmentsFactReg(DatePicker.SelectedDate.Value),
                2 => _shipmentController.GetShipmentsArrive(DatePicker.SelectedDate.Value),
                3 => _shipmentController.GetShipmentsLeft(DatePicker.SelectedDate.Value),
                _ => _shipmentController.GetShipments(DatePicker.SelectedDate.Value)
            };
        }