private async void DestinationChangedCommandHandler() { if (!string.IsNullOrEmpty(Model.Destination)) { await _popupNavigation.PushAsync(new LoadingPopupPage()); var validUnit = await _commonService.ValidUnit(Model.Destination); await _popupNavigation.PopAllAsync(); if (validUnit.Response != null && validUnit.Response.Code == Model.Destination && validUnit.Response.Id != _userService.User.Unit.Id) { Model.UnitViewInfo = validUnit.Response; Model.AccessoryFocus(); } else { Model.UnitViewInfo = null; Model.ClearModel(); await _notificationService.NotifyAsync( ((validUnit.Response != null && validUnit.Response.Id == _userService.User.Unit.Id) ? "Unidade de destino deve ser diferente da unidade local." : $"Unidade {Model.Destination} inválida."), SoundEnum.Erros); } } }
private async void RequestPackingListAccessoryViewConfirmed(bool confirmed, PackingListViewInfoModel packingListViewInfo) { if (confirmed) { await SetPackingListViewInfo(packingListViewInfo); } else { Model.ClearModelAfterDetination(); Model.AccessoryFocus(); MenuAdtionalButtons = new Dictionary <string, DelegateCommand>(); } }
private void RequestPalletsViewConfirmed(bool confirmed, TransportAccessoryViewInfoModel transportAccessoryViewInfo) { if (confirmed) { Model.TransportAccessoryViewInfo = transportAccessoryViewInfo; GetPackingListAccessory(); } else { Model.ClearModelAfterDetination(); Model.AccessoryFocus(); MenuAdtionalButtons = new Dictionary <string, DelegateCommand>(); } }
private async Task SetPackingListViewInfo(PackingListViewInfoModel packingListViewInfo) { Model.PackingListViewInfo = packingListViewInfo; if (Model.PackingListViewInfo != null && Model.PackingListViewInfo.Id >= 0 && Model.PackingListViewInfo.Valid) { AddMenuAdtionalBunttons(); Model.Ctrc = Model.PackingListViewInfo.TotalBillOfLading.ToString(); Model.Pack = Model.PackingListViewInfo.TotalPack.ToString(); Model.CobolNumber = Model.PackingListViewInfo.CobolNumber; Model.DestinationIsReadOnly = Model.AccessoryIsReadOnly = true; Model.ReadingIsReadOnly = false; } else { MenuAdtionalButtons = new Dictionary <string, DelegateCommand>(); var msg = ((packingListViewInfo?.ExceptionMessage != null) ? packingListViewInfo.ExceptionMessage : "A requisição não pode ser completada."); await _notificationService.NotifyAsync(msg, SoundEnum.Erros); Model.AccessoryFocus(); } }