Exemple #1
0
 /// <summary>
 /// 验证教师登陆
 /// </summary>
 /// <param name="te_Id">教师ID</param>
 /// <param name="te_Pwd">密码</param>
 public void ValidTeacherLogin(string te_Id, string te_Pwd)
 {
     if (teacher.ValidLogin(te_Id, te_Pwd))
     {
         FormsAuthentication.SetAuthCookie(te_Id, false);
         if (!Roles.IsUserInRole(te_Id, "Teacher"))
         {
             Roles.AddUserToRole(te_Id, "Teacher");
         }
         HttpContext.Current.Session["role"] = "teacher";
         JScript.RedirectUrl(@"~/Teacher/Default.aspx");
     }
     else
     {
         JScript.Alert("用户信息错误!请重新输入!");
         JScript.GoHistory(-1);
     }
 }