⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classclient.vb

📁 这是一个订单管理系统
💻 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("ClientId")
        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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -