예제 #1
0
    private void GetRecipes()
    {
        string submitted_by    = SubmittedBy.SelectedValue;
        string category        = Category.SelectedValue;
        string name_ingredient = Ingredient.SelectedValue;

        RecipeGridView.DataSource = GetRecipesSubmittedBy_Category_Ingredient(submitted_by, category, name_ingredient);
        RecipeGridView.DataBind();
    }
예제 #2
0
 protected void ButtonClear_Click(object sender, EventArgs e)
 {
     ClearAllGridviews();
     SetAllCheckBoxes();
     using (Models.PlanMyDinnerDbContext database = new Models.PlanMyDinnerDbContext())
     {
         //Using TemplateFields in the GridView Control
         // https://msdn.microsoft.com/en-us/library/bb288032.aspx
         RecipeGridView.DataSource = database.Recipes.ToList();
         RecipeGridView.DataBind();
     }
     ltRecipe.Text = "Showing all available recipes";
 }
예제 #3
0
 /*************************************************************************
 *
 *                          GUI update methods
 *
 * ***********************************************************************/
 protected void ClearAllGridviews()
 {
     RecipeGridView.DataSource = null;
     RecipeGridView.DataBind();
     IngredientGridView.DataSource = null;
     IngredientGridView.DataBind();
     CategoryGridView.DataSource = null;
     CategoryGridView.DataBind();
     ContextGridView.DataSource = null;
     ContextGridView.DataBind();
     ltInstructions.Text = "Please select recipe to view recipe details.";
     Gv_imgs.DataSource  = null;
     Gv_imgs.DataBind();
 }
예제 #4
0
 protected void UpdateRecipeGrid(IQueryable <Models.Recipe> recipes)
 {
     RecipeGridView.DataSource = recipes.ToList();
     RecipeGridView.DataBind();
 }