public RecipeStatistics makeEmptyRecipeStats() { RecipeStatistics recipeStats = new RecipeStatistics(); recipeStats.abv = 0; recipeStats.fg = 0; recipeStats.ibu = 0; recipeStats.og = 0; recipeStats.srm = 0; return(recipeStats); }
/* * Saves the information entered in the grids * */ private void SaveButton_Click(object sender, EventArgs e) { // bool reload = false; APIHandler handler = new APIHandler(); currentRecipe.name = BeerNameBox.Text; currentRecipe.description = descriptionBox.Text; recipeResponse resp = handler.postRecipe(currentRecipe); RecipeStatistics stats = resp.recipeStats; currentRecipe.recipeStats = stats; currentRecipe.idString = resp.idString; RefreshStatistics(); updateStyleSliders(); // foreach (hoplist h in currentRecipe.hops) // { // // handler.postHopAddition(h); // } // foreach(fermentablelist f in currentRecipe.fermentables) // { // // string response = handler.postFermentableAddition(f); // // if(response == "false") // // { // // reload = true; // // } // } // foreach (yeast2 y in currentRecipe.yeasts) // { // // handler.postYeastAddition(y); // } // foreach (adjunctList a in currentRecipe.adjuncts) // { // // handler.postAdjunctAddition(a); // } // handler.postRecipe(currentRecipe); // if(reload) // { // // currentRecipe = handler.loadRecipe(currentRecipe.id); // populateGrids(); // // RefreshStatistics(); // } }
public void RecipeNullFailure() { Success = false; Message = "Recipe was not found"; recipeStats = null; }