protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["ht_id"] == null && Request.Cookies["ht_pwd"] == null) { Response.Redirect("login.html"); } else { BLL.user bll_user = new BLL.user(); list_user = bll_user.GetModelList(""); } }
public ActionResult Login() { BLL.user userBll = new BLL.user(); string LoginName = Request["userName"]; string pwd = Request["pwd"]; string sql = "loginName='" + LoginName + "' and PWD='" + pwd + "' and validFlag='1' "; List <Model.user> userlist = userBll.GetModelList(sql); if (userlist.Count > 0) { ViewData["ID"] = userlist[0].ID; return(View("./Index")); } return(View()); }