public void UpdateStock(StockDTO stockdto) { //string query = "SELECT * FROM stock WHERE item_id='" + stockdto.ITEM_ID + "'"; string query = "UPDATE stock SET rest_item='" + stockdto.QUANTITY + "' WHERE barcode = " + stockdto.BARCODE + ""; if (dbconnect.OpenConnection() == true) { MySqlCommand cmd = new MySqlCommand(query, dbconnect.connection); cmd.ExecuteNonQuery(); dbconnect.CloseConnection(); } }
public DataSet getSingleItem(StockDTO stockdto) { string query = "SELECT * FROM stock WHERE barcode='" + stockdto.BARCODE + "'"; if (dbconnect.OpenConnection() == true) { MySqlCommand cmd = new MySqlCommand(query, dbconnect.connection); mysqlAdapter = new MySqlDataAdapter(cmd); dataSet = new DataSet(); mysqlAdapter.Fill(dataSet); dbconnect.CloseConnection(); return(dataSet); } else { return(dataSet); } }