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

Revert() public method

public Revert ( int answerid, String answer, int correct, String weight, string ansnum ) : System.Web.Mvc.ActionResult
answerid int
answer String
correct int
weight String
ansnum string
return System.Web.Mvc.ActionResult
        public ActionResult Revert(int answerid, String answer, int correct, String weight, string ansnum)
        {
            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");
            }

            answerModel a = new answerModel();
            a = a.getAnswer(answerid);

            /* Create a record of the old answer in the Answer History table */
            new answerHistoryModel(answerid).createAnswerHistory(a.answerid, a.answer, a.correct, a.weight, a.ansnum);

            /* Update the answer*/
            a.updateAnswer(answerid, answer, correct, int.Parse(weight), int.Parse(ansnum));
            a = a.getAnswer(answerid);
            return RedirectToAction("Index", "answerHistory", new { id = a.answerid, name = a.answer } );
        }
answerHistoryController