public ActionResult CheckLogin(string UserEmail, string UserPassword) { ResultResponse result = new ResultResponse(); UserInformation users = accountDAL.CheckUserLogin(UserEmail, UserPassword); if (users.Empty) { result.isSuccess = true; result.msg = "Wrong Username Or Password"; return(Json(result, JsonRequestBehavior.AllowGet)); } else { List <ModuleClassModel> moduleList = new List <ModuleClassModel>(); moduleList = accountDAL.GetModuleByuUser(users.UserInformationId); if (moduleList.Count <= 0) { result.isSuccess = true; result.msg = "You Don't Have Permission To This System"; return(Json(result, JsonRequestBehavior.AllowGet)); } else { result.isSuccess = false; result.msg = Url.Action(moduleList[0].ModuleValue, moduleList[0].ModuleController); Session["IncentiveUserId"] = users.UserInformationId; Session["IncentiveUserName"] = users.UserInformationName; return(Json(result, JsonRequestBehavior.AllowGet)); } } }