Esempio n. 1
0
        protected void AddFavorite(object sender, EventArgs e)
        {
            Favorite favorite = new Favorite
            {
                DateAdded = DateTime.Now,
                RecipeRef = Request.QueryString["RecipeID"],
                UserRef   = Context.User.Identity.GetUserName()
            };

            favorite.AddFavoriteToDatabase();

            btnFavorite.Visible = false;
            int count = Convert.ToInt32(lblFavoriteCount.Text);

            count++;
            lblFavoriteCount.Text = count.ToString();
            heart.Visible         = true;
        }