public ActionResult ChooseCategory(HomeIndexViewModel homeIndexViewModel) { ViewBag.SelectedCategoryId = homeIndexViewModel.SelectedCategoryId; //SelectedCategoryId-1 because in db, IDs start from 1 ViewBag.SelectedCategoryName = HomeIndexViewModel.CategoryList[(int)homeIndexViewModel.SelectedCategoryId - 1].CategoryName; var chooseCategoryViewModel = new ChooseCategoryViewModel(); chooseCategoryViewModel.SelectedCategoryId = homeIndexViewModel.SelectedCategoryId; chooseCategoryViewModel.SelectedCategoryName = HomeIndexViewModel.CategoryList[(int)homeIndexViewModel.SelectedCategoryId - 1].CategoryName; return(View(chooseCategoryViewModel)); }
public ActionResult SpecifyParameters(ChooseCategoryViewModel chooseCategoryViewModel) { var c1 = HomeIndexViewModel.CategoryList.First((c) => c.CategoryId == chooseCategoryViewModel.SelectedCategoryId); ViewBag.SelectedCategory = c1.CategoryId; ViewBag.SelectedCategoryName = c1.CategoryName; ViewBag.ResourceType = chooseCategoryViewModel.SelectedResource; SpecifyParametersViewModel specifyParametersViewModel = new SpecifyParametersViewModel(); specifyParametersViewModel.SelectedCategoryName = c1.CategoryName; specifyParametersViewModel.SelectedcategoryId = c1.CategoryId; specifyParametersViewModel.SelectedResource = chooseCategoryViewModel.SelectedResource; return(View(specifyParametersViewModel)); }
public ChooseCategoryView() { InitializeComponent(); BindingContext = new ChooseCategoryViewModel(); }