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); }
private void ShowAtm(AtmDto atmDto) { logic.Atms.Atm atm = _atmRepository.GetById(atmDto.Id); if (atm == null) { return; } _dialogService.ShowDialog(new AtmViewModel(atm)); RefreshAll(); }
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(); }