| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using Comal.Classes;
- using InABox.Clients;
- using InABox.Core;
- using InABox.Mobile;
- using Xamarin.Forms;
- using Xamarin.Forms.Xaml;
- namespace PRS.Mobile
- {
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class ManufacturingPacketEditDetailsView
- {
-
- public ManufacturingPacketEditDetailsView()
- {
- InitializeComponent();
- }
- public override void Refresh()
- {
- LoadIssues();
- LoadStages();
- LoadOrders();
- }
- private void LoadOrders()
- {
- var poitem = ViewModel.OrderItems.FirstOrDefault();
- ETAFrame.IsVisible = poitem != null;
- if (poitem != null)
- {
- if (!poitem.ReceivedDate.IsEmpty())
- ETALbl.Text = $"Item received from {poitem.SupplierName} on {poitem.ReceivedDate:dd MMM yy}";
- else if (!poitem.EstimatedWarehouseArrival.IsEmpty())
- ETALbl.Text =
- $"Item on order from {poitem.SupplierName} (ETA: {poitem.EstimatedWarehouseArrival:dd MMM yy})";
- else
- ETALbl.Text = $"Item on order from {poitem.SupplierName} (unknown ETA)";
- }
- }
- private void LoadStages()
- {
- _stages.Columns
- .BeginUpdate()
- .Clear()
- .Add(new MobileGridTextColumn<ManufacturingPacketStageShell>()
- {
- Column = x => x.ManufacturingSectionLinkName, Width = GridLength.Star, Caption = "Section Name"
- })
- .Add(new MobileGridDateColumn<ManufacturingPacketStageShell>()
- { Column = x => x.Started, Width = GridLength.Auto })
- .Add(new MobileGridDateColumn<ManufacturingPacketStageShell>()
- { Column = x => x.Completed, Width = GridLength.Auto })
- .Add(new MobileGridDoubleColumn<ManufacturingPacketStageShell>()
- { Column = x => x.PercentageComplete, Width = GridLength.Auto, Caption = "%" })
- .EndUpdate();
- _stages.ItemsSource = ViewModel.Stages.Items;
- }
- private void LoadIssues()
- {
- IssuesFrame.IsVisible = !String.IsNullOrWhiteSpace(ViewModel.Item.Issues);
- IssuesLbl.Text = ViewModel.Item.Issues;
- IssuesTitle.IsVisible = IssuesFrame.IsVisible;
- }
- }
- }
|