Thiet he giao dién la m6t phitn quan trong ciia hé thi5ng, boi giao dien la hinh tinh d6u tien ma nguoi dung quan sat dune.Giao dien th iét he sao cho vua dep mat,vua de hiéu kh i nhin va co thé biet dune no thuc hien c6ng viéc gi, quip
cho nguoi sit dung de dang.Vi vdy khi thiét ké giao dién c:In chit y dén yéu to
Form dang nh:ip:
Phitn giao dun chinh g6m cac phdn ung voi cue nghiep vu quan ly nh tln su ciia cong ty TNHH Hung Long:
- Quan ly ho so cong nhan: de qué n ly' thong tin cfia cong nhan do bo phan quan ly hi5 so dune su dung, chi co ban giii m d6c va admin dune str dung.
uiin I ch tlm cong (chdm c6ng theo ngay): de chdm c6ng cua ci5ng nh tln theo ngay lain viéc do bo phan qu:in ly ch:inn cong sit dung (qu:in ly xu6ng), chi
co quan ly' xuéing va admin duoc sit dung. Qu:in ly chain cong gore nhimg muc nho:
+ Danh muc san phdm + Bang ch:inn cong
- Quan ly luong: dung dé tinh luong san ph:inn, theo dtii tain ring, ghi thu6ng vao cuoi th:ing va theo diii tr:i luong ciia c:ic cong nh:in do bo ph:in luong sit dung, chi co bo ph:in qu:in ly luong va admin duoc sit dung.
+ Chi tain ring + Thuong + Tinh luong + Tra luong
- B:to c:to: gore c‹ac b:t o c:to: ch:tin cong, tain ring va luong do ban giiim doe sir dung, chi co ban gi:inn doc va admin duoc sir dung.
Hit
Cong ty TNHH HiJng Long
Giao dién nay co chuc nang nhu sau:
C:ip nh:ip n nnhh::iinn moi thong qua nfit Moi.
Chinh sha thong tin c6ng nhdn th6ng qua nut Sua. Xoii thi5ng tin ci5ng nhdn thi5ng qua nut Xo:i.
Khi muon fun hay huy thong tin cong nh:in da c:ip nhat hoac chinh siia hay khong thi thong qua nfit Luu hay Huv'.
Tho:it khoi chuong trinh c:ip nhat my thong qua nut Tho:it.
Hit
Giao dién nay dé cup nhiit thong tin cho cong nhiin moi, neu da nhiip dung thi Luu neu khong thi Hub, cup nhiit xong thi Tho:it.
Danh nine s:i n ph:inn (Trong ph:in ch:i nn ciingl:
JJ J
J
Giao dién nay dung dé cup nhdt moi, chinh siia, xo:i, fun hay huy thong tin vé s:in phdm qua c:ic nut M6i, Siia, Xoii, Luu, Hub.
Bang chain c6ng (Trong phan ch:i nn cung):
Giao dien nay dung de ghi, huy, xoii th6ng tin vé chitm ci5ng qua c:ie nut tuong ring. Bang chdm c6ng nay dune tong hop len bang luong. Chdm c6ng sé dune thuc hién trong tung ngay, do quan ly xuéin g (b0 ph(i n chdm cong) ghi chép bang chdm cong nay.
Tann ring cho cling nh:in (Trong ph:in qu:in ly luongl :
Form my dung dé lam ghi tain ring cua c6ng nhdn, dune t6ng hop dé trii trong b:ing luong.
Ghi
thuéng emu th:ing:
Giao dien nay duoc dung cuoi moi th:ing de ghi thu6ng cho cong nhan duoc thuéin g trong thiing qua nut Ghi, co chtic nang t6ng hop len bring luong cuoi thiing.
Tinh luring duoc tinh vao cuoi th:ing, sau khi da cdp nh(1t dtly dii chtlm c6ng, tain ring, thuéing. Tinh luong do bi ph8n qu:in ly luong thuc hien va duoc t6ng hpp tu c:ic bang chain cong, thu6ng va tain ring.
Tr:i luong cho c6ng nhA n:
Tra luong duoc tr:i vao cuoi th:ing, sau khi da tinh luong.
Tra luong duoc tong hpp tit b:ing luong. Khi thuc hien tra luong, bo phan qu:in ly luong sé ghi nh(tn luong vao bring luong.
B:to c:to chain
Ham goi dii liéu vé phan mém: Public Sub getDatd()
Dim strPath As String rgtTmp -
Registry. LocalMachine. OpenSubKey("sor)#ARE\\QLNS",)‹ue) strPath - rgtTmp.GetValue["Database"] &
” \data\Demo.mdb"
strConn "Provider=Microsoft. Jet.OLEDB. 4.0; ” & "Data Source= " & strPath & “ , Password=l23456; &
CompdCt=False; &
"Jet OLEDB:Database
'Set OLEDB - srP= ralse; ” & "Mode=ShdDe Deny None; “ & "Jet OLEDB:Don' t Copy Locale on "User ID=Admin"
oAdt. SeleCtCommdnd = New OleDbCOmmdnd["SELECT ’ FROM tblHoSoCN where active-true order by ngayvao", oConn)
oTbl.Clear[) Try
oAdt. Fill (oTbl) batch ex As Exception
MsgBox[ex.Message)
Eod Tvy
Dim oCol As New DataColumn oCol. ColumnName =
"NgaySinhVN“ oTbl. Columns. Add[oCol)
oCol New DataColumn
oCol.ColumnName = "NgdyVaoVN" oTbl. Columns. Add[oCol) Dim oDrw As DataRow
For Each oDrw In oTbl. Rows oDrw["NgaySinhVN")
Ddte TranfeF( ODFW["NgdySinh") .ToString. Substring(0, 10))
oDrw["NgayVd OVN")
Date Tranfer[oDrw["NgayVao") .ToString. Substring(0, 10)) Next
End Sub
Ham dav dii liéu lien két en so dir liéu: Public Sub PostData[]
oAdt. Update[oTbl]
And Sub
Hamkiem tc× Usec
Sub KiemTraUser[)
oData = New clsData
oData.SQLCommandType clsData. SQLCommandTypeEnum. Text oData.SQLCommand = "select ’ from sysUserInfo" tblUser oData.GetDataTable
If tblUser. Select["UserID = '” & strUserID & " ' and Password = '” & strPassword & "' and Active = true“).Length <= 0 Then
stOk False
44 44
MsgBox[“ Nguoi su dung nay khong ton tdi hoac sai mat khau dang nhap!", MsgBoxStyle.Critical, "Théng bao")
'dev == l
Else
oData = New clsData
oDatd .SQLCOmMdMdType
clsData.SQLCommandTypeEnum. Text
oData. SQLCommand - "select ’ from sysGroupInfo " & ”where GrouplD
tblUser. Select("UserID = '" & strUserlD & " ' '" & strPassword & ”'") (0) ("GrouplD") & ”'"
tblGroup = oData.GetDataTable
and Password
rgtTmp
Registry. LocalMachine. OpenSubKey("sor)#ARE\\QLNS",True) If rgtTmp Is Nothing Then
rgtTmp
Registry. LocalMachine .CFedteSubKey("SOFTWARE\\QLNS")
End If
strUserName - tblUser. Select["UserID - '" & strUserID & " ' and Password - '" & strPassword &
”'") (0)i"UserName“)
rgtTmp.SetValue("UserName", strUserName) strGrouplD = tblGroup. Rows(0) ("GroupID") strGroupName = tblGroup. Rows(0) ("GroupName") strHoSoRight = tblGroup. Rows(0) ("HoSo")
strChamCongRight = tblGroup. Rows[0) ("ChamCong“) strTraLuongRight = tblGroup. Rows[0) ("TraLuong“) strtUserRight = tblGroup. Rows (0)[“tUser”)
rgtTmp.SetVdlue ("Ddtabase", Application. StartupPath)
stOk True
End If End Sub
FormStatusBar .Text = " Userl D:“ & strUserID & >> User name:" & strUserName & strGroupName If strHoSoRight Then grpHoSo. Enabled - True > > G ro up name : ” s
ElsegrpHoSo. Enabled = False End If
If strChamCongRight Then
grpChdmCong. Enabled = True ElsegrpChamCong. Enabled = False End If
If strTrdLuongRight Then
grpLuong. Endbled = True ElsegrpLuong. Enabled - False End If
If strtUserRight Then
grpUser. Enabled - True ElsegrpUser. Enabled = False Eod If
Tinh luong:
Me.Cursor
System.Windows. Forms.Cursors. WaitCursor
Dim Ithang As Integer = cbOThdng. Text
Dim Inam As Integer = cboNam. Text Dim CountHoSoCN As Integer
Dim oData As New clsData
oDatd .SQLCOmMdMdType
clsDdta. SQLCommandTypeEnum. Text
oDatd .SQLCOmMdMd = “select count[’) from tblHoSoCN where active true“
Dim tblLuong As New DataTable Dim strPath As String
rgtTmp
Registry.LocalMachine. OpenSubKey["SOFTWARE YY QLNS", True) strPath = rgtTmp. GetValue["Database") &
“ \ddtd \Demo.mdb"
strConn "Provider-Microsoft. Jet.OLEDB. 4. 0; " & "Data Source- " & strPath & " , Password=123456; &
on Compact=ralse; &
”Jet OLEDB:Database
”Jet OLEDB: SFP= False; " & “Mode=Share Deny None; " & ”Jet OLEDB:Don' t Copy Locale
”User ID=Admin"
oAdt. SelectCommand New OleDbCommand("SELECT from tblLuong" &
where thang-'" & cboThang. Text & "/" & c oNam. Text &
"'
oAdt. Fill( tblLuong) match ex As Exception
MsgBox(ex. Message) End Try
", oConn)
If tblLuong.Rows. Count < CountHoSoCN Then
If MsgBox["Hay cap nhat lai thuong cuoi thang truéc khi tinh luong!", MsgBoxStyle. YesNo, "Thong bao") MsgBoxResult. Yes Then
Me.Hide()
Dim frm As New frmThuong
frm. thang - cboThang. Text frm. nam - cboNam.Text
frm.ShowDialog() frm.Dispose() Me.Dispose()
ElseReturn
MsgBox("Chuong trinh chi tinh luong nhung
cong nhan cé trong bang thuong! ", "Thong béo") End If
End If
Dim tblTienCong As New DdtdTable oData = New clsData oData. SQLCommandType - clsData. SQLCommandTypeEnum. Text
oData. SQLCommand = ”SELECT tblChamCong. MaCN, Sum([SoLuong]*[SoMuiTheu]*[DGTCMT]) AS LuongSP " & _
”FROM tblChamCong " & ”INNER JOIN tblSanPham " & “ON tblChdmCong. MdSP
tblSanPham. MaSP & Ithang & "') &
”WHERE ( ( (Month([Ngay]))='” &
”AND [ [Year([Ngay]))='" & Inam “GROUP BY
tblChdmCong. MaCN,Month(Ngdy), Year(Ngdy)“ tblTienCong - oData. GetDataTable
Dim tblTamUng As New DataTable oData = New clsData
oData.SQLCommandType - clsData.SQLCommandTypeEnum. Text
oData. SQLCommand = ”SELECT tblTamUng.MaCN, Sum(tblTamUng.SoTien) AS TongTamUng, Month([NgayTU]) AS thangTU, Year([ngayTU]) AS namTU ” &
"FROM(tblTamUng) “ & "GROUP BY tblTamUng.MaCN, Month[[NgdyTU]), Year ([ngdyTU]), tblTdmUng.Active " &
"HAVING [[[Month[[NgdyTU]))='" & Ithdng & "') & "AND ((Year[[ngayTU]))-'" & Inam &
"AND ((tblTamUng.Active)-True]) " tblTamUng - oData.GetDataTable
Dim oDrw As DataRow
If tblTienCong. Select["macn = '" & oDrw("macn") & "'").Length > 0 Then
oDrw[“Luong”) = tblTienCong. Select("macn & oDrw("macn"] & "'") [0) ("LuongSP"]
Else
oDrw["Luong") - 0 End If
If tblTamUng. Select("macn = '" & oDrw("macn”) & "'"].Length > 0 Then
oDrw["Tamung") - tblTamUng. Select("macn - ' " & oDrw( "macn") & ”'") (0)("TongTamUng”)
Else
oDrw["Tamung”) = 0 End If
NextoDrw("nhanluong”) = False oAdt.Update(tblLuong)
Me.Cursor System.Windows.
rorms.Cursors.Arrow Me. cmdOK. Text "OK“ Me. lblThongBao. Visible True
Me. lblThongBao. Text - "Da thuc hi n tinh luong! Dé xem béo céo tinh luong hay vao béo céo tinh luong de xem!"
End If
Hé thong thong tin moi duoc xay dung khong muc dich nao kh:ic nham giam do cong viec duoc thuc hie’n bcii con nguoi, dong then cong vie’c quan ly he thong cung don gun hon, cm it thoi gian hon, chinh x:ic hon va hieu qu:i cao hon.
Trong khuon kh0 dé :in mon hoc v6i dé tai: 'Pha ri li uh n ID ié“t hé“