人事管理系统文档
本系统是用 Microsoft Visual Studio 2008 进行的页面设计、代码编写及调
试运行。
本系统一共包含六个界面,分别为登录界面、管理员界面、普通用户界面、
员工管理界面、管理员资料修改界面、普通用户资料修改界面。
数据库运用的是 Microsoft SQL Server 2008,与系统建立数据库连接后,
可以对数据库进行增、删、查、改操作。
登录界面为首界面,用户从登录界面进行登录,登录时根据身份选择管理员
或普通用户。登录后进入相应页面,可以在页面内进行操作,例如管理用户、修
改个人资料等,还可以对员工进行管理。
登录:
if (radioButton1.Checked)
{
if (this.textBox1.Text == "" || this.textBox2.Text == "")
MessageBox.Show("请输入登录帐号和密码", "提示");
else
{
string s = "DATABASE=人事管理系统;SERVER=localhost;Integrated Security=True;";
SqlConnection conn = new SqlConnection(s);
conn.Open();
string sql = "select * from 管理员表 where adimid='" +
this.textBox1.Text.Trim() + "' and psw='" + this.textBox2.Text.Trim() + "'";
SqlCommand cmd1 = new SqlCommand(sql, conn);
if (cmd1.ExecuteScalar() != null)
{
textBox1.Text = this.textBox1.Text.Trim();
this.Visible = false;
this.Hide();
管理员 main = new 管理员(textBox1.Text);
main.ShowDialog();
}
else
{
MessageBox.Show("帐号或密码错误!", "提示");