public async void FavoriteUnChecked(int cardId)
        {
            if (Favorites.Any(f => f.Id == cardId))
            {
                Favorite Favorite = new Favorite();

                Favorite deletefavorite = await Favorite.DeleteFavoriteAsync(cardId);

                this.Favorites = await Favorite.GetFavoritesAsync();
            }
        }
        public async void MypageFavoriteUnChecked(int cardId)
        {
            if (Favorites.Any(f => f.CardId == cardId && f.EmployeeId == this.AuthorizedEmployee.Id))
            {
                this.Favorite  = new Favorite();
                this.Favorites = await Favorite.GetFavoritesAsync();

                this.DeleteFavorite      = new Favorite();
                this.Favorite.EmployeeId = AuthorizedEmployee.Id;
                this.Favorite.CardId     = cardId;

                this.DeleteFavorite = Favorites.Find(f => Favorite.EmployeeId == f.EmployeeId && Favorite.CardId == f.CardId);

                Favorite deletefavorite = await Favorite.DeleteFavoriteAsync(DeleteFavorite.Id);
            }
        }
Example #3
0
        public async void FavoriteUnChecked(int cardId)
        {
            this.UpdateCard = AllCards.Find(al => cardId == al.Id);
            //this.UpdateCard.Favorite = false;
            Card card = await UpdateCard.PutCardAsync(this.UpdateCard);


            Favorite favorite = new Favorite();

            this.Favorites = await favorite.GetFavoritesAsync();

            this.DeleteFavorite      = new Favorite();
            this.Favorite.EmployeeId = AuthorizedEmployee.Id;
            this.Favorite.CardId     = cardId;

            this.DeleteFavorite = Favorites.Find(f => Favorite.EmployeeId == f.EmployeeId && Favorite.CardId == f.CardId);

            Favorite deletefavorite = await Favorite.DeleteFavoriteAsync(DeleteFavorite.Id);
        }