public ActionResult Index(int?pricepermeal) { int pricePermealValidate = Convert.ToInt32(pricepermeal); if (pricePermealValidate <= 0) { return(View()); } PriceOfMealManager priceOfMealManager = new PriceOfMealManager(); PriceOfMeal priceOfMeal = new PriceOfMeal(); User currentUser = SetSession.GetCurrentUser(); priceOfMeal.PricePerMeal = pricePermealValidate; priceOfMeal.UserId = currentUser.Id; ViewBag.msg = priceOfMealManager.SetPirce(priceOfMeal); return(View()); }
// GET: ShowPrice public ActionResult Index() { User currentUser = SetSession.GetCurrentUser(); if (currentUser == null) { return(RedirectToAction("index", "home")); } else if (currentUser.AccountType == "u") { return(RedirectToAction("index", "homepage")); } PriceOfMealManager priceOfMealManager = new PriceOfMealManager(); ViewBag.price = priceOfMealManager.GetLastPrice(); return(View()); }