示例#1
0
        public NewItemViewModel(IFoodOrderService model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            _model = model;

            ExitCommand = new DelegateCommand(param => OnExitApplication());
            BackCommand = new DelegateCommand(param => OnBackToMain());
            SaveCommand = new DelegateCommand(param => Save());
        }
示例#2
0
        /// <summary>
        /// Nézetmodell példányosítása.
        /// </summary>
        /// <param name="model">A modell.</param>
        public LoginViewModel(IFoodOrderService model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            _model   = model;
            UserName = string.Empty;

            ExitCommand = new DelegateCommand(param => OnExitApplication());

            LoginCommand = new DelegateCommand(param => LoginAsync(param as PasswordBox));
        }
示例#3
0
        private void App_Startup(object sender, StartupEventArgs e)
        {
            _service = new FoodOrderService(ConfigurationManager.AppSettings["baseAddress"]);

            _loginViewModel = new LoginViewModel(_service);

            _loginViewModel.ExitApplication    += ViewModel_ExitApplication;
            _loginViewModel.MessageApplication += ViewModel_MessageApplication;
            _loginViewModel.LoginSuccess       += ViewModel_LoginSuccess;
            _loginViewModel.LoginFailed        += ViewModel_LoginFailed;

            _loginView = new LoginWindow
            {
                DataContext = _loginViewModel
            };
            _loginView.Show();
        }
示例#4
0
 public HotelController(IFoodOrderService IFoodOrderService, IUserManangement IUserManangement)
 {
     _repository     = IFoodOrderService;
     _repositoryUser = IUserManangement;
 }
 public HomeController(IRestaurantService restaurantService, IOrderService orderService, IFoodOrderService foodOrderService)
 {
     _restaurantService = restaurantService;
     _orderService      = orderService;
     _foodOrderService  = foodOrderService;
 }