C#公司員工管理系統(tǒng)實(shí)訓(xùn)報(bào)告.doc_第1頁
C#公司員工管理系統(tǒng)實(shí)訓(xùn)報(bào)告.doc_第2頁
C#公司員工管理系統(tǒng)實(shí)訓(xùn)報(bào)告.doc_第3頁
C#公司員工管理系統(tǒng)實(shí)訓(xùn)報(bào)告.doc_第4頁
C#公司員工管理系統(tǒng)實(shí)訓(xùn)報(bào)告.doc_第5頁
已閱讀5頁,還剩9頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

網(wǎng)絡(luò)協(xié)議編程設(shè)計(jì)C#實(shí)訓(xùn)課程項(xiàng)目報(bào)告公司管理系統(tǒng),自己做的,除了數(shù)據(jù)庫不能發(fā)其他源代碼都有(實(shí)訓(xùn)設(shè)計(jì))一、實(shí)訓(xùn)題目:公司員工管理系統(tǒng)二、實(shí)訓(xùn)意義:通過此次實(shí)訓(xùn),讓我們進(jìn)一步了解c#應(yīng)用程序開發(fā)的過程,同時也讓我們對前面所學(xué)的知識付出實(shí)踐,達(dá)到熟練掌握、綜合性應(yīng)用的目的。三、實(shí)訓(xùn)內(nèi)容:1、項(xiàng)目分析:1)員工信息管理 2)員工考勤管理2、項(xiàng)目設(shè)計(jì)首先,我們必須建立一個登錄系統(tǒng)和八個子系統(tǒng)。登錄系統(tǒng):用戶在登陸后可以進(jìn)行權(quán)限操作管理。員工信息管理系統(tǒng):對員工信息進(jìn)行查詢、修改、添加、刪除。員工考勤管理系統(tǒng):對員工考勤信息進(jìn)行查詢、修改、添加、刪除。使用SQL SERVER2005建立YGGL數(shù)據(jù)庫,其中包括:用戶表員工信息表員工考勤表四、項(xiàng)目的實(shí)現(xiàn)1、使用SQL2005創(chuàng)建YGGL數(shù)據(jù)庫。2、分別在SQL2005的YGGL數(shù)據(jù)庫下創(chuàng)建admin表、employee_info表、attendance表,其代表用戶表、員工信息表、員工考勤表。1) 用戶信息表:CREATE TABLE dbo.admin( name varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL, pwd varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL) ON PRIMARYGO2) 員工信息表CREATE TABLE dbo.employee_info( userid int NOT NULL, name char(10) COLLATE Chinese_PRC_CI_AS NOT NULL, sex char(10) COLLATE Chinese_PRC_CI_AS NOT NULL, workyear varchar(2) COLLATE Chinese_PRC_CI_AS NULL, phone varchar(50) COLLATE Chinese_PRC_CI_AS NULL, addr varchar(50) COLLATE Chinese_PRC_CI_AS NULL, CONSTRAINT PK_employee info PRIMARY KEY CLUSTERED ( userid ASC)WITH (IGNORE_DUP_KEY = OFF) ON PRIMARY) ON PRIMARYGO2) 員工考勤表CREATE TABLE dbo.attendance( userid int NOT NULL, leave int NULL, travel int NULL, absent int NULL, CONSTRAINT PK_attendance PRIMARY KEY CLUSTERED ( userid ASC)WITH (IGNORE_DUP_KEY = OFF) ON PRIMARY) ON PRIMARY3、使用C#進(jìn)行窗口設(shè)計(jì)(源代碼)1)登錄系統(tǒng):private void btnloginOK_Click_1(object sender, EventArgs e) SqlConnection dbConnection = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); SqlDataReader dataReader; string sqlString = SELECT name,pwd FROM admin; string loginPassWord = ; dbConnection.Open(); SqlCommand dbCommand = new SqlCommand(sqlString, dbConnection); dataReader = dbCommand.ExecuteReader(); try if (dataReader.HasRows) dataReader.Read(); LoginName = dataReadername.ToString(); loginPassWord = dataReaderpwd.ToString(); catch (Exception e1) MessageBox.Show(e1.Message, 登陸出錯); dataReader.Close(); if (LoginName = textBox1.Text & loginPassWord = textBox2.Text) this.Hide(); Main frm1 = new Main(); frm1.ShowDialog(); else MessageBox.Show(請輸入正確的用戶名或者密碼!, 登陸出錯); LoginName = null; 2)員工信息查詢系統(tǒng):查詢:private void btnDemand_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); if (rdbid.Checked = true) sda = new SqlDataAdapter(select * from employee_info where userid=+textChecked.Text.Trim()+, conn); ds = new DataSet(); sda.Fill(ds,employee_info); if (rdbname.Checked = true) sda = new SqlDataAdapter(select * from employee_info where name= + textChecked.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, employee_info); else dataGridView1.DataSource = ds.Tables0; 3)員工考勤管理系統(tǒng):查詢:private void btnDemand1_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(select * from attendance where userid= + textChecked1.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, attendance); dataGridView2.DataSource = ds.Tables0; 修改:private void btnDemand2_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(update attendance set leave= + textleave.Text.Trim() + ,travel= + texttravel.Text.Trim() + , absent= + textabsent.Text.Trim() + where userid= + textChecked1.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, attendance); 4)新窗體:添加窗體:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace WindowsApplication1 public partial class insert : Form public insert() InitializeComponent(); private void insert_Load(object sender, EventArgs e) SqlDataAdapter sda; SqlConnection conn; DataSet ds; private void btnDemand5_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(insert into employee_info values( + textuserid1.Text.Trim() + , + textname1.Text.Trim() + , + textsex1.Text.Trim() + , + textworkyear1.Text.Trim() + , + textphone1.Text.Trim() + , + textaddr1.Text.Trim() + ), conn); ds = new DataSet(); sda.Fill(ds, attendance); private void btnresult2_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(select * from employee_info , conn); ds = new DataSet(); sda.Fill(ds, attendance); dataGridView1.DataSource = ds.Tables0; 修改窗體:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace WindowsApplication1 public partial class Update : Form public Update() InitializeComponent(); private void Update_Load(object sender, EventArgs e) private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) SqlDataAdapter sda; SqlConnection conn; DataSet ds; private void btnDemand3_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(select * from employee_info where userid= + textChecked2.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, attendance); dataGridView1.DataSource = ds.Tables0; private void btnDemand4_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(update employee_info set name= + textname.Text.Trim() + ,sex= + textsex.Text.Trim() + , workyear= + textworkyear.Text.Trim() + ,phone= + textphone.Text.Trim() + ,addr= + textaddr.Text.Trim() + where userid= + textChecked2.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, attendance); private void btnresult1_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(select * from employee_info where userid= + textChecked2.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, attendance); dataGridView1.DataSource = ds.Tables0; 刪除窗體:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace WindowsApplication1 public partial class delete : Form public delete() InitializeComponent(); private void delete_Load(object sender, EventArgs e) private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) SqlDataAdapter sda; SqlConnection conn; DataSet ds; private void btnDemand6_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(select * from employee_info where userid= + textChecked2.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, attendance); dataGridView1.DataSource = ds.Tables0; private void btnDemand7_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(delete from employee_info where userid= + textChecked2.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, attendance); private void btnDemand8_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(select * from employee_info , conn); ds = new DataSet(); sda.Fill(ds, attendance); dataGridView1.DataSource = ds.Tables0; 5)員工信息管理系統(tǒng):修改:private void btnupdate_Click(object sender, EventArgs e) Update frm2 = new Update(); frm2.ShowDialog(); private void btnDemand3_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(select * from employee_info where userid= + t extChecked2.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, attendance); dataGridView1.DataSource = ds.Tables0; private void btnDemand4_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(update employee_info set name= + textname.Text.Trim() + ,sex= + textsex.Text.Trim() + , workyear= + textworkyear.Text.Trim() + ,phone= + textphone.Text.Trim() + ,addr= + textaddr.Text.Trim() + where userid= + textChecked2.Text.Trim() + , conn); ds = new DataSet(); sda.Fill(ds, attendance); 添加:private void btninsert_Click(object sender, EventArgs e) insert frm2 = new insert(); frm2.ShowDialog(); private void btnDemand5_Click(object sender, EventArgs e) conn = new SqlConnection(server=.;database=YGGL;uid=sa;pwd=); sda = new SqlDataAdapter(insert into employee_inf

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論