數(shù)據(jù)庫vb人事管理系統(tǒng)_第1頁
數(shù)據(jù)庫vb人事管理系統(tǒng)_第2頁
數(shù)據(jù)庫vb人事管理系統(tǒng)_第3頁
數(shù)據(jù)庫vb人事管理系統(tǒng)_第4頁
數(shù)據(jù)庫vb人事管理系統(tǒng)_第5頁
已閱讀5頁,還剩15頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

/20createtable月出勤情況(員工編號intnotnull,員工姓名nvarchar(10)notnull,所在部門編號intnotnull,請假天數(shù)intnull,加班天數(shù)intnull,曠工天數(shù)intnull,月全天出勤天數(shù)intnull,日期datetimenull,primarykey(員工編號,員工姓名,所在部門編號))createtable人事調(diào)動(員工編號intnotnull,員工姓名nvarchar(10)notnull,調(diào)動原因nvarchar(30)null,原部門編號intnotnull,原職位nvarchar(10)null,現(xiàn)部門編號intnotnull,現(xiàn)職位nvarchar(10)null,primarykey(員工編號,員工姓名))createtable登錄信息(用戶名nvarchar(20)null,用戶密碼nvarchar(20)null)createtable管理員信息(用戶名nvarchar(20)null,用戶密碼nvarchar(20)null)createview員工工資查詢asselect員工編號,員工姓名,請假天數(shù),加班天數(shù),曠工天數(shù),月全天出勤天數(shù),總工資from工資,月出勤情況where工資.員工編號=月出勤情況.員工編號;createview部門員工信息asselect部門編號,部門名稱,員工編號,員工姓名from員工信息,部門信息where員工信息.所在部門編號=部門信息.部門編號createview員工簡單信息查詢asselect員工編號,員工姓名,所在部門編號,部門名稱,職位,聯(lián)系電話from員工信息,部門信息where員工信息.所在部門編號=部門信息.部門編號insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(101,'行政部',0,'無')insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(102,'人事部',0,'無')insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(103,會計部',0,'無')insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(104,銷售部',0,'無')insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(105,'包裝部',0,'無')insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(106,'技術(shù)部',0,'無')insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(107,生產(chǎn)部',0,'無')insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(108,宣傳部',0,'無')insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(109,'采購部',0,'無')insert部門信息(部門編號,部門名稱,部門人數(shù),部門描述)values(110,服務(wù)部',0,'無')insert行政部(員工編號,員工姓名)values(10101,'劉星')insert行政部(員工編號,員工姓名)values(10103,'劉小星')insert行政部(員工編號,員工姓名)values(10104,'劉中星')insert行政部(員工編號,員工姓名)values(10107,'劉大星')insert行政部(員工編號,員工姓名)values(10108,'劉笑星')insert行政部(員工編號,員工姓名)values(10109,'劉校星')insert月出勤情況(員工編號,員工姓名,所在部門編號,請假天數(shù),加班天數(shù),曠工天數(shù),月全天出勤天數(shù))values(10201,'劉星',102,0,0,0,30)insert人事調(diào)動(員工編號,員工姓名,原部門編號,原職位,現(xiàn)部門編號,現(xiàn)職位)values(10201,'劉星',101,'經(jīng)理',102,'經(jīng)理')insert登錄信息(用戶名,用戶密碼)values('10101','10101')insert登錄信息(用戶名,用戶密碼)values('10201','10201')insert管理員信息(用戶名,用戶密碼)values('sa','123')vb部分代碼form1代碼PrivateSub關(guān)閉—Click()EndEndSubPrivateSub管理員登陸_Click()frmLogin.ShowUnloadMeEndSubPrivateSub員工登陸_Click()frmLogin1.ShowUnloadMeEndSub管理員登陸代碼OptionExplicitPrivateSubcmdCancel_Click()Me.HideForm1.ShowEndSubPrivateSubcmdOK_Click()DimuserAsString,passAsString,sqluseAsString,sqlpassAsString,trsqlAsStringIftxtUserName.Text=""ThenMsgBox"請輸入用戶名!",vbExclamationtxtUserName.SetFocusElseuser=txtUserName.TextEndIfIftxtPassword.Text=""ThenMsgBox"請輸入密碼!",vbExclamationtxtPassword.SetFocusElsepass=txtPassword.TextEndIfsqluse="SELECT*FROM管理員信息WHERE用戶名='"&user&"'"sqlpass="SELECT*FROM管理員信息WHERE用戶密碼="'&pass&""'trsql="SELECT*FROM管理員信息WHERE用戶名="'&user&"'AND用戶密碼="'&pass&""'WithAdodc1.CommandType=adCmdText.RecordSource=sqluse.RefreshIf.Recordset.EOFAnd.Recordset.BOFThenMsgBox"沒有此用戶,請重新輸入!"Else.RecordSource=sqlpass.RefreshIf.Recordset.EOFAnd.Recordset.BOFThenMsgBox"密碼錯誤,請重新輸入!"Else.RecordSource=trsql.RefreshIf.Recordset.EOFAnd.Recordset.BOFThenMsgBox"無效用戶,請重新輸入!"ElseForm8.ShowUnloadMeEndIfEndIfEndIfEndWithEndSubPrivateSubrorm_initialize()ChDriveApp.PathChDirApp.PathEndSub員工信息操作PrivateSubCommand1_Click()'添加用戶DimuserAsIntegeruser=Val(Text1.Text)WithAdodc1.CommandType=adCmdText.RecordSource="SELECT*FROM員工信息WHERE員工編號="&user&"".RefreshIf.Recordset.BOFThen.Recordset.AddNew.Recordset.Fields(0).Value=user.Recordset.Fields(1).Value=Text2.Text.Recordset.Fields(2).Value=Val(Text3.Text).Recordset.Fields(3).Value=Text4.Text.Recordset.Fields(4).Value=Text5.Text.Recordset.Fields(5).Value=Text6.Text.Recordset.Fields(6).Value=Text7.Text.Recordset.Fields(7).Value=Text8.Text.Recordset.Fields(8).Value=Text9.Text.Recordset.Fields(9).Value=Text10.Text.Recordset.Fields(10).Value=Text11.Text.Recordset.Fields(11).Value=Text12.Text.Recordset.UpdateMsgBox"添加用戶成功"UnloadMeElseMsgBox"員工編號已注冊,請重新輸入"Me.HideEndIfEndWithEndSubPrivateSubCommand2_Click()Form8.ShowEndSubPrivateSubCommand3_Click()'修改信息Dimuser1AsInteger,user2AsStringuser1=Val(Text13.Text)user2=Text14.TextWithAdodc1.CommandType=adCmdText.RecordSource="SELECT*FROM員工信息WHERE員工編號="&user1&"AND員工姓名='"&user2&"'".RefreshIf.Recordset.BOFThenMsgBox"你的資料未輸入系統(tǒng),請找管理員"Else.Recordset.Fields(0).Value=Text1.Text.Recordset.Fields(1).Value=Text2.Text.Recordset.Fields(2).Value=Text3.Text.Recordset.Fields(3).Value=Text4.Text.Recordset.Fields(4).Value=Text5.Text.Recordset.Fields(5).Value=Text6.Text.Recordset.Fields(6).Value=Text7.Text.Recordset.Fields(7).Value=Text8.Text.Recordset.Fields(8).Value=Text9.Text.Recordset.Fields(9).Value=Text10.Text.Recordset.Fields(10).Value=Text11.Text.Recordset.Fields(11).Value=Text12.Text.Recordset.UpdateBatchMsgBox"該員工信息已經(jīng)修改,請查詢確認(rèn)!"EndIfEndWithEndSubPrivateSubCommand4_Click()'刪除信息DimuserAsIntegeruser=Val(Text13.Text)WithAdodc1.CommandType=adCmdText.RecordSource="SELECT*FROM員工信息WHERE員工編號="&user&"".RefreshIf.Recordset.BOFThenMsgBox"沒有此員工"Else.Recordset.Delete.RefreshEndIfEndWithEndSubPrivateSubCommand5_Click()'確認(rèn)鍵Dimuser1AsInteger,user2AsStringuser1=Val(Text13.Text)user2=Text14.TextWithAdodc1.CommandType=adCmdText.RecordSource="SELECT*FROM員工信息WHERE員工編號="&user1&"AND員工姓名='"&user2&"'".RefreshIf.Recordset.BOFThenMsgBox"你的資料未輸入系統(tǒng),請找管理員"ElseText1.Text=.Recordset.Fields(0).ValueText2.Text=.Recordset.Fields(1).ValueText3.Text=.Recordset.Fields(2).ValueText4.Text=.Recordset.Fields(3).ValueText5.Text=.Recordset.Fields(4).ValueText6.Text=.Recordset.Fields(5).ValueText7.Text=.Recordset.Fields(6).ValueText8.Text=.Recordset.Fields(7).ValueText9.Text=.Recordse

溫馨提示

  • 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

提交評論