毕业论文

打赏
当前位置: 毕业论文 > 计算机论文 >

ASP.net+Sqlsrver的HR管理系统设计与实现(11)

时间:2017-01-03 13:03来源:毕业论文
{ if (TextBox2.Text.ToString().Trim() == || TextBox1.Text.ToString().Trim() == ) { Response.Write(scriptjavascript:alert(请输入完整);history.back();/script); Response.End(); } string sql; if (Rad


    {
        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>"); ASP.net+Sqlsrver的HR管理系统设计与实现(11):http://www.751com.cn/jisuanji/lunwen_1752.html
------分隔线----------------------------
推荐内容