public void LoadDrinkDetails(int id) { drink = new NewDrink(); string output = string.Empty; try { OdbcCommand myQuery = dbController.ODBCCommand; myQuery.CommandText = "SELECT * FROM drinks where id = " + id; OdbcDataReader myDataReader = myQuery.ExecuteReader(); while (myDataReader.Read()) { string name = myDataReader.GetString(1); string description = myDataReader.GetString(2); string ingredients = myDataReader.GetString(3); string imagesrc = myDataReader.GetString(4); bool alcoholic = myDataReader.GetBoolean(5); string type = myDataReader.GetString(6); drink = new NewDrink(id, name, description, ingredients, imagesrc, alcoholic, type); } myDataReader.Close(); } catch (OdbcException MyOdbcException) //Catch any ODBC exception .. { Console.WriteLine(MyOdbcException.Errors[0].Message); } this.DrinkName.Text = drink.Name; this.DrinkDescription.Text = drink.Description; this.DrinkImage.ImageUrl = drink.Image; }
public virtual void NewDrinkUploaded(NotificationEventArgs noti) { NewDrink?.Invoke(this, noti); }