?? clsevaluation.vb
字號(hào):
Class ClsEvaluation
'1 EvaMonth Char 10 考評(píng)月份
'2 Emp_Id Int 員工編號(hào)
'3 Performance Varchar 200 工作業(yè)績(jī)
'4 SupervisorEvaluation Varchar 200 領(lǐng)導(dǎo)評(píng)價(jià)
'5 PrizeFactor1 Decimal (4,1) 領(lǐng)導(dǎo)設(shè)定的獎(jiǎng)金系數(shù)
'6 HrEvaluation Varchar 200 人事部門(mén)評(píng)價(jià)
'7 PrizeFactor2 Decimal (4,1) 人事部門(mén)設(shè)定的獎(jiǎng)金系數(shù)
Public EvaMonth As String ' 考評(píng)月份
Public Emp_Id As Short ' 員工編號(hào)
Public Performance As String ' 工作業(yè)績(jī)
Public SupervisorEvaluation As String ' 領(lǐng)導(dǎo)評(píng)價(jià)
Public PrizeFactor1 As Single ' 領(lǐng)導(dǎo)設(shè)定的獎(jiǎng)金系數(shù)
Public HrEvaluation As String ' 人事部門(mén)評(píng)價(jià)
Public PrizeFactor2 As Single ' 人事部門(mén)設(shè)定的獎(jiǎng)金系數(shù)
Public Sub Init()
EvaMonth = ""
Emp_Id = 0
Performance = ""
SupervisorEvaluation = ""
PrizeFactor1 = 0
HrEvaluation = ""
PrizeFactor2 = 0
End Sub
'刪除Evaluation數(shù)據(jù)
Public Sub Delete(ByVal TmpMonth As String, ByVal TmpEmpId As Integer)
Dim SQLString As String
Dim MSG As String
SQLString = "DELETE FROM Evaluation WHERE EvaMonth='" & Trim(TmpMonth) & "' And Emp_Id=" & Trim(Str(TmpEmpId))
ClsOperation.DBOperate(SQLString, MSG)
End Sub
Public Function GetInfo(ByVal TmpMonth As String, ByVal TmpEmpId As Integer) As Boolean
If TmpMonth = "" Or TmpEmpId <= 0 Then
GetInfo = False
Exit Function
End If
EvaMonth = TmpMonth
Emp_Id = TmpEmpId
Dim SQLString As String
Dim MSG As String
SQLString = "SELECT * FROM Evaluation WHERE EvaMonth='" & Trim(TmpMonth) & "' And Emp_Id=" & Trim(Str(Emp_Id))
Dim DTable As DataTable = ClsOperation.DBOperate(SQLString, MSG)
If DTable.Rows.Count < 1 Then
GetInfo = False
Init()
Exit Function
Else
Performance = Trim(DTable.Rows(0)(2))
SupervisorEvaluation = Trim(DTable.Rows(0)(3))
PrizeFactor1 = Val(DTable.Rows(0)(4))
HrEvaluation = Trim(DTable.Rows(0)(5))
PrizeFactor2 = Val(DTable.Rows(0)(6))
End If
GetInfo = True
End Function
Public Function In_DB(ByVal TmpMonth As String, ByVal TmpEmpId As Integer) As Boolean
Dim SQLString As String
Dim MSG As String
SQLString = "SELECT * FROM Evaluation WHERE EvaMonth='" & Trim(TmpMonth) & "' And Emp_Id=" & Trim(Str(TmpEmpId))
Dim DTable As DataTable = ClsOperation.DBOperate(SQLString, MSG)
If DTable.Rows.Count < 1 Then
In_DB = False
Else
In_DB = True
End If
End Function
Public Sub Insert()
Dim SQLString As String
Dim MSG As String
SQLString = "INSERT INTO Evaluation Values('" & Trim(EvaMonth) & "'," & Trim(Str(Emp_Id)) & ",'" & Trim(Performance) & "','" & Trim(SupervisorEvaluation) & "'," & Trim(Str(PrizeFactor1)) & ",'" & Trim(HrEvaluation) & "'," & Trim(Str(PrizeFactor2)) & ")"
ClsOperation.DBOperate(SQLString, MSG)
End Sub
Public Sub Update(ByVal TmpMonth As String, ByVal TmpEmpId As Integer, ByVal HrFlag As Boolean)
Dim SQLString As String
Dim MSG As String
If HrFlag = False Then
SQLString = "Update Evaluation Set Performance='" & Trim(Performance) & "',SupervisorEvaluation='" & Trim(SupervisorEvaluation) & "',PrizeFactor1=" & Trim(Str(PrizeFactor1)) & " WHERE EvaMonth='" & Trim(TmpMonth) & "' And Emp_Id=" & Trim(Str(TmpEmpId))
Else
SQLString = "Update Evaluation Set HrEvaluation='" & Trim(HrEvaluation) & "',PrizeFactor2=" & Trim(Str(PrizeFactor2)) & " WHERE EvaMonth='" & Trim(TmpMonth) & "' And Emp_Id=" & Trim(Str(TmpEmpId))
End If
ClsOperation.DBOperate(SQLString, MSG)
End Sub
End Class
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -