public void JudeUserType(string tId) { int count = new AuthorityBLL().TwoUser(tId); if (count > 1) { Panel1.Visible = true; Panel2.Visible = false; } else if (count == 1) { int role = new TeacherBLL().GetTeacherRole(tId); Response.Cookies["UserType"].Value = role.ToString();; //设置为管理员或管理员监考老师 Response.Redirect(url); } else { //Response.Cookies["UserType"].Value = "ExamTeacher"; //设置为监考老师 //Response.Redirect(url); Response.Write("<script>alert('暂无可用功能!')</script>"); } }
protected void bindAthority() { uId = Request.Cookies["uId"].Value.ToString(); AuthorityBLL auBll = new AuthorityBLL(); DataClassesDataContext db = new DataClassesDataContext(); teacher = db.Teacher.First(t => t.TId == uId); if (Request.Cookies["UserType"] != null) { string para = Request.Cookies["UserType"].Value.ToString(); string tId = Request.Cookies["uId"].Value.ToString(); if (para == "2") { Panel1.Visible = false; FunctionName = "监考管理"; } else { FunctionName = "后台管理"; } int type; if (choseExanType.ExamTypeName.Contains("基础")) { type = (int)AuthorityBLL.AuthorityExamType.Basic; } else { type = (int)AuthorityBLL.AuthorityExamType.Practical; } aus = auBll.GetTeacherAu(uId, int.Parse(para), type); //根据考试类型获取权限 } // lr_UserName.Text = res.TName; }