Exemple #1
0
def GetAllBuyers():
    """获取所有的买家数据"""
    db_cur = db_conn.cursor()
    db_cur.execute(SQL_ALL_BUYERS)
    all_buyers = []
    for row in db_cur:
        rec = Buyer()
        rec.uid = str(row[0])
        rec.buyer_name = row[1]
        rec.phone1 = row[2]
        rec.phone2 = row[3]
        rec.phone3 = row[4]
        rec.email = row[5]

        all_buyers.append(rec)
    return all_buyers
Exemple #2
0
def GetAllBuyers():
    """获取所有的买家数据"""
    db_cur = db_conn.cursor()
    db_cur.execute(SQL_ALL_BUYERS)
    all_buyers = []
    for row in db_cur:
        rec = Buyer()
        rec.uid = str(row[0])
        rec.buyer_name = row[1]
        rec.phone1 = row[2]
        rec.phone2 = row[3]
        rec.phone3 = row[4]
        rec.email = row[5]

        all_buyers.append(rec)
    return all_buyers
	def SaveChanges(self):
		for row in self.change_rows.keys():
			row              = int(row)
			buyer            = Buyer()
			buyer.uid        = self.m_grid5.GetCellValue(row, 0)
			buyer.buyer_name = self.m_grid5.GetCellValue(row, 1)
			buyer.phone1     = self.m_grid5.GetCellValue(row, 2)
			buyer.phone2     = self.m_grid5.GetCellValue(row, 3)
			buyer.phone3     = self.m_grid5.GetCellValue(row, 4)
			buyer.email      = self.m_grid5.GetCellValue(row, 5)
			db.UpdateBuyer(buyer)
		for new_row in self.new_buyers.keys():
			buyer            = Buyer()
			buyer.buyer_name = self.m_grid5.GetCellValue(new_row, 1)
			buyer.phone1     = self.m_grid5.GetCellValue(new_row, 2)
			buyer.phone2     = self.m_grid5.GetCellValue(new_row, 3)
			buyer.phone3     = self.m_grid5.GetCellValue(new_row, 4)
			buyer.email      = self.m_grid5.GetCellValue(new_row, 5)
			db.InsertBuyer(buyer)