Ejemplo n.º 1
0
        public void RefreshValues()
        {
            OnPropertyChanged("AllTotal");

            Tendered = AllTotal;
            SelectableAmounts[0].ChangeValue(Tendered);

            SelectAmountCommand.Execute(SelectableAmounts[0]);
        }
Ejemplo n.º 2
0
        private void SetSelectableAmounts()
        {
            decimal am1 = _order.AllTotal;
            decimal am0 = ((int)(am1 / 10)) * 10;

            decimal k = am1 - am0;

            decimal d = k > 5 ? 10 : 5;


            decimal am2 = am0 + d;
            decimal am3 = am2 + 5;

            decimal am4 = 100m;

            while (am4 < am3)
            {
                am4 += 20;
            }



            _selectableAmounts = new List <QuickAmount> {
                new QuickAmount {
                    Value = am1, DisplayFormat = "C2"
                },
                new QuickAmount {
                    Value = am2, DisplayFormat = "C0"
                },
                new QuickAmount {
                    Value = am3, DisplayFormat = "C0"
                },
                new QuickAmount {
                    Value = am4, DisplayFormat = "C0"
                }
            };

            SelectAmountCommand.Execute(_selectableAmounts[0]);
        }