1、人事管理系统数据库源代码using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.L
2、inq;namespace WebApplication1 public partial class WebForm1 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) Response.Redirect(/登录.aspx); protected void Button2_Click(object sender, EventArgs e) Response.Redirect(/人员信息
3、查询.aspx); protected void Button3_Click(object sender, EventArgs e) Response.Redirect(/人员修改.aspx); protected void Button4_Click(object sender, EventArgs e) Response.Redirect(/部门信息.aspx); protected void Button5_Click(object sender, EventArgs e) Response.Redirect(/工资信息.aspx); using System;using System.
4、Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;namesp
5、ace WebApplication1 public partial class 部门信息 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) bool find =false; SqlConnection con=new SqlConnection(server=localhost;Integrated Security=SSPI;database=人事管理系统); con.Open(
6、); string cmdstr=select * from 部门表; SqlDataAdapter da=new SqlDataAdapter(cmdstr,con); DataSet ds=new DataSet(); da.Fill(ds); for(int i=0;ids.Tables0.Rows.Count;i+) for(int j=0;jds.Tables0.Columns.Count;j+) String data=(ds.Tables0.Rowsij.ToString().Trim(); if(data=TextBox1.Text.Trim() TextBox2.Text=d
7、s.Tables0 .Rowsi部门代码.ToString(); TextBox3.Text=ds.Tables0 .Rowsi部门名称.ToString(); find=true; if (find = false) Response.Write(window.alert(没有相关记录!); con.Close(); protected void Button2_Click(object sender, EventArgs e) Response.Redirect(/Default.aspx); using System;using System.Collections;using Syst
8、em.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;using System.Data.SqlTypes;n
9、amespace WebApplication1 public partial class _Default : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void TextBox1_TextChanged(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) SqlConnection con = new SqlConnection(server=local
10、host;Integrated Security=SSPI;database=人事管理系统); string strCount; strCount = select * from 人事表; con.Open(); SqlCommand = new SqlCommand(strCount, con); SqlDataReader dr = .ExecuteReader(); string strUsername = , strPassword = ; while (dr.Read() if (TextBox1.Text = dr编号.ToString()|TextBox2.Text = dr用户
11、密码.ToString() strUsername = dr编号.ToString(); strPassword = dr用户密码.ToString(); break; dr.Close(); con.Close(); if (strUsername = ) Response.Write(alert(登录成功!);); return; protected void Button2_Click(object sender, EventArgs e) Response.Redirect(/Default.aspx); using System;using System.Collections;us
12、ing System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;namespace WebApplica
13、tion1 public partial class 工资信息 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void TextBox2_TextChanged(object sender, EventArgs e) protected void TextBox5_TextChanged(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) bool find
14、 = false; SqlConnection con = new SqlConnection(server=localhost;Integrated Security=SSPI;database=人事管理系统); con.Open(); string cmdstr = select * from 工资表; SqlDataAdapter da = new SqlDataAdapter(cmdstr, con); DataSet ds = new DataSet(); da.Fill(ds); for (int i = 0; i ds.Tables0.Rows.Count; i+) for (i
15、nt j = 0; j ds.Tables0.Columns.Count; j+) String data = (ds.Tables0.Rowsij.ToString().Trim(); if (data = TextBox1.Text.Trim() TextBox2.Text = ds.Tables0.Rowsi应发工资.ToString(); TextBox3.Text = ds.Tables0.Rowsi岗位津贴.ToString(); TextBox4.Text = ds.Tables0.Rowsi奖励.ToString(); TextBox5.Text = ds.Tables0.Ro
16、wsi保险.ToString(); find = true; if (find = false) Response.Write(window.alert(没有相关记录!); con.Close(); protected void Button2_Click(object sender, EventArgs e) Response.Redirect(/Default.aspx); using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using Sy
17、stem.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;namespace WebApplication1 public partial class 人员信息 : System.Web.UI.Page protected void P
18、age_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) Response.Redirect(/Default.aspx); protected void Button2_Click(object sender, EventArgs e) bool find =false; SqlConnection con = new SqlConnection(server=localhost;Integrated Security=SSPI;database=人事管理系统);
19、 con.Open(); string cmdstr=select * from 工资表; SqlDataAdapter da=new SqlDataAdapter(cmdstr,con); DataSet ds=new DataSet(); da.Fill(ds); for(int i=0;ids.Tables0.Rows.Count;i+) for(int j=0;jds.Tables0.Columns.Count;j+) String data=(ds.Tables0.Rowsij.ToString().Trim(); if(data=TextBox1.Text.Trim() TextB
20、ox2.Text=ds.Tables0 .Rowsi应发工资.ToString(); TextBox3.Text=ds.Tables0 .Rowsi岗位津贴.ToString(); TextBox4.Text=ds.Tables0 .Rowsi奖励.ToString(); TextBox5.Text = ds.Tables0.Rowsi保险.ToString(); find=true; if (find = false) Response.Write(window.alert(没有相关记录!); con.Close(); using System;using System.Collection
21、s;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;namespace WebApp
22、lication1 public partial class 人员修改 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void TextBox5_TextChanged(object sender, EventArgs e) protected void Button2_Click(object sender, EventArgs e) SqlConnection con=new SqlConnection(server=localhost;Integrated Secur
23、ity=SSPI;database=人事管理系统); con.Open(); string insert=insert into 人事表(员工号,姓名,性别,职称,学历) values(+ TextBox1.Text.Trim() +,+ + TextBox2.Text.Trim() +,+ TextBox3.Text.Trim() + , + TextBox4.Text.Trim() +,+ +TextBox5.Text.Trim() + +);Response.Write(insert);SqlCommand cmd1=new SqlCommand(insert,con);con.Close(); protected void Button1_Click(object sender, EventArgs e) Response.Redirect(/Default.aspx); protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)