下面的代码通过radLoginType.SelectedIndex来区分用户是个人或是企业,我现在想要跳过这一步
下面的代码通过radLoginType.SelectedIndex来区分用户是个人或是企业,我现在想要跳过这一步,直接就去找个人表,和企业表,到个人表找到就去个人页面,在企业表里找到用户就去企业页面,要怎么改呢? --------------------------------------------------------------
protected void imgLogin_Click(object sender, ImageClickEventArgs e)
{
if (radLoginType.SelectedIndex == 0)
{
//用户登陆
JHJob.Module.User user = null;
HttpCookie cok = null;
new UserAgent().UserLogin(this.txtLoginName.Text.Trim(),
JHJob.WebUtility.Security.Secure.Md5(this.txtLoginPwd.Text.Trim()),
Request.UserHostAddress, out user, out cok);
if (user != null)
{
cok.Expires = DateTime.Now.AddMinutes(20);
Response.SetCookie(cok);
this.loginName = user.LoginName;
this.message = "希望您能在这里找到更多适合您的职位!";
this.loginDate = user.LoginDate.ToShortDateString().Equals("1800-1-1") ? "您是第一次登陆" : user.LoginDate.ToShortDateString();
this.loginIp = user.LoginIp.Equals("") ? "无" : user.LoginIp;
this.backURL= "userManager/index.aspx";
this.pan_NoLogin.Visible = false;
this.pan_Logined.Visible = true;
}
else
{
WebUtility.ShowMessage(Page, "帐号或密码错误,登陆失败!");
}
}
else
{
//商家登陆
Business bus = null;
HttpCookie cok = null;
new BusinessAgent().BusinessLogin(this.txtLoginName.Text.Trim(),
JHJob.WebUtility.Security.Secure.Md5(this.txtLoginPwd.Text.Trim()),
Request.UserHostAddress, out bus, out cok);
if (bus != null)
{
cok.Expires = DateTime.Now.AddMinutes(20);
Response.SetCookie(cok);
this.loginName = bus.LoginName;
this.message = "希望您能在这里找到更多优秀的人才!";
this.loginDate = bus.LoginDate.ToShortDateString().Equals("1800-1-1") ? "您是第一次登陆" : bus.LoginDate.ToShortDateString();
this.loginIp = bus.LoginIp.Equals("") ? "无" : bus.LoginIp;
this.backURL = "businessManager/index.aspx";
this.pan_NoLogin.Visible = false;
this.pan_Logined.Visible = true;
}
else
{
WebUtility.ShowMessage(Page, "帐号或密码错误,登陆失败!");
}
}
}