Example #1
0
        public void Execute(object parameter)
        {
            menuViewModel menuViewModel = (menuViewModel)App.Current.Resources["SharedMenu"];
            loginRegister loginRegister = new loginRegister();

            loginRegister.registerAccount(menuViewModel.UnregisteredAccount.Username, menuViewModel.UnregisteredAccount.Password);
        }
 public ActionResult addMenuItems(menuViewModel formValues)
 {
     if (TempData.ContainsKey("adminId"))
     {
         try
         {
             menuViewModel menuView = new menuViewModel();
             ViewBag.type = menuView.types;
             menuView.populateDropdownlists();
             ViewBag.ids = menuView.restaurantIds;
             Menu menuItem = formValues.menuInfoValues();
             dbContext.Menus.Add(menuItem);
             dbContext.SaveChanges();
             return(RedirectToAction("index"));
         }
         catch (Exception ex)
         {
             ViewBag.exception = ex.Message;
             return(View());
         }
     }
     else
     {
         TempData.Clear();
         return(RedirectToAction("LogIn", "LogIn"));
     }
 }
Example #3
0
        //Opens Score menu
        private void Button_Click_5(object sender, RoutedEventArgs e)
        {
            scoreCanvas.Visibility = Visibility.Visible;
            menuViewModel menuViewModel = (menuViewModel)App.Current.Resources["SharedMenu"];

            menuViewModel.loadTopGlobalScores();
            menuViewModel.loadAllPersonalScores();
        }
 public ActionResult addMenuItems()
 {
     if (TempData.ContainsKey("adminId"))
     {
         menuViewModel menuView = new menuViewModel();
         ViewBag.type = menuView.types;
         menuView.populateDropdownlists();
         ViewBag.ids = menuView.restaurantIds;
         return(View());
     }
     else
     {
         TempData.Clear();
         return(RedirectToAction("LogIn", "LogIn"));
     }
 }
Example #5
0
        public void Execute(object parameter)
        {
            gameViewModel gameViewModel = (gameViewModel)App.Current.Resources["SharedGame"];
            menuViewModel menuViewModel = (menuViewModel)App.Current.Resources["SharedMenu"];
            loginRegister loginRegister = new loginRegister();

            if (loginRegister.login(menuViewModel.UnregisteredAccount.Username, menuViewModel.UnregisteredAccount.Password))
            {
                var context = new SideScrollerDBContext();
                var account = context.Players
                              .Where(s => s.Username == menuViewModel.UnregisteredAccount.Username);
                gameViewModel.Player          = account.First();
                gameViewModel.IsLoggedIn      = true;
                menuViewModel.Player.Username = account.First().Username;
            }
        }
Example #6
0
 public LoginCommand(menuViewModel menu)
 {
     this.menuViewModel = menu;
 }
Example #7
0
 public RegisterCommand(menuViewModel menu)
 {
     this.menuViewModel = menu;
 }