Example #1
0
 public AtmViewModel(Atm atm)
 {
     _atm             = atm;
     _paymentGatway   = new PaymentGatway();
     _repository      = new AtmRepository();
     TakeMoneyCommand = new Command <decimal>(x => x > 0, TakeMoney);
 }
        public MainViewModel()
        {
            Atm atm       = new AtmRepository().GetById(1);
            var viewModel = new AtmViewModel(atm);

            _dialogService.ShowDialog(viewModel);
        }
Example #3
0
        public AtmView()
        {
            InitializeComponent();
            Atm atm       = new AtmRepository().GetById(1);
            var viewModel = new AtmViewModel(atm);

            DataContext = viewModel;
        }
        public AtmViewModel(Atm atm)
        {
            _atm = atm;
            _repository = new AtmRepository();
            _paymentGateway = new PaymentGateway();

            TakeMoneyCommand = new Command<decimal>(x => x > 0, TakeMoney);
        }
Example #5
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);
 }
Example #6
0
        public MainViewModel()
        {
            var repository = new AtmRepository();
            var atmMachine = repository.GetById(1);
            var viewModel  = new AtmViewModel(atmMachine);

            _dialogService.ShowDialog(viewModel);
        }
Example #7
0
        public MainViewModel()
        {
            //SnackMachine snackMachine = new SnackMachineRepository().GetById(1);
            //var viewModel = new SnackMachineViewModel(snackMachine);
            //_dialogService.ShowDialog(viewModel);

            Atm atm       = new AtmRepository().GetById(1);
            var viewModel = new AtmViewModel(atm);

            _dialogService.ShowDialog(viewModel);
        }
        public DashboardViewModel()
        {
            HeadOffice = HeadOfficeInstance.Instance;
            _snackMachineRepository = new SnackMachineRepository();
            _atmRepository = new AtmRepository();
            _headOfficeRepository = new HeadOfficeRepository();

            RefreshAll();

            ShowSnackMachineCommand = new Command<SnackMachineDto>(x => x != null, ShowSnackMachine);
            UnloadCashCommand = new Command<SnackMachineDto>(CanUnloadCash, UnloadCash);
            ShowAtmCommand = new Command<AtmDto>(x => x != null, ShowAtm);
            LoadCashToAtmCommand = new Command<AtmDto>(CanLoadCashToAtm, LoadCashToAtm);
        }
        public DashboardViewModel()
        {
            HeadOffice = HeadOfficeInstance.Instance;
            _snackMachineRepository = new SnackMachineRepository();
            _atmRepository = new AtmRepository();
            _headOfficeRepository = new HeadOfficeRepository();

            RefreshAll();

            ShowSnackMachineCommand = new Command<SnackMachineDto>(x => x != null, ShowSnackMachine);
            UnloadCashCommand = new Command<SnackMachineDto>(CanUnloadCash, UnloadCash);
            ShowAtmCommand = new Command<AtmDto>(x => x != null, ShowAtm);
            LoadCashToAtmCommand = new Command<AtmDto>(CanLoadCashToAtm, LoadCashToAtm);
        }
Example #10
0
 public UnitOfWork(RoleplayContext context)
 {
     _context                    = context;
     AccountRepository           = new AccountRepository(_context);
     CharacterRepository         = new CharacterRepository(_context);
     VehicleRepository           = new VehicleRepository(_context);
     AtmRepository               = new AtmRepository(_context);
     BusRepository               = new BusRepository(_context);
     BuildingRepository          = new BuildingRepository(_context);
     ItemRepository              = new ItemRepository(_context);
     ShopRepository              = new ShopRepository(_context);
     GroupRepository             = new GroupRepository(_context);
     WarehouseRepository         = new WarehouseRepository(_context);
     SmartphoneMessageRepository = new SmartphoneMessageRepository(_context);
 }