private void RemoveCashDrawList(ProductDataModel currency) { if (CashDrawModelList.Any(x => x.Tender.Equals(currency.Description))) { var cashDrawModel = CashDrawModelList.FirstOrDefault(x => x.Tender.Equals(currency.Description)); CashDrawModelList.Remove(cashDrawModel); } IsCompleteEnabled = IsCashTenderEmpty(); }
private void UpdateCashDrawList(ProductDataModel currency) { if (CashDrawModelList.Any(x => x.Tender.Equals(currency.Description))) { CashDrawModelList.FirstOrDefault(x => x.Tender.Equals(currency.Description)).Amount = currency.Quantity * currency.Value; } else { CashDrawModelList.Add(new CashDrawModel { Value = currency.Value.ToString(CultureInfo.InvariantCulture), Amount = currency.Value * currency.Quantity, Tender = currency.Description }); IsCompleteEnabled = IsCashTenderEmpty(); } }