?? classclient.vb
字號:
Imports System
Imports System.Text
Imports System.Data
Public Class ClassClient
Public Function Add(ByVal strId As String, ByVal strName As String, ByVal strType As String, ByVal strMoney As String) As Boolean
Dim strSQL As StringBuilder = New StringBuilder()
strSQL.AppendLine("INSERT INTO ")
strSQL.AppendLine("Client")
strSQL.AppendLine("(")
strSQL.AppendLine("ClientId,")
strSQL.AppendLine("ClientName,")
strSQL.AppendLine("TypeId,")
strSQL.AppendLine("Money")
strSQL.AppendLine(")")
strSQL.AppendLine("VALUES")
strSQL.AppendLine("(")
strSQL.AppendLine(strId & ",")
strSQL.AppendLine("'" & strName & "',")
strSQL.AppendLine(strType & ",")
strSQL.AppendLine(strMoney)
strSQL.AppendLine(")")
Return ClassCommon.RunSql(strSQL.ToString)
End Function
Public Function Delete(ByVal Intid As Integer) As Boolean
Dim strSQL As StringBuilder = New StringBuilder()
strSQL.AppendLine("DELETE FROM")
strSQL.AppendLine("Client")
strSQL.AppendLine("WHERE")
strSQL.AppendLine("=")
strSQL.AppendLine("" & Intid.ToString & "")
Return ClassCommon.RunSql(strSQL.ToString)
End Function
Public Function Edit(ByVal strId As String, ByVal Strname As String, ByVal strTypeid As String, Optional ByVal strMoney As String = "") As Boolean
Dim strSQL As StringBuilder = New StringBuilder()
strSQL.AppendLine("UPDATE ")
strSQL.AppendLine("Client")
strSQL.AppendLine("SET")
strSQL.AppendLine("ClientName")
strSQL.AppendLine("=")
strSQL.AppendLine(" '" & Strname & "',")
strSQL.AppendLine("TypeId = " & strTypeid)
If strMoney <> "" Then
strSQL.AppendLine(",Money = " & strMoney & "")
End If
strSQL.AppendLine("WHERE")
strSQL.AppendLine("ClientId =" & strId)
Return ClassCommon.RunSql(strSQL.ToString)
End Function
Public Function GetRowById(ByRef dsClient As DataSet, ByVal strId As String) As Boolean
Dim strSql As New StringBuilder
strSql.AppendLine("SELECT")
strSql.AppendLine("*")
strSql.AppendLine("FROM")
strSql.AppendLine("Client")
strSql.AppendLine("WHERE")
strSql.AppendLine("ClientId =" & strId)
Return ClassCommon.RunSql(dsClient, strSql.ToString)
End Function
Public Function List(ByRef dsClient As DataSet) As Boolean
Dim strSql As New StringBuilder
strSql.AppendLine("SELECT")
strSql.AppendLine("*")
strSql.AppendLine("FROM")
strSql.AppendLine("Client")
Return ClassCommon.RunSql(dsClient, strSql.ToString)
End Function
End Class
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -