Ejemplo n.º 1
0
        private async Task GetCashDrawTypes()
        {
            var response = await _cashBusinessLogic.GetCashDrawType();

            var tempCashDrawType = new CashDrawTypesModel();

            IsBillsVisible = response.Bills.Count > 0;
            IsRollsVisible = response.Coins.Count > 0;

            #region populate Coins
            foreach (var coin in response.Coins)
            {
                tempCashDrawType.Coins.Add(new ProductDataModel
                {
                    Description = coin.CurrencyName,
                    StockCode   = coin.CurrencyName,
                    Quantity    = 0,
                    ImageSource = new BitmapImage
                    {
                        UriSource = Helper.IsValidURI(coin.Image) ? new Uri(coin.Image) :
                                    null
                    },
                    Value = coin.Value
                });
            }
            #endregion

            #region populate Bills
            foreach (var bill in response.Bills)
            {
                tempCashDrawType.Bills.Add(new ProductDataModel
                {
                    Description = bill.CurrencyName,
                    StockCode   = bill.CurrencyName,
                    Quantity    = 0,
                    ImageSource = new BitmapImage
                    {
                        UriSource = Helper.IsValidURI(bill.Image) ? new Uri(bill.Image) :
                                    null
                    },
                    Value = bill.Value
                });
            }
            #endregion

            CashDrawTypes = tempCashDrawType;
        }
Ejemplo n.º 2
0
        internal void ResetVM()
        {
            if (CacheBusinessLogic.ForcePrintReceipt)
            {
                IsPrintReceiptEnabled = false;
                IsPrintReceiptOn      = true;
            }
            else
            {
                IsPrintReceiptEnabled = true;
                IsPrintReceiptOn      = false;
            }

            _totalCurrencyValue = 0M;
            Total             = "0.00";
            IsCompleteEnabled = false;
            CashDrawModelList = new ObservableCollection <CashDrawModel>();
            CashDrawTypes     = new CashDrawTypesModel();
        }