Esempio n. 1
0
 def select_by_phone(self, key):
     connect = Connect()
     connect.sql_execute('select * from customer where phone = \'' + str(key) + '\'')
     row = connect.cur.fetchone()
     customer = Customer()
     customer.set_values_from_row(row)
     return customer
Esempio n. 2
0
 def select_by_ntd_num_and_hold_num(self, key, hold_num):
     connect = Connect()
     connect.sql_execute('select * from item where ntd# = ' + "'" + str(key) + "' and hold# = " + "'" + hold_num + "'")
     row = connect.cur.fetchone()
     item = Item()
     item.set_values_from_row(row)
     return item
Esempio n. 3
0
 def select_by_hold_number(self, key):
     connect = Connect()
     connect.sql_execute('select * from customer_order where hold# = ' +
                         "'" + str(key) + "'")
     row = connect.cur.fetchone()
     customer_order = CustomerOrder()
     customer_order.set_values_from_row(row)
     return customer_order
Esempio n. 4
0
 def update(self, employee):
     connect = Connect()
     connect.sql_execute("update employee set " + "fname = '" +
                         employee.get_fname() + "'," + "lname = '" +
                         employee.get_lname() + "'," + "salesperson# = '" +
                         employee.get_salesperson_num() + "' " +
                         "where salesperson# = '" +
                         employee.get_salesperson_num() + "'")
     connect.commit()
Esempio n. 5
0
 def select_all(self):
     connect = Connect()
     connect.sql_execute('select * from item')
     item_list = []
     for row in connect.cur:
         item = Item()
         item.set_values_from_row(row)
         item_list.append(item)
     return item_list
Esempio n. 6
0
    def select_by_ntd_num(self,key):
        connect = Connect()
        connect.sql_execute('select * from product where ntd# =  ' + "'" +str(key) + "'")
        row = connect.cur.fetchone()

        product = Product()
        product.set_values_from_row(row)

        return product
Esempio n. 7
0
 def update(self, itemObject):
     connect = Connect()
     connect.sql_execute("update item set " +
                         "ntd# = '" + itemObject.get_ntd_num() + "'," +
                         "quantity = " + str(itemObject.get_quantity()) + "," +
                         "total_cost = " + str(itemObject.get_total_cost()) + "," +
                         "hold# = '" + itemObject.get_hold_num() + "' " +
                         "where ntd# = '" + itemObject.get_ntd_num() + "' and hold# = '" + itemObject.get_hold_num() + "'")
     connect.commit()
Esempio n. 8
0
 def select_all(self):
     connect = Connect()
     connect.sql_execute('select * from customer_order')
     customer_order_list = []
     for row in connect.cur:
         customer_order = CustomerOrder()
         customer_order.set_values_from_row(row)
         customer_order_list.append(customer_order)
     return customer_order_list
Esempio n. 9
0
    def select_by_hold_num(self,key):
        connect = Connect()
        connect.sql_execute('select * from item where hold# = ' + "'" + str(key) + "'")
        item_list = []

        for row in connect.cur:
            item = Item()
            item.set_values_from_row(row)
            item_list.append(item)
        return item_list
Esempio n. 10
0
    def select_by_salesperson_num(self, key):
        connect = Connect()
        connect.sql_execute('select * from employee where salesperson# =  ' +
                            str(key) + '')
        row = connect.cur.fetchone()

        employee = Employee()
        employee.set_values_from_row(row)

        return employee
Esempio n. 11
0
 def select_by_customer_phone(self, key):
     connect = Connect()
     connect.sql_execute('select * from customer_order where phone# = ' +
                         "'" + str(key) + "'")
     customer_order_list = []
     for row in connect.cur:
         customer_order = CustomerOrder()
         customer_order.set_values_from_row(row)
         customer_order_list.append(customer_order)
     return customer_order_list
Esempio n. 12
0
    def select_all(self):
        connect = Connect()
        connect.sql_execute('select * from product')
        product_list = []

        for row in connect.cur:
            product = Product()
            product.set_values_from_row(row)
            product_list.append(product)

        return product_list
Esempio n. 13
0
    def select_all(self):
        connect = Connect()
        connect.sql_execute('select * from employee')
        employee_list = []

        for row in connect.cur:
            employee = Employee()
            employee.set_values_from_row(row)
            employee_list.append(employee)

        return employee_list
Esempio n. 14
0
 def update(self, customerObject):
     connect = Connect()
     connect.sql_execute("update customer set " +
                         "fname = '" + customerObject.get_fname() + "'," +
                         "lname = '" + customerObject.get_lname() + "'," +
                         "city = '" + customerObject.get_city() + "'," +
                         "zip = '" + customerObject.get_zip() + "'," +
                         "state = '" + customerObject.get_state() + "'," +
                         "email = '" + customerObject.get_email() + "'," +
                         "phone = '" + customerObject.get_phone() + "'," +
                         "street_address = '" + customerObject.get_saddress() + "' "+
                         "where phone = '" + customerObject.get_phone() + "'")
     connect.commit()
Esempio n. 15
0
 def update(self, customerOrderObject):
     connect = Connect()
     connect.sql_execute("update customer_order set " + "date_made = '" +
                         customerOrderObject.get_date_made() + "'," +
                         "total_cost = " +
                         str(customerOrderObject.get_total_cost()) + "," +
                         "hold# = '" + customerOrderObject.get_hold_num() +
                         "', " + "delivery_address = '" +
                         customerOrderObject.get_delivery_address() +
                         "', " + "phone# = '" +
                         customerOrderObject.get_phone_num() + "' " +
                         "where hold# = '" +
                         customerOrderObject.get_hold_num() + "'")
     connect.commit()
Esempio n. 16
0
 def update(self, product):
     connect = Connect()
     connect.sql_execute("update product set " +
                         "dye_lot = '" + product.get_dye_lot() + "'," +
                         "color = '" + product.get_color() + "'," +
                         "location = '" + product.get_location() + "'," +
                         "mfg# = '" + product.get_mfg_num() + "'," +
                         "buying_price = " + str(product.get_buying_price()) + "," +
                         "amt_in_stock = " + str(product.get_amt_in_stock()) + "," +
                         "ntd_description = '" + product.get_ntd_description() + "' ," +
                         "cost_per_sf = " + str(product.get_cost_per_sf()) + "," +
                         "sf_per_carton = " + str(product.get_sf_per_carton()) + "," +
                         "carton_count = " + str(product.get_carton_count()) + ", " +
                         "size_of_product = " + str(product.get_size_of_product()) + "," +
                         "piece_count = " + str(product.get_piece_count()) + " , " +
                         "ntd# = '" + product.get_ntd_num() + "' " +
                         "where ntd# = '" + product.get_ntd_num() + "'")
     connect.commit()
Esempio n. 17
0
 def delete_item_using_hold_num(self, key):
     connect = Connect()
     connect.sql_execute("delete from item where hold# = " + "'" + key + "'")
     connect.commit()
Esempio n. 18
0
 def delete_customer_order_by_hold_num(self, hold_num):
     connect = Connect()
     connect.sql_execute("delete from customer_order where hold# = " + "'" +
                         hold_num + "'")
     connect.commit()
Esempio n. 19
0
 def insert_customer_order(self, customerOrderObject):
     connect = Connect()
     connect.sql_execute('Insert into customer_order values ( ' +
                         customerOrderObject.get_value_string())
     connect.commit()
Esempio n. 20
0
 def delete_customer_by_phone_number(self, phone):
     connect = Connect()
     connect.sql_execute('delete from customer where phone = ' + "'" + str(phone) + "'")
     connect.commit()
Esempio n. 21
0
 def insert_item(self, itemObject):
     connect = Connect()
     connect.sql_execute('Insert into Item values ( ' + itemObject.get_value_string())
     connect.commit()
Esempio n. 22
0
 def delete_item(self, ntd_num, hold_num):
     connect = Connect()
     connect.sql_execute("delete from item where ntd# = " + "'" + ntd_num + "' and hold# = " + "'" + hold_num + "'")
     connect.commit()