ASP.net+Sqlsrver的HR管理系统设计与实现(11)
时间:2017-01-03 13:03 来源:毕业论文 作者:毕业论文 点击:次
{ if (TextBox2.Text.ToString().Trim() == "" || TextBox1.Text.ToString().Trim() == "") { Response.Write("<script>javascript:alert('请输入完整');history.back();</script>"); Response.End(); } string sql; if (RadioButton1.Checked) { sql = "select * from allusers where username='" + TextBox2.Text.ToString().Trim() + "' and pwd='" + TextBox1.Text.ToString().Trim() + "'"; } else { sql = "select * from yuangong where bh='" + TextBox2.Text.ToString().Trim() + "' and pwd='" + TextBox1.Text.ToString().Trim() + "'"; } DataSet result = new DataSet(); result = new Class1().hsggetdata(sql); if (result != null) { if (result.Tables[0].Rows.Count > 0) { Session["username"] = TextBox2.Text.ToString().Trim(); if (RadioButton1.Checked) { Session["role"] = result.Tables[0].Rows[0]["cx"].ToString().Trim(); } else { Session["role"] = "员工"; } Response.Redirect("default.htm"); } else { Response.Write("<script>javascript:alert('对不起,用户名或密码不正确!');</script>"); } } else { Response.Write("<script>javascript:alert('对不起,系统错误,请不要越权操作!');</script>"); (责任编辑:qin) |