Пример #1
0
        private void UnloadCash(SnackMachineDto snackMachineDto)
        {
            SnackMachine snackMachine = _snackMachineRepository.GetById(snackMachineDto.Id);

            if (snackMachine == null)
                return;

            HeadOffice.UnloadCashFromSnackMachine(snackMachine);
            _snackMachineRepository.Save(snackMachine);
            _headOfficeRepository.Save(HeadOffice);

            RefreshAll();
        }
 private bool CanUnloadCash(SnackMachineDto snackMachineDto)
 {
     return snackMachineDto != null && snackMachineDto.MoneyInside > 0;
 }
        private void ShowSnackMachine(SnackMachineDto snackMachineDto)
        {
            SnackMachine snackMachine = _snackMachineRepository.GetById(snackMachineDto.Id);

            if (snackMachine == null)
            {
                MessageBox.Show("Snack machine was not found", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            _dialogService.ShowDialog(new SnackMachineViewModel(snackMachine));
            RefreshAll();
        }