示例#1
0
    def update(self,supplierOrderItems=[]):
        dao = SupplierOrderDao()

        values = [(so.id,so.supplier_id,so.supplier_contact_id,so.owner_id,so.owner_contact_id,so.owner_po_number,so.owner_po_date) for so in supplierOrderItems]

        dao.update(values)

        ids = [(so.id) for so in supplierOrderItems]
        updatedSupplierOrders = self.get(ids)
        return updatedSupplierOrders
示例#2
0
    def get(self,ids=[]):
        dao = SupplierOrderDao()
        rows = dao.get(ids)
        supplierOrders = []
        for row in rows:
            supplierOrders.append(SupplierOrder(row[0],row[1],row[2],row[3],row[4],row[5],row[6]))

        self.decorate(supplierOrders)

        return supplierOrders
示例#3
0
    def insert(self,supplierOrders=[]):
        dao = SupplierOrderDao()

        values = [(so.supplier_id,so.supplier_contact_id,so.owner_id,so.owner_contact_id,so.owner_po_number,so.owner_po_date) for so in supplierOrders]

        ids = dao.insert(values)

        newSupplierOrders = self.get(ids)

        #set the default phone and email types
        return newSupplierOrders
示例#4
0
 def addOrderItem(self,so,oi):
     dao = SupplierOrderDao()
     dao.joinOrderItem(so.id,oi.id)
     so.items.append(oi)
     return (self.get([so.id]))