Exemplo n.º 1
0
        public static void Init(IHeadOfficeRepository headOfficeRepository, 
            ISnackMachineRepository snackMachineRepository,
            IAtmRepository atmRepository)
        {
            SetupSnackMachine(snackMachineRepository);
            SetupHeadOffice(headOfficeRepository);
            SetupAtm(atmRepository);

            HeadOfficeInstance.Init(headOfficeRepository);
        }
        public DashboardViewModel(ISnackMachineRepository snackMachineRepository, 
            IAtmRepository atmRepository, 
            IHeadOfficeRepository headOfficeRepository,
            EventDispatcher eventDispatcher)
        {
            _snackMachineRepository = snackMachineRepository;
            _atmRepository = atmRepository;
            _headOfficeRepository = headOfficeRepository;
            _eventDispatcher = eventDispatcher;
            HeadOffice = HeadOfficeInstance.Instance;

            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);
        }
Exemplo n.º 3
0
 public MainViewModel(ISnackMachineRepository smRep, IAtmRepository atmRep, IHeadOfficeRepository hoRep, EventDispatcher dispatcher)
 {
     Dashboard = new DashboardViewModel(smRep, atmRep, hoRep, dispatcher);
 }
Exemplo n.º 4
0
 private static void SetupHeadOffice(IHeadOfficeRepository headOfficeRepository)
 {
     var headOffice = new HeadOffice {Id = 1};
     headOfficeRepository.Save(headOffice);
 }
 public HeadOfficeDomainService(IHeadOfficeRepository headOfficeRepository)
 {
     _headOfficeRepository = headOfficeRepository;
 }
 public static void Init(IHeadOfficeRepository repository)
 {
     Instance = repository.GetById(HeadOfficeId);
 }
Exemplo n.º 7
0
 public void Initialization()
 {
     _objectContext = ServiceLocator.Current.GetInstance<IObjectContextManager>("ObjectContextManager");
     _repository = new HeadOfficeRepository(_objectContext);
 }