Exemplo n.º 1
0
    def GetProductInfo(self):
        SQL = r'select distinct class from dfr_productline'
        result = []
        if g_DB.Execute(SQL):
            res = g_DB.fetchAll()
            if res:
                for data in res:
                    for key in data:
                        result.append(data[key])
            g_Log.LogInfo('获取产品信息成功')
        else:
            g_Log.LogError('获取产品信息失败')
            g_Log.LogDebug('SQL语句:' + SQL)
            g_Log.LogDebug('失败原因:' + g_DB.error)

        return result
Exemplo n.º 2
0
    def GetProductFamilyInfo(self, ProductType):
        SQL = r'select productFamily from dfr_productline where Class="' + ProductType + '"'
        result = []
        if g_DB.Execute(SQL):
            res = g_DB.fetchAll()
            if res:
                for data in res:
                    for key in data:
                        result.append(data[key])

            g_Log.LogInfo('从数据库获取产品族信息成功')
        else:
            g_Log.LogError('从数据库获取产品族信息失败')
            g_Log.LogDebug('SQL语句:' + SQL)

        return result