protected void confirm_Click(object sender, EventArgs e) { string code = (string)Session["VerifyCode"]; string inputCode = Request["VerifyCodeText"]; if (code != inputCode) { Response.Write("<script Language='JavaScript'>alert('验证码错误!');window.location.href ='Login.aspx'</script>"); } else { Users user = Users.VerifyIdentity(Username.Text.Trim(), Request["Password"]); if (user != null) { Session["Identify"] = user; if (BasicInfo.HasBasicInfo(user.UserID) && BasicInfo.GetDepartment(user.UserID) != null) { Response.Redirect("~/Account/ApplyListPage.aspx"); } else { Response.Write("<script Language='JavaScript'>alert('请先完善个人基本信息!');window.location.href ='BasicInfoEdit.aspx'</script>"); } } else { ErrorSpan.Visible = true; } } }
/// <summary> /// 根据用户编号返回事业部对象 /// </summary> /// <param name="id"></param> /// <returns></returns> public static BusinessUnit GetBUByUserID(int id) { Department department = BasicInfo.GetDepartment(id); BusinessUnit bu = BusinessUnit.GetBUByID(department.ParentID); return(bu); }