public ActionResult CreateRating() { ViewBag.voters = new SelectList(_votMgr.GetVoters().Result, "VoterId", "StaffName"); // ViewBag.restaurants = new SelectList(_restMgr.GetRestaurants().Result, "RestId", "RestName"); // here i pass the data to the view ViewBag.restaurants = _restMgr.GetRestaurants().Result.ToList(); ViewBag.periods = _ratMgr.GetPeriods().Result; //ViewBag.ratins = _ratMgr.GetRatings().Result; //var ratings = _ratMgr.GetPeriods().Result; //int RatingPeriod = ratings[0].PeriodId; //ViewBag.Period = RatingPeriod.ToString(); return(View()); }
// GET: Period public ActionResult Index() { if (TempData["message"] != null) { ViewBag.Success = (string)TempData["message"]; } var results = _ratMgr.GetPeriods(); if (results.Succeeded == true) { return(View(results.Unwrap())); } else { ModelState.AddModelError(string.Empty, "An error occure"); return(View()); } }