Example #1
0
    protected void deleteIngredientButtonClick(object sender, EventArgs e)
    {
        LinkButton deleteIngredientLinkButton = sender as LinkButton;
        int        indexIngredient            = Convert.ToInt32(deleteIngredientLinkButton.CommandArgument);

        ingredienteAdaugate_.RemoveAt(indexIngredient);

        IngredienteListView.DataBind();
        IngredienteUpdatePanel.Update();
    }
Example #2
0
    protected void adaugaIngredientButtonClick(object sender, EventArgs e)
    {
        int indexIngredient = IngredienteDropDownList.SelectedIndex;

        if (indexIngredient == 0)
        {
            Ingredient ingredient = new Ingredient();
            ingredient.Initialize(-100000, IngredientNouTextBox.Text);
            ingredienteAdaugate_.Add(ingredient);
            IngredientNouTextBox.Text = "";
        }
        else
        {
            indexIngredient -= 1; // balance +1 from "Ingrediente nou"
            ingredienteAdaugate_.Add(ingrediente_[indexIngredient]);
        }
        IngredienteListView.DataBind();
        IngredienteUpdatePanel.Update();
    }