// GET: Authentication //[Authorize] public ActionResult Index() { if (Request.Cookies["UserName"] == null) { return(Redirect("/SignIn")); } User U = new User(); Service1Client PVMS = new Service1Client(); //HintQuestion[] D = PVMS.FetchHintQuestion(); //ViewBag.HintQuestionDD = D.ToList(); var username = Request.Cookies["UserName"].Value.ToString(); TempData["HintQuestion"] = DbOperation.FetchHintQuestionByUserName(username); return(View(U)); }
public ActionResult Index(User U) { var username = Request.Cookies["UserName"].Value.ToString(); int userId = DbOperation.FetchIdByUserName(username); TempData["HintQuestion"] = DbOperation.FetchHintQuestionByUserName(username); U.UserId = username; if (DbOperation.Authenticity(U)) { return(Redirect("/VisaCancellation")); } else { TempData["Msg"] = "Answer does not Match.Please Try Again"; return(View()); } }