1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Linq;
- using Comal.Classes;
- using InABox.Core;
- using InABox.Mobile;
- using Xamarin.Forms;
- namespace PRS.Mobile
- {
- public class ShipmentSelectionPage : SelectionPage
- {
- public ShipmentSelectionPage(Action<ShipmentShell> action)
- : base(
- (string)"Select Rack",
- (SelectionPageMode)SelectionPageMode.Immediate,
- (columns, filters) =>
- {
- columns
- .BeginUpdate()
- .Clear()
- .Add(new MobileGridTextColumn<ShipmentShell>() { Column = x => x.Code, Width = GridLength.Auto })
- .Add(new MobileGridTextColumn<ShipmentShell>() { Column = x => x.Description, Width = GridLength.Star })
- .Add(new MobileGridIntegerColumn<ShipmentShell>() { Column = x => x.ItemCount, Width = GridLength.Auto, Caption = "#"})
- .EndUpdate();
- },
- (args) =>
- {
- return new ShipmentModel(App.Data, () => new Filter<Shipment>(x => x.Delivery.ID).IsEqualTo(Guid.Empty)
- .And(x => x.ItemCount).IsNotEqualTo(0)).Refresh(true);
- },
- (items) =>
- action?.Invoke(items.FirstOrDefault() as ShipmentShell)
- ) { }
- }
- }
|