public ViewModelLocator()
        {
            _navigationService = new NavigationService();
            _dataService       = new DataService(new UserRepository(), new MenuRepository(), new DishRepository(), new CustomerRepository(), new DelivererRepository(), new EventRepository(), new IngredientRepository());

            CustomerOverviewViewModel  = new CustomerOverviewViewModel(_navigationService, _dataService);
            DelivererOverviewViewModel = new DelivererOverviewViewModel(_navigationService, _dataService);
            EventOverviewViewModel     = new EventOverviewViewModel(_navigationService, _dataService);
            LoginViewModel             = new LoginViewModel(_navigationService, _dataService);
            MainViewModel          = new MainViewModel(_navigationService, _dataService);
            EditCustomerViewModel  = new EditCustomerViewModel(_navigationService, _dataService);
            EditDelivererViewModel = new EditDelivererViewModel(_navigationService, _dataService);
            EditEventViewModel     = new EditEventViewModel(_navigationService, _dataService);
            EditStaffViewModel     = new EditStaffViewModel(_navigationService, _dataService);
            NewDelivererViewModel  = new NewDelivererViewModel(_navigationService, _dataService);
            NewDishViewModel       = new NewDishViewModel(_navigationService, _dataService);
            NewEventViewModel      = new NewEventViewModel(_navigationService, _dataService);
            NewMenuViewModel       = new NewMenuViewModel(_navigationService, _dataService);
            NewStaffViewModel      = new NewStaffViewModel(_navigationService, _dataService);
            StaffViewModel         = new StaffViewModel(_navigationService, _dataService);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> OnGet(string returnUrl = null)
        {
            var user = await _services.GetUserByUserIdAsync(UserId);

            if (user == null)
            {
                ViewData["Title"] = "Add Biography Data";
            }
            else
            {
                ViewData["Title"]     = "Update Biography Data";
                ViewModel             = new NewStaffViewModel();
                ViewModel.DateOfBirth = user.DateOfBirth.Date;
                ViewModel.Gender      = user.Gender;
                ViewModel.Name        = user.Name;
                ViewModel.Nationality = user.Nationality;
            }

            ReturnUrl = returnUrl;
            return(Page());
        }
Exemplo n.º 3
0
        public ActionResult Staff()
        {
            var viewModel = new NewStaffViewModel();

            return(View(viewModel));
        }