|
@@ -50,42 +50,41 @@ namespace PRS.Mobile
|
|
Alignment = TextAlignment.Start
|
|
Alignment = TextAlignment.Start
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- (refresh) => App.Data.PurchaseOrders.Refresh(false),
|
|
|
|
|
|
+ (refresh) =>
|
|
|
|
+ {
|
|
|
|
+ var model = new PurchaseOrderModel(App.Data,
|
|
|
|
+ () => new Filter<PurchaseOrder>(x => x.IssuedDate).IsNotEqualTo(DateTime.MinValue)
|
|
|
|
+ .And(x=>x.ClosedDate).IsEqualTo(DateTime.MinValue)
|
|
|
|
+ .And(x=>x.CancelledDate).IsEqualTo(DateTime.MinValue)
|
|
|
|
+ .And(x=>x.Unreceived).IsNotEqualTo(FilterConstant.Null)) { FileName = "consigment_orders.index" };
|
|
|
|
+ return model.Refresh(false);
|
|
|
|
+ },
|
|
(orders) =>
|
|
(orders) =>
|
|
{
|
|
{
|
|
|
|
+ var model = new PurchaseOrderItemModel(App.Data,
|
|
|
|
+ () => new Filter<PurchaseOrderItem>(x => x.PurchaseOrderLink.ID).IsEqualTo(orders.FirstOrDefault()?.ID ?? Guid.Empty));
|
|
|
|
+ model.Refresh(false);
|
|
|
|
+ foreach (var item in model.Items)
|
|
|
|
+ {
|
|
|
|
+ var newitem = ViewModel.Items.AddItem();
|
|
|
|
+ newitem.Row.LoadValues(item.Row.Values);
|
|
|
|
+ }
|
|
|
|
+ Dispatcher.BeginInvokeOnMainThread(() =>
|
|
|
|
+ {
|
|
|
|
+ _itemsList.ItemsSource = null;
|
|
|
|
+ _itemsList.ItemsSource = ViewModel.Items;
|
|
|
|
+ });
|
|
DismissPopup();
|
|
DismissPopup();
|
|
- ShowPopup(() => SelectionView.Execute<PurchaseOrderItemShell>(
|
|
|
|
- (columns) =>
|
|
|
|
- {
|
|
|
|
- columns.Add(new MobileGridTextColumn<PurchaseOrderItemShell>()
|
|
|
|
- {
|
|
|
|
- Column = x => x.Description,
|
|
|
|
- Width = GridLength.Star,
|
|
|
|
- Caption = "Select Purchase Order",
|
|
|
|
- Alignment = TextAlignment.Start
|
|
|
|
- });
|
|
|
|
- columns.Add(new MobileGridDoubleColumn<PurchaseOrderItemShell>()
|
|
|
|
- {
|
|
|
|
- Column = x => x.Qty,
|
|
|
|
- Width = GridLength.Auto,
|
|
|
|
- Caption = "Qty",
|
|
|
|
- Format = "F2",
|
|
|
|
- Alignment = TextAlignment.Center
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- (refresh) =>
|
|
|
|
- {
|
|
|
|
- var model = new PurchaseOrderItemModel(App.Data,
|
|
|
|
- () => new Filter<PurchaseOrderItem>(x => x.PurchaseOrderLink.ID).IsEqualTo(orders.FirstOrDefault()?.ID ?? Guid.Empty));
|
|
|
|
- return model.Refresh(false);
|
|
|
|
- },
|
|
|
|
- (items) =>
|
|
|
|
- {
|
|
|
|
- DismissPopup();
|
|
|
|
- DoChanged(nameof(ViewModel.Items));
|
|
|
|
- }
|
|
|
|
- ));
|
|
|
|
}));
|
|
}));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void SelectPOItem_Clicked(object sender, EventArgs e)
|
|
|
|
+ {
|
|
|
|
+ if ((sender as MobileCard)?.BindingContext is PurchaseOrderItemShell item)
|
|
|
|
+ {
|
|
|
|
+ var page = new ConsignmentEditItem(item);
|
|
|
|
+ Navigation.PushAsync(page);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|