private void ShowOrder(Item order) { NavData <MobileData> navData = new NavData <MobileData>(); if (order.OrderId == _navData.Data.Order.ID) { navData.Data = _mobileData; navData.OtherData["DataChunk"] = navData.GetDataChunk(); } else { navData.Data = _navData.GetAdditionalInstructions().FirstOrDefault(md => md.Order.ID == order.OrderId); navData.OtherData["DataChunk"] = navData.GetAdditionalDataChunk(navData.Data); } navData.OtherData["Order"] = order; _navigationService.ShowModalViewModel <OrderViewModel, bool>(navData, (modified) => { if (modified) { } } ); }
public async Task AdvanceConfirmTimesAsync() { if (this.IsProgressing) { return; } this.IsProgressing = true; try { _navData.Data.OnSiteDateTime = OnSiteDateTime; _navData.Data.CompleteDateTime = CompleteDateTime; var additionalInstructions = _navData.GetAdditionalInstructions(); foreach (var instruction in additionalInstructions) { instruction.OnSiteDateTime = OnSiteDateTime; instruction.CompleteDateTime = CompleteDateTime; } await _navigationService.MoveToNextAsync(_navData); } finally { this.IsProgressing = false; } }
public async Task Init(Guid navID) { _navData = _navigationService.GetNavData <MobileData>(navID); _mobileData = _navData.Data; _additionalInstructions = _navData.GetAdditionalInstructions(); await this.BuildDamageStatusesAsync(); this.CreateSections(); }
public async Task Init(Guid navID) { DoneButtonEnabled = false; _navData = _navigationService.GetNavData <MobileData>(navID); this.MessageId = navID; _additionalInstructions = _navData.GetAdditionalInstructions(); _appProfile = (await _repositories.ApplicationRepository.GetAllAsync()).First(); await this.GetDeliveryInstructionsAsync(); DoneButtonEnabled = true; }
public override Task CheckInstructionNotificationAsync(Messages.GatewayInstructionNotificationMessage message) { return(this.RespondToInstructionNotificationAsync(message, _navData, () => { _mobileData = _navData.Data; _additionalInstructions = _navData.GetAdditionalInstructions(); InvokeOnMainThread(() => { CreateSections(); RaiseAllPropertiesChanged(); }); })); }
private void DoDoneCommand() { var selectedInstructionIDs = this.DeliveryInstructions.Where(di => di.IsSelected).Select(di => di.InstructionID).ToList(); var additionalInstructions = _navData.GetAdditionalInstructions(); // work out which instructions no longer are selected and remove them var instructionsToRemove = additionalInstructions.Where(ai => !selectedInstructionIDs.Contains(ai.ID)).ToList();; // work out which newly selected instructions need to be added var instructionsToAdd = this.DeliveryInstructions.Where(di => di.IsSelected && !additionalInstructions.Any(ai => ai.ID == di.InstructionID)).ToList(); foreach (var item in instructionsToRemove) { additionalInstructions.Remove(item); } foreach (var item in instructionsToAdd) { additionalInstructions.Add(item.MobileData); } ReturnResult(true); }