123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using InABox.Mobile;
- using Xamarin.Forms;
- using Xamarin.Forms.Xaml;
- namespace PRS.Mobile
- {
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class ConsignmentEditDetailsView
- {
- public ConsignmentEditDetailsView()
- {
- InitializeComponent();
- }
- public override void Refresh()
- {
- }
- private void SelectSupplier_Clicked(object sender, MobileButtonClickEventArgs args)
- {
- ShowPopup(() => SelectionView.Execute<SupplierShell>(
- (columns) =>
- {
- columns.Add(new MobileGridTextColumn<SupplierShell>()
- {
- Column = x => x.Name,
- Width = GridLength.Star,
- Caption = "Select Supplier",
- Alignment = TextAlignment.Start
- });
- },
- (refresh) => App.Data.Suppliers.Refresh(false),
- (suppliers) =>
- {
- ViewModel.Item.SupplierID = suppliers.FirstOrDefault()?.ID ?? Guid.Empty;
- ViewModel.Item.SupplierName = suppliers.FirstOrDefault()?.Name ?? string.Empty;
- DoChanged(nameof(ViewModel.Item), nameof(ConsignmentShell.SupplierName));
- DismissPopup();
- }));
- }
- private void SelectType_Clicked(object sender, MobileButtonClickEventArgs args)
- {
- ShowPopup(() => SelectionView.Execute<ConsignmentTypeShell>(
- (columns) =>
- {
- columns.Add(new MobileGridTextColumn<ConsignmentTypeShell>()
- {
- Column = x => x.Description,
- Width = GridLength.Star,
- Caption = "Select Type",
- Alignment = TextAlignment.Start
- });
- },
- (refresh) => App.Data.ConsignmentTypes.Refresh(false),
- (types) =>
- {
- ViewModel.Item.TypeID = types.FirstOrDefault()?.ID ?? Guid.Empty;
- ViewModel.Item.TypeDescription = types.FirstOrDefault()?.Description ?? string.Empty;
- DoChanged(nameof(ViewModel.Item), nameof(ConsignmentShell.TypeDescription));
- DismissPopup();
- }));
- }
- private void SelectETA_Clicked(object sender, MobileButtonClickEventArgs args)
- {
- ShowPopup(
- () =>
- {
- var selector = new MobileDateSelector();
- selector.Date = ViewModel.Item.EstimatedWarehouseArrival;
- selector.Changed += (o, changedArgs) =>
- {
- ViewModel.Item.EstimatedWarehouseArrival = changedArgs.Date;
- DismissPopup();
- };
- selector.Cancelled += (o, eventArgs) => DismissPopup();
- return selector;
- },
- new PopupManagerConfiguration()
- {
- Modal = true
- }
- );
- }
- private void Number_Changed(object sender, TextChangedEventArgs e)
- {
- DoChanged(nameof(ViewModel.Item), nameof(ConsignmentShell.Number));
- }
- private void Description_Changed(object sender, TextChangedEventArgs e)
- {
- DoChanged(nameof(ViewModel.Item), nameof(ConsignmentShell.Description));
- }
- private void SelectATA_Clicked(object sender, MobileButtonClickEventArgs args)
- {
- ShowPopup(
- () =>
- {
- var selector = new MobileDateSelector();
- selector.Date = ViewModel.Item.ActualWarehouseArrival;
- selector.Changed += (o, changedArgs) =>
- {
- ViewModel.Item.ActualWarehouseArrival = changedArgs.Date;
- DismissPopup();
- };
- selector.Cancelled += (o, eventArgs) => DismissPopup();
- return selector;
- },
- new PopupManagerConfiguration()
- {
- Modal = true
- }
- );
- }
- }
- }
|