protected void Page_Load(object sender, EventArgs e) { if (this.Request.QueryString["user"] != null) { strUid = this.Request.QueryString["user"].ToString(); } else { Response.Write("<script>alert('对不起,参数有误!请联系管理员!');</script>"); Response.Redirect("index.aspx?rend=" + System.Guid.NewGuid().ToString()); return; } if (this.Request.QueryString["type"] != null) { strType = this.Request.QueryString["type"].ToString(); } else { Response.Write("<script>alert('对不起,参数有误!请联系管理员!');</script>"); Response.Redirect("index.aspx?rend=" + System.Guid.NewGuid().ToString()); return; } if (this.Request.QueryString["ren"] != null) { strID = this.Request.QueryString["ren"].ToString(); } else { Response.Write("<script>alert('对不起,参数有误!请联系管理员!');</script>"); Response.Redirect("index.aspx?rend=" + System.Guid.NewGuid().ToString()); return; } if (strType == "1") { personal personal = new personal(); personal.yzid = strID; personal.loginId = strUid; DataSet dtSet = personal.GetAuthenticationList(); if (dtSet.Tables[0].Rows.Count > 0) { personal.ifEnable = "1"; personal.id = dtSet.Tables[0].Rows[0]["id"].ToString(); personal.authenticationTime = DateTime.Now; personal.UpdateAuthenticationList(); } } else if (strType == "2") { investor investor = new investor(); investor.yzid = strID; investor.loginId = strUid; DataSet dtSet = investor.GetAuthenticationList(); if (dtSet.Tables[0].Rows.Count > 0) { investor.ifEnable = "1"; investor.id = dtSet.Tables[0].Rows[0]["id"].ToString(); investor.authenticationTime = DateTime.Now; investor.UpdateAuthenticationList(); } } else if (strType == "3") { company company = new company(); company.yzid = strID; company.loginId = strUid; DataSet dtSet = company.GetAuthenticationList(); if (dtSet.Tables[0].Rows.Count > 0) { company.ifEnable = "1"; company.id = dtSet.Tables[0].Rows[0]["id"].ToString(); company.authenticationTime = DateTime.Now; company.UpdateAuthenticationList(); } } else { Response.Write("<script>alert('对不起,参数有误!请联系管理员!');</script>"); Response.Redirect("index.aspx?rend=" + System.Guid.NewGuid().ToString()); return; } }
private void addInvestor(string strYzid) { investor investor = new investor(); investor.id = System.Guid.NewGuid().ToString(); investor.loginId = this.txtEmail.Value; investor.pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtPwd.Value, "MD5"); investor.name = this.txtName.Value; investor.telNumber = ""; investor.phoneNumber = ""; investor.company = ""; investor.address = ""; investor.contact = ""; investor.ifEnable = "0"; investor.detail = ""; investor.intelligence = ""; investor.capital = 0; investor.eamil = this.txtEmail.Value; investor.yzid = strYzid; investor.createTime = DateTime.Now; investor.Add(); }
protected void btn_login_Click(object sender, EventArgs e) { string CheckCode = this.txtCheckCode.Value.Trim(); //验证码 if (String.Compare(Request.Cookies["ValidateCode"].Value, CheckCode, true) != 0) { Page.ClientScript.RegisterStartupScript(Page.ClientScript.GetType(), "myscript", "<script>tip('验证码输入不正确,请重新输入!');</script>"); return; } if (this.st_type.Value == "1") { personal personal = new personal(); personal.loginId = this.txtUid.Value.Trim(); personal.pwd = this.txtLogPwd.Value.Trim(); personal.ifEnable = "1"; if (personal.userIfEnable()) { Page.ClientScript.RegisterStartupScript(Page.ClientScript.GetType(), "myscript", "<script>tip('该用户没有认证,请查看邮箱认证用户!');</script>"); return; } else { DataSet dtSet = personal.userLogin(); if (dtSet.Tables[0].Rows.Count > 0) { Session["uid"] = dtSet.Tables[0].Rows[0]["id"].ToString(); Session["uname"] = dtSet.Tables[0].Rows[0]["name"].ToString(); Session["loginId"] = dtSet.Tables[0].Rows[0]["loginId"].ToString(); Session["utype"] = "1"; this.lb_showLogin.Text = "<a href=\"javascript:void(0)\" class=\"Logo\" onclick=\"loginOut();\" id=\"loginOut\">注销</a><a href=\"javascript:void(0)\" class=\"Rion\" id=\"User\"> 欢迎你," + dtSet.Tables[0].Rows[0]["name"].ToString() + "</a>"; } else { Page.ClientScript.RegisterStartupScript(Page.ClientScript.GetType(), "myscript", "<script>tip('用户名或密码输入错,请重新输入!');</script>"); return; } } } else if (this.st_type.Value == "2") { investor investor = new investor(); investor.loginId = this.txtUid.Value.Trim(); investor.pwd = this.txtLogPwd.Value.Trim(); investor.ifEnable = "1"; if (investor.userIfEnable()) { Page.ClientScript.RegisterStartupScript(Page.ClientScript.GetType(), "myscript", "<script>tip('该用户没有认证,请查看邮箱认证用户!');</script>"); return; } else { DataSet dtSet = investor.userLogin(); if (dtSet.Tables[0].Rows.Count > 0) { Session["uid"] = dtSet.Tables[0].Rows[0]["id"].ToString(); Session["uname"] = dtSet.Tables[0].Rows[0]["name"].ToString(); Session["loginId"] = dtSet.Tables[0].Rows[0]["loginId"].ToString(); Session["utype"] = "2"; this.lb_showLogin.Text = "<a href=\"javascript:void(0)\" class=\"Logo\" onclick=\"loginOut();\" id=\"loginOut\">注销</a><a href=\"javascript:void(0)\" class=\"Rion\" id=\"User\"> 欢迎你," + dtSet.Tables[0].Rows[0]["name"].ToString() + "</a>"; } else { Page.ClientScript.RegisterStartupScript(Page.ClientScript.GetType(), "myscript", "<script>tip('用户名或密码输入错,请重新输入!');</script>"); return; } } } else if (this.st_type.Value == "3") { company company = new company(); company.loginId = this.txtUid.Value.Trim(); company.pwd = this.txtLogPwd.Value.Trim(); company.ifEnable = "1"; if (company.userIfEnable()) { Page.ClientScript.RegisterStartupScript(Page.ClientScript.GetType(), "myscript", "<script>tip('该用户没有认证,请查看邮箱认证用户!');</script>"); return; } else { DataSet dtSet = company.userLogin(); if (dtSet.Tables[0].Rows.Count > 0) { Session["uid"] = dtSet.Tables[0].Rows[0]["id"].ToString(); Session["uname"] = dtSet.Tables[0].Rows[0]["name"].ToString(); Session["loginId"] = dtSet.Tables[0].Rows[0]["loginId"].ToString(); Session["utype"] = "3"; this.lb_showLogin.Text = "<a href=\"javascript:void(0)\" class=\"Logo\" onclick=\"loginOut();\" id=\"loginOut\">注销</a><a href=\"javascript:void(0)\" class=\"Rion\" id=\"User\"> 欢迎你," + dtSet.Tables[0].Rows[0]["name"].ToString() + "</a>"; } else { Page.ClientScript.RegisterStartupScript(Page.ClientScript.GetType(), "myscript", "<script>tip('用户名或密码输入错,请重新输入!');</script>"); return; } } } }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["uid"] == null || this.Session["uid"].ToString() == "") { this.lb_showLogin.Text = "<a href=\"javascript:void(0)\" class=\"Logo\" id=\"User_Register\">注册</a>"; this.lb_showLogin.Text += "<a href=\"javascript:void(0)\" class=\"Rion\" id=\"User_Login\">登录</a>"; } else if (this.Session["uname"] != null) { this.lb_showLogin.Text = "<a href=\"javascript:void(0)\" class=\"Logo\" onclick=\"loginOut();\" id=\"loginOut\">注销</a> <a href=\"javascript:void(0)\" class=\"Rion\" id=\"User\">欢迎你," + this.Session["uname"].ToString() + "</a>"; if (this.Session["utype"] != null) { if (this.Session["utype"].ToString() == "1") { personal personal = new personal(); personal.GetModel(this.Session["uid"].ToString().Trim()); ; this.lb_name.Text = personal.name; this.lb_email.Text = personal.email; this.lb_type.Text = "个人/创客"; } else if (this.Session["utype"].ToString() == "2") { investor investor = new investor(); investor.GetModel(this.Session["uid"].ToString().Trim()); ; this.lb_name.Text = investor.name; this.lb_email.Text = investor.eamil; this.lb_type.Text = "投资人"; } else if (this.Session["utype"].ToString() == "3") { company company = new company(); company.GetModel(this.Session["uid"].ToString().Trim()); ; this.lb_name.Text = company.name; this.lb_email.Text = company.eamil; this.lb_type.Text = "企业"; } } } }