Public Class CBackupManage
    Public Const cst_TABLE_NAME As String = "备份记录表"
    Public Shared m_COLS_NAME() As String = {
        "序号",
        "备份时间"
    }

    Public Enum COLS
        序号
        备份时间
    End Enum

    '权限
    Public Shared AccessRight As Integer = RIGHTS.NONE

    Public Sub New()
    End Sub

    Public Function SetBackupTime(ByVal timeString As String) As Boolean
        Dim strSql As String = "UPDATE " & cst_TABLE_NAME & " SET " & m_COLS_NAME(COLS.备份时间) & "=" & timeString & " WHERE " & m_COLS_NAME(COLS.序号) & "=" & "1"

        return SQL_ExeCommand(COL_RIGHTS.BOM管理, strSql) 
    End Function

    Public Function GetBackupTime(ByRef timeString As String) As Boolean
        Dim strSql As String = "SELECT " & m_COLS_NAME(COLS.备份时间) & " FROM " & cst_TABLE_NAME & " WHERE " & m_COLS_NAME(COLS.序号) & "=" & "1"

        Dim r_Table As New DataTable
        If SQL_Query(COL_RIGHTS.BOM管理, strSql, r_Table) = True Then
            timeString = r_Table.Rows(0).Item(0)
            Return True
        End If
        Return False
    End Function

End Class
