DBPOLLDemo.Controllers.QuestionController.Delete C# (CSharp) Method

Delete() public method

Calls the model method to delete Questions based on the Question ID and refreshes the view to display the updated list of questions. Currently all logged in user can delete question associated with their account. Need to enforce some type of Authorization based on user type.
public Delete ( int questionid, int id, String name ) : System.Web.Mvc.ActionResult
questionid int
id int Question ID to be deleted
name String
return System.Web.Mvc.ActionResult
        public ActionResult Delete(int questionid, 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");
            }

            questionModel q = new questionModel(questionid);
            q.deleteQuestion();
            return RedirectToAction("Index", "Question", new { id = id, name = name });
        }