Esempio n. 1
0
 public AtmViewModel(logic.Atms.Atm atm)
 {
     _atm            = atm;
     _repository     = new AtmRepository();
     _paymentGateway = new PaymentGateway();
     //this will be executed only if amount is > 0
     TakeMoneyCommand = new Command <decimal>(x => x > 0, TakeMoney);
 }
Esempio n. 2
0
        private void ShowAtm(AtmDto atmDto)
        {
            logic.Atms.Atm atm = _atmRepository.GetById(atmDto.Id);

            if (atm == null)
            {
                return;
            }

            _dialogService.ShowDialog(new AtmViewModel(atm));
            RefreshAll();
        }
Esempio n. 3
0
        private void LoadCashToAtm(AtmDto atmDto)
        {
            logic.Atms.Atm atm = _atmRepository.GetById(atmDto.Id);

            if (atm == null)
            {
                return;
            }

            HeadOffice.LoadCashToAtm(atm);
            _atmRepository.Save(atm);
            _headOfficeRepository.Save(HeadOffice);

            RefreshAll();
        }