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

📄 scmapp.vb

📁 超市进销存管理系统的源码。基于.NET平台
💻 VB
字号:
Public Class SCMApp
    Public Function DeleByKey(ByVal TabNam As String, ByVal KeyCol As String, _
            ByVal KeyVal As String) As Boolean
        '提示用户并删除数据,TabNam表中KeyCol列值为KeyVal的记录
        If MsgBox("数据删除后不可恢复,确实要删除吗?", MsgBoxStyle.YesNo + _
            MsgBoxStyle.Question) = MsgBoxResult.No Then Exit Function
        Dim dbObj As New SCMDB.SCMDB '---------------------------------------------------------------------
        Dim strSQL As String
        strSQL = "delete from  " & TabNam & "  where " & KeyCol & "='" & KeyVal & "'"
        Dim Re As String = dbObj.UpdateDataBase(strSQL)
        If Re = "Y" Then
            MsgBox("数据删除成功!", MsgBoxStyle.Information)
            Return True
        Else
            MsgBox("数据删除错误!错误原因:" & Re, MsgBoxStyle.Exclamation)
            Return False
        End If
    End Function

    Public Function InsertBySQL(ByVal StrSQL As String) As Boolean
        '根据StrSQL插入记录
        Dim dbobj As New SCMDB.SCMDB '------------------------------------------------------------------------------
        Dim Re As String = dbobj.UpdateDataBase(StrSQL)
        If Re = "Y" Then
            MsgBox("数据添加成功!", MsgBoxStyle.Information)
            Return True
        Else
            MsgBox("数据删除错误!错误原因:" & Re, _
                MsgBoxStyle.Exclamation)
            Return False
        End If
    End Function

    Public Function EditBySQL(ByVal strSQL As String) As Boolean
        '将数据编辑传入数据库,成功则提示并返回true,失败给出原因并返回False
        Dim dbobj As New SCMDB.SCMDB
        Dim Re As String = dbobj.UpdateDataBase(strSQL)
        If Re = "Y" Then
            MsgBox("数据编辑成功!", MsgBoxStyle.Information)
            Return True
        Else
            MsgBox("数据编辑错误!错误原因:" & Re, MsgBoxStyle.Exclamation)
            Return False
        End If
    End Function
    Public Shared Function STrim(ByVal strOri As String) As String
        '将单引号替换为两个单引号
        STrim = Replace(Trim(strOri), "'", "''")
    End Function
End Class

⌨️ 快捷键说明

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