public ActionResult Create() { if (SessionController.UserIsInSession()) { CollectionViewModel cModel = new CollectionViewModel(); cModel.User = userObj.GetUser(userId); cModel.Categories = categoryObj.GetAllCategories(); return(View(cModel)); } return(RedirectToAction("Index", "Login")); }
private void LoadCategoryData() { categoryList = new ObservableCollection <Category>(categoryClient.GetAllCategories()); try { categoryDatagrid.ItemsSource = categoryList; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); throw; } }
public ActionResult Index() { int userId = SessionController.UserId; if (SessionController.UserIsInSession()) { CollectionViewModel cModel = new CollectionViewModel(); cModel.Categories = categoryObj.GetAllCategories(); cModel.Movies = movieObj.GetAllMovies(); cModel.Genres = genreObj.GetAllGenres(); cModel.Cds = cdObj.GetAllCds(); cModel.User = userObj.GetUser(userId); cModel.users = userObj.GetAllUsers(); return(View(cModel)); } return(RedirectToAction("Index", "Login")); }
//Display all the categories on Index page public ActionResult Index() { var movieCategories = categoryObj.GetAllCategories(); return(View(movieCategories)); }