




已閱讀5頁,還剩7頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
C#大作業(yè)報(bào)告-考勤管理系統(tǒng)一、 需求分析公司人員上下班考勤情況需要管理,為了簡化管理,開發(fā)一個(gè)電子考勤系統(tǒng),簡化考勤的過程,以及主管人員查看員工的考勤情況。二、 系統(tǒng)模板設(shè)計(jì)針對不同的用戶設(shè)計(jì)了不同的模板。主要用戶有員工和管理人員。1. 員工員工上下班需要使用系統(tǒng)進(jìn)行打卡登記。需要輸入自己的員工號,選擇上班或者下班。2. 管理人員需要對部門、員工等重要信息進(jìn)行必要的維護(hù)。比如新增加某個(gè)部門,新增員工等操作。還可以查看各個(gè)員工的考情情況,搜索某一個(gè)特定員工指定的情況等功能。三、 系統(tǒng)主要流程1. 員工:輸入員工號選擇上班/下班相關(guān)信息進(jìn)入數(shù)據(jù)庫存儲(chǔ)2. 管理人員:系統(tǒng)登錄(用戶,密碼). 用戶密碼驗(yàn)證成功管理主界面部門,員工信息維護(hù)考勤統(tǒng)計(jì)退出系統(tǒng)四、 系統(tǒng)界面和主要源代碼1. 員工打卡界面: 主要代碼:/根據(jù)用戶是否存在執(zhí)行不同的操作 if (empName = ) MessageBox.Show(對不起,該員工號不存在!請重新輸入!, 系統(tǒng)提示); else /如果用戶存在,查看今天有沒有簽退記錄 commandText = string.Format(select count(*) from T_Record where EID=0 and type=2 and year(RecordTime)=year(getdate() and month(RecordTime)=month(getdate() and day(RecordTime)=day(getdate(), txtEID.Text); cmd = new SqlCommand(commandText, conn); conn.Open(); int ret = Convert.ToInt32(cmd.ExecuteScalar(); conn.Close(); if (ret 0) MessageBox.Show(對不起, + empName + ,您已經(jīng)簽退!, 系統(tǒng)提示); else /如果沒有簽退,在系統(tǒng)中記錄用戶的簽退信息 commandText = string.Format(insert into T_Record(EID,Type,IsLate) values(0,1,2), txtEID.Text, 2, early); cmd = new SqlCommand(commandText, conn); conn.Open(); cmd.ExecuteNonQuery(); if (early = 0) MessageBox.Show(再見: + empName , 系統(tǒng)提示); else MessageBox.Show(對不起: + empName + ,您早退了!, 系統(tǒng)提示); 2.管理人員:(1)登錄界面:主要代碼:private void btnOk_Click(object sender, EventArgs e) string commandText = select count(*) from T_Operator where OperID=OperID And Pwd=Pwd; using (SqlConnection conn = new SqlConnection(SQLDBHelper.ConnectionString) using (SqlCommand cmd = new SqlCommand(commandText, conn) SqlParameter para = new SqlParameter new SqlParameter(OperID,txtOperID.Text), new SqlParameter(Pwd,txtPwd.Text) ; cmd.Parameters.AddRange(para); conn.Open(); int ret = Convert.ToInt32(cmd.ExecuteScalar(); if (ret = 1) MainForm form = new MainForm(); form.Show(); this.Hide(); else MessageBox.Show(用戶名或密碼錯(cuò)誤!); (2)維護(hù)主界面:主要代碼:public partial class MainForm : Form public MainForm() InitializeComponent(); private void tsbExit_Click(object sender, EventArgs e) Application.Exit(); private void tsbRecord_Click(object sender, EventArgs e) RecordListForm form = new RecordListForm(); form.ShowDialog(); private void tsbEmp_Click(object sender, EventArgs e) EmpListForm form = new EmpListForm(); form.ShowDialog(); private void tsbDepart_Click(object sender, EventArgs e) DepartListForm form = new DepartListForm(); form.ShowDialog(); private void MainForm_FormClosed(object sender, FormClosedEventArgs e) Application.Exit(); (3)統(tǒng)計(jì)查看界面: 主要代碼:tring commandText = select d.DName as 部門,r.EID as 職員編號,e.EName as 姓名,r.RecordTime as 記錄時(shí)間,case when Type=1 then 上班 else 下班 end as 類型, + casewhen (IsLate=0 and Type=1) or(IsLate=0 and Type=2) then 正常 when (IsLate=1 and Type=1) then 遲到else 早退 end as 狀態(tài) + from T_Record r,T_Employee e,T_Department d where r.EID=e.EID and d.DID=e.DID + sCon.ToString(); using (SqlConnection conn = new SqlConnection(SQLDBHelper.ConnectionString) using (SqlDataAdapter sda = new SqlDataAdapter(commandText, conn) DataSet ds = new DataSet(); sda.Fill(ds); dgvRecord.DataSource = ds.Tables0; (4)部門維護(hù)界面:主要代碼:private void 修改職員信息ToolStripMenuItem_Click(object sender, EventArgs e) if (lvDepart.SelectedItems.Count = 0) return; string did = lvDepart.SelectedItems0.Text; DepartForm form = new DepartForm(OperType.Modify, did); form.ShowDialog(); /刷新數(shù)據(jù) if (form.DialogResult = System.Windows.Forms.DialogResult.OK) btnQuery_Click(sender, e); private void 刪除職員信息ToolStripMenuItem_Click(object sender, EventArgs e) if (lvDepart.SelectedItems.Count = 0) return; if (MessageBox.Show(您確實(shí)要?jiǎng)h除部門編號為 + lvDepart.SelectedItems0.Text + 的部門信息嗎?, 系統(tǒng)提示, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = System.Windows.Forms.DialogResult.Yes) string commandText = delete from T_Department where DID=DID; using (SqlConnection conn = new SqlConnection(SQLDBHelper.ConnectionString) using (SqlCommand cmd = new SqlCommand(commandText, conn) cmd.Parameters.Add(new SqlParameter(DID, lvDepart.SelectedItems0.Text); conn.Open(); try int ret = cmd.ExecuteNonQuery(); if (ret 0) MessageBox.Show( 數(shù)據(jù)刪除成功! , 系統(tǒng)提示); /刷新數(shù)據(jù) btnQuery_Click(sender, e); else MessageBox.Show( 數(shù)據(jù)刪除失敗! , 系統(tǒng)提示); catch (Exception ex) MessageBox.Show( 該部門還有職員,請先刪除職員信息 , 系統(tǒng)提示); (5)員工維護(hù)界面:主要代碼:private void 修改職員信息ToolStripMenuItem_Click(object sender, EventArgs e) if (lvEmp.SelectedItems.Count = 0) return; string eid = lvEmp.SelectedItems0.Text; EmpForm form = new EmpForm(OperType.Modify, eid); form.ShowDialog(); /刷新數(shù)據(jù) if (form.DialogResult = System.Windows.Forms.DialogResult.OK) btnQuery_Click(sender, e); private void 刪除職員信息ToolStripMenuItem_Click(object sender, EventArgs e) if (lvEmp.SelectedItems.Count = 0) return; SqlConnection conn = new SqlConnection(SQLDBHelper.ConnectionString); SqlTransaction tran = null; if (MessageBox.Show(您確實(shí)要?jiǎng)h除員工號為 + lvEmp.SelectedItems0.Text + 的員工信息嗎?, 系統(tǒng)提示, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = System.Windows.Forms.DialogResult.Yes) try conn.Open(); tran = conn.BeginTransaction(); string commandText = delete from T_Record where EID= + lvEmp.SelectedItems0.Text + ; SqlCommand cmd = new SqlCommand(commandText, conn); cmd.Transaction = tran; cmd.ExecuteNonQuery(); commandText = delete from T_Employee where EID= + lvEmp.SelectedItems0.Text + ; cmd = new SqlCommand(commandText, conn); cmd.Transaction = tran; cmd.ExecuteNonQuery(); tran.Commit(); MessageBox.Show(職員刪除成功!, 系統(tǒng)提示); btnQ
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 農(nóng)業(yè)種植確權(quán)管理辦法
- 高層建筑火災(zāi)模擬與人員安全疏散策略研究
- 教育的進(jìn)階之路:學(xué)校改進(jìn)策略與實(shí)踐探索
- 普通設(shè)備租賃管理辦法
- 液氯企業(yè)安全風(fēng)險(xiǎn)隱患排查表
- 景區(qū)物業(yè)收費(fèi)管理辦法
- 電氣工程雙創(chuàng)人才培養(yǎng)模式探討與實(shí)踐
- 重點(diǎn)高校自學(xué)考試課程體系優(yōu)化研究
- 幕墻工程工作總結(jié)
- 高校數(shù)字化資源服務(wù)系統(tǒng)用戶體驗(yàn)優(yōu)化
- GB/T 8312-2002茶咖啡堿測定
- 2023年蘇州國發(fā)創(chuàng)業(yè)投資控股有限公司招聘筆試題庫及答案解析
- 通信線路工程施工組織設(shè)計(jì)方案【實(shí)用文檔】doc
- 護(hù)士注冊健康體檢表下載【可直接打印版本】
- 預(yù)計(jì)財(cái)務(wù)報(bào)表編制及分析課件
- 學(xué)生集體外出活動(dòng)備案表
- Q∕SY 1347-2010 石油化工蒸汽透平式壓縮機(jī)組節(jié)能監(jiān)測方法
- 西門子順序功能圖語言S7-Graph的應(yīng)用
- 中醫(yī)治療室工作制度管理辦法
- 提花裝造工藝技術(shù)培訓(xùn)課程
- 直播傳媒公司簡介PPT課件(參考)
評論
0/150
提交評論