Ejemplo n.º 1
0
 public ActionResult Index(SCMRecipeViewModel SCMViewModel, string command)
 {
     SCMViewModel = SCMRecipeManager.SearchSCMRecipe(SCMViewModel.SearchItem);
     if (SCMViewModel.SCMRecipeList != null)
     {
         TempData["SearchResult"] = 1;   // Stores 1 if a search returned results.
         Session["ViewModelList"] = SCMViewModel.SCMRecipeList;
     }
     else
     {
         ModelState.AddModelError("", "No results found");
     }
     return(View(SCMViewModel));
 }
Ejemplo n.º 2
0
        // GET: ValueMeal
        public ActionResult Index(string id)
        {
            UserAccessSession UASession = (UserAccessSession)Session["UserAccess"];

            if (UASession == null || !UASession.SCM)
            {
                return(RedirectToAction("Login", "Account"));
            }
            // Set NavBar Links accordingly
            Session["CurrentPage"] = new CurrentPageSession("SCM", "HOME", "LOG");

            // SearchItemSelected is assigned value at DisplaySearchResult
            SCMRecipeViewModel SCMViewModel = new SCMRecipeViewModel();

            if (id != null)
            {
                SCMViewModel = SCMRecipeManager.SearchSCMRecipe(id);
            }
            return(View(SCMViewModel));
        }