public ActionResult LogIn([Bind("Username,Password")] LogInViewModel viewModelLog) { try { if (ModelState.IsValid) { MyOrder.Username = viewModelLog.Username; var itemlogin = PopulateItemList.Populate(RepoItem, RepoStore, RepoOrd, RepoTopi, RepoSell, RepoPers, RepoRev, MyOrder); // new ItemAnLogInViewModel if (RepoPers.GetPeopleByName(viewModelLog.Username).First(p => p.Username == viewModelLog.Username).Password == viewModelLog.Password) { return(View("Order", itemlogin)); } } return(View(viewModelLog)); } catch { return(View(viewModelLog)); } }
public ActionResult AddToOrder(int id) { MyOrder.AddToCurrentOrder(id); return(View("Order", PopulateItemList.Populate(RepoItem, RepoStore, RepoOrd, RepoTopi, RepoSell, RepoPers, RepoRev, MyOrder))); }