Пример #1
0
    def unlock(type, uow):
        if(type == "DESKTOP"):
            result = DesktopTDG.unlock(uow)

        elif(type == "LAPTOP"):
            result = LaptopTDG.unlock(uow)

        elif(type == "MONITOR"):
            result = MonitorDisplayTDG.unlock(uow)

        elif(type == "TABLET"):
            result = TabletTDG.unlock(uow)

        return result
Пример #2
0
    def delete(itemspec):
        if(type(itemspec) is Desktop):
            result = DesktopTDG.delete(itemspec)

        elif(type(itemspec) is Laptop):
            result = LaptopTDG.delete(itemspec)

        elif(type(itemspec) is MonitorDisplay):
            result = MonitorDisplayTDG.delete(itemspec)

        elif(type(itemspec) is Tablet):
            result = TabletTDG.delete(itemspec)

        return result
Пример #3
0
    def findAll(type):

        if (type == "DESKTOP"):
            result = DesktopTDG.findAll()

        elif(type == "LAPTOP"):
            result = LaptopTDG.findAll()

        elif(type == "TABLET"):
            result = TabletTDG.findAll()

        elif(type == "MONITOR"):
            result = MonitorDisplayTDG.findAll()

        itemSpecList = ItemSpecMapper.resultSetToItemSpec(result, type)
        return itemSpecList
Пример #4
0
    def find(modelNumber, specType):
        result = []

        if(specType == "DESKTOP"):
            result = DesktopTDG.find(modelNumber)

        elif(specType == "LAPTOP"):
            result = LaptopTDG.find(modelNumber)

        elif(specType == "MONITOR"):
            result = MonitorDisplayTDG.find(modelNumber)

        elif(specType == "TABLET"):
            result = TabletTDG.find(modelNumber)

        spec = ItemSpecMapper.resultSetToItemSpec([result], specType)
        if len(spec) == 0:
            return None
        else:
            return spec[0]