private async Task OnSubmit(PackReasonEventArgs arg) { if (_packReasonList.Sum(p => p.Quantity) + arg.Quantity > _line.ShippedQuantity.GetValueOrDefault()) { await Alert.ShowMessage(Translate.Get(AppResources.DrvPackingSlipError)); return; } //TODO: implement call. //Api.RepackPackingSlip(new RepackRequestModel //{ // PackingSlip = _line.PackingSlip.Key, // Account = _line.PackingSlip.Account.Key, // Branch = _line.PackingSlip.Branch.Code, // RecId = _line.PackingSlip.RecId.ToLong(), // SalesOrder = _line.PackingSlip.Order.Key, // Data = new List<RepackModel> // { // new RepackModel // { // LineItem = _line.Key, // Reasons = new List<PackReason> // { // arg.Reason. // } // } // } //}) PackReasonList.Add(arg); RaisePropertyChanged(nameof(AvailableQuantity)); ShowPopup = false; _packingReasonsChanged = true; }
private async Task OnQuantityChanged() { RaisePropertyChanged(nameof(AvailableQuantity)); if (_selectedDeliveredQuantity == (int)_line.ShippedQuantity) { PackReasonList.Clear(); return; } ShowPopup = true; }
private void OnDeleteReason(PackReasonEventArgs obj) { PackReasonList.Remove(obj); RaisePropertyChanged(nameof(AvailableQuantity)); _packingReasonsChanged = true; }