DBPOLLDemo.Controllers.answerHistoryController.Index C# (CSharp) Method

Index() public method

public Index ( int id, String name ) : System.Web.Mvc.ActionResult
id int
name String
return System.Web.Mvc.ActionResult
        public ActionResult Index(int id, String name)
        {
            if (Session["uid"] == null || Session["uid"].ToString().Equals(""))
            {
                return RedirectToAction("Index", "Home");
            }
            if ((int)Session["user_type"] < User_Type.POLL_MASTER)
            {
                return RedirectToAction("Invalid", "Home");
            }

            answerHistoryModel a = new answerHistoryModel();
            List<answerHistoryModel> list = a.displayAnswerHistory(id);
            ViewData["name"] = name;
            if (list.Count > 0)
            {

                return View(list);
            }
            else
            {
                ViewData["message"] = "There are no previous versions of this answer.";
                return View(list);
            }
        }
answerHistoryController