public void updateQuantityMinus(DevicesStore devicesStore) { connection.open(); command = new SqlCommand("update EquipsStore set quantity=quantity-'" + devicesStore.getQuantity() + "' where name='" + devicesStore.getName() + "'", connection.getConnection()); command.ExecuteNonQuery(); connection.close(); }
public double getQuantity(string itemName) { devicesStore = new DevicesStore(); devicesStoreDB = new DevicesStoreDB(); devicesStore.setName(itemName); devicesStoreDB.selectQuantity(devicesStore); return(devicesStore.getQuantity()); }
public bool checkItemQuantity(string itemName, double quantity) { devicesStore = new DevicesStore(); devicesStoreDB = new DevicesStoreDB(); devicesStore.setName(itemName); devicesStoreDB.selectQuantity(devicesStore); if (quantity > devicesStore.getQuantity()) { return(false); } else { return(true); } }
public void update(DevicesStore devicesStore) { connection.open(); command = new SqlCommand("update EquipsStore set name='" + devicesStore.getName() + "',price='" + devicesStore.getPrice() + "',quantity='" + devicesStore.getQuantity() + "' ,total='" + devicesStore.getTotal() + "' where ID='" + devicesStore.getID() + "'", connection.getConnection()); command.ExecuteNonQuery(); connection.close(); }
public void insert(DevicesStore devicesStore) { connection.open(); command = new SqlCommand("insert into EquipsStore values('" + devicesStore.getName() + "' , '" + devicesStore.getPrice() + "' , '" + devicesStore.getQuantity() + "','" + devicesStore.getTotal() + "')", connection.getConnection()); command.ExecuteNonQuery(); connection.close(); }