|
@@ -19,8 +19,6 @@ namespace PRSDesktop
|
|
|
//public Dictionary<Object, Object> _Employees = new Dictionary<object, object>();
|
|
|
//public Dictionary<Object, Object> _Jobs = new Dictionary<object, object>();
|
|
|
|
|
|
-
|
|
|
- private readonly ComboBox _filter;
|
|
|
private readonly BitmapImage barcode = PRSDesktop.Resources.barcode.AsBitmapImage();
|
|
|
|
|
|
private bool bSplitting;
|
|
@@ -33,54 +31,6 @@ namespace PRSDesktop
|
|
|
|
|
|
public RequisitionGrid()
|
|
|
{
|
|
|
- var left = new Border
|
|
|
- {
|
|
|
- Height = 30,
|
|
|
- Width = 30,
|
|
|
- Margin = new Thickness(0, 0, 2, 2),
|
|
|
- BorderBrush = new SolidColorBrush(Colors.Gray),
|
|
|
- BorderThickness = new Thickness(0.75),
|
|
|
- Background = new SolidColorBrush(Colors.WhiteSmoke),
|
|
|
- CornerRadius = new CornerRadius(5, 0, 0, 0)
|
|
|
- };
|
|
|
- left.SetValue(DockPanel.DockProperty, Dock.Left);
|
|
|
-
|
|
|
- var right = new Border
|
|
|
- {
|
|
|
- Height = 30,
|
|
|
- Width = 30,
|
|
|
- Margin = new Thickness(2, 0, 0, 2),
|
|
|
- BorderBrush = new SolidColorBrush(Colors.Gray),
|
|
|
- BorderThickness = new Thickness(0.75),
|
|
|
- Background = new SolidColorBrush(Colors.WhiteSmoke),
|
|
|
- CornerRadius = new CornerRadius(0, 5, 0, 0)
|
|
|
- };
|
|
|
- right.SetValue(DockPanel.DockProperty, Dock.Right);
|
|
|
-
|
|
|
- _filter = new ComboBox
|
|
|
- {
|
|
|
- ItemsSource = new List<string>
|
|
|
- {
|
|
|
- "All Requisitions",
|
|
|
- "Unfilled Requisitions",
|
|
|
- "Requisitions needing Delivery",
|
|
|
- "Requisitions to be Archived"
|
|
|
- },
|
|
|
- Margin = new Thickness(0, 0, 0, 2),
|
|
|
- VerticalContentAlignment = VerticalAlignment.Center,
|
|
|
- HorizontalContentAlignment = HorizontalAlignment.Center,
|
|
|
- SelectedIndex = 2,
|
|
|
- Height = 30
|
|
|
- };
|
|
|
- _filter.SetValue(DockPanel.DockProperty, Dock.Left);
|
|
|
- _filter.SelectionChanged += (o, e) => Refresh(false, true);
|
|
|
-
|
|
|
- var header = new DockPanel();
|
|
|
- header.Children.Add(left);
|
|
|
- header.Children.Add(right);
|
|
|
- header.Children.Add(_filter);
|
|
|
- Header = header;
|
|
|
-
|
|
|
ActionColumns.Add(new DynamicImageColumn(DocumentsImage, DocumentsClick) { Position = DynamicActionColumnPosition.Start });
|
|
|
ActionColumns.Add(new DynamicImageColumn(FilledImage));
|
|
|
ActionColumns.Add(new DynamicImageColumn(DeliveryImage));
|
|
@@ -409,20 +359,6 @@ namespace PRSDesktop
|
|
|
protected override void Reload(Filters<Requisition> criteria, Columns<Requisition> columns, ref SortOrder<Requisition>? sort,
|
|
|
Action<CoreTable?, Exception?> action)
|
|
|
{
|
|
|
- // Unfilled
|
|
|
- if (_filter.SelectedIndex == 1)
|
|
|
- criteria.Add(new Filter<Requisition>(x => x.Filled).IsEqualTo(DateTime.MinValue));
|
|
|
-
|
|
|
- // Undelivered
|
|
|
- else if (_filter.SelectedIndex == 2)
|
|
|
- criteria.Add(new Filter<Requisition>(x => x.Archived).IsEqualTo(DateTime.MinValue).Or(x => x.Filled).IsEqualTo(DateTime.MinValue));
|
|
|
-
|
|
|
- // Unarchived
|
|
|
- else if (_filter.SelectedIndex == 3)
|
|
|
- criteria.Add(new Filter<Requisition>(x => x.StockUpdated).IsEqualTo(DateTime.MinValue).Or(x => x.Archived)
|
|
|
- .IsEqualTo(DateTime.MinValue)
|
|
|
- .Or(x => x.Filled).IsEqualTo(DateTime.MinValue));
|
|
|
-
|
|
|
sort = new SortOrder<Requisition>(x => x.Number, SortDirection.Descending);
|
|
|
|
|
|
base.Reload(criteria, columns, ref sort, action);
|