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

📄 dbfee.vb

📁 由VB开发的基于SQL的小区物业管理系统
💻 VB
字号:
Public Class DBFee
    Inherits DBOperation
    Private _FeeType As String
    Private _FYear As String
    Private _FMonth As String
    Private _Amount As Double
    Private _Charge As Double
    Private _HouseNo As String
    Private _Memo As String
    Property FeeType() As String
        Get
            Return _FeeType
        End Get
        Set(ByVal value As String)
            _FeeType = value
        End Set
    End Property
    Property FYear() As String
        Get
            Return _FYear
        End Get
        Set(ByVal value As String)
            _FYear = value
        End Set
    End Property
    Property Fmonth() As String
        Get
            Return _Fmonth
        End Get
        Set(ByVal value As String)
            _Fmonth = value
        End Set
    End Property
    Property Amount() As Double
        Get
            Return _Amount
        End Get
        Set(ByVal value As Double)
            _Amount = value
        End Set
    End Property
    Property Charge() As Double
        Get
            Return _Charge
        End Get
        Set(ByVal value As Double)
            _Charge = value
        End Set
    End Property
    Property HouseNo() As String
        Get
            Return _HouseNo
        End Get
        Set(ByVal value As String)
            _HouseNo = value
        End Set
    End Property
    Property Memo() As String
        Get
            Return _Memo
        End Get
        Set(ByVal value As String)
            _Memo = value
        End Set
    End Property


    Sub AddFee()
        Dim SQLString As String
        SQLString = "SELECT * FROM tbFee WHERE HouseNo='" & HouseNo & "' AND FYear='" & FYear & "'AND FMonth='" & Fmonth & "'AND FeeType='" & FeeType & "'"
        Dim MSG As String
        Dim UserTable As DataTable = DBOperation.DBOperate(SQLString, MSG)
        If UserTable.Rows.Count >= 1 Then    '判断用户是否存在
            MsgBox("该项费用记录已经存在,请重试", MsgBoxStyle.Exclamation, "信息框")
        Else
            SQLString = "INSERT INTO tbFee VALUES('" & FeeType & "','"
            SQLString += FYear & "','" & Fmonth & "','"
            SQLString += Amount & "','" & Charge & "','"
            SQLString += HouseNo & "','" & Memo & "','"
            SQLString += Now.Date & "')"
            DBOperate(SQLString, MSG)
            'MsgBox(MSG, MsgBoxStyle.Exclamation, "信息框")
        End If
    End Sub

    Sub DelFee()
        Dim SQLString As String
        Dim MSG As String
        SQLString = "DELETE FROM tbHouse WHERE HouseNo='" & HouseNo & "' AND FYear='" & FYear & "'AND FMonth='" & Fmonth & "'AND FeeType='" & FeeType & "'"
        DBOperate(SQLString, MSG)
    End Sub

    Function LoadFee(ByVal FindType As Integer) As DataTable
        Dim SQLString As String
        Dim MSG As String
        Dim Column As String = ""
        Column += "FeeType AS 收费类型, FYear AS 年份,"
        Column += "FMonth AS 月份, Amount AS 用量,"
        Column += "Charge AS 费用, HouseNo AS 房屋编号,"
        Column += "Memo AS 备注,RecordDate AS 修改日期"
        SQLString = "SELECT " & Column & " FROM tbFee WHERE "
        If FindType = 1 Then
            SQLString = "SELECT " & Column & " FROM tbFee WHERE FeeType= '" & FeeType & "'"
        ElseIf FindType = 2 Then
            SQLString = "SELECT " & Column & " FROM tbFee WHERE HouseNo= '" & HouseNo & "'"
        End If
        SQLString += " AND FYear='" & FYear & "'AND FMonth='" & Fmonth & "'"
        Return DBOperate(SQLString, MSG)
    End Function
End Class

⌨️ 快捷键说明

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