Esempio n. 1
0
        public bool DeleteProject(int?id)
        {
            if (id == null)
            {
                return(false);
            }

            var project = GetProjectById(id);

            if (project == null)
            {
                return(false);
            }

            foreach (var rewardPackage in project.RewardPackages.ToList())
            {
                if (!rewardPackageService_.RemoveRewardPackage(rewardPackage.RewardPackageId))
                {
                    return(false);
                }
            }

            context_.Remove(project);

            if (context_.SaveChanges() > 0)
            {
                return(true);
            }

            return(false);
        }
        public bool DeleteVideo(int?videoId)
        {
            if (videoId == null)
            {
                return(false);
            }

            var video = SearchVideo(new SearchVideoOptions()
            {
                VideoId = videoId
            }).SingleOrDefault();

            if (video == null)
            {
                return(false);
            }

            context_.Remove(video);

            if (context_.SaveChanges() > 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 3
0
        public bool RemoveRewardPackage(int?rewardPackageId)
        {
            if (rewardPackageId == null)
            {
                return(false);
            }

            var rewardPackage = GetRewardPackageById(rewardPackageId);

            if (rewardPackage == null)
            {
                return(false);
            }

            foreach (var reward in rewardPackage.Rewards.ToList())
            {
                if (!rewardService_.RemoveReward(reward.RewardId))
                {
                    return(false);
                }
            }

            context_.Remove(rewardPackage);

            if (context_.SaveChanges() > 0)
            {
                return(true);
            }

            return(false);
        }
        public bool DeletePost(int?postId)
        {
            if (postId == null)
            {
                return(false);
            }

            var post = SearchPost(new SearchPostOptions()
            {
                PostId = postId
            }).SingleOrDefault();

            if (post == null)
            {
                return(false);
            }

            context_.Remove(post);

            if (context_.SaveChanges() > 0)
            {
                return(true);
            }

            return(false);
        }
        public bool DeletePhoto(int?photoId)
        {
            if (photoId == null)
            {
                return(false);
            }

            var photo = SearchPhoto(new SearchPhotoOptions()
            {
                PhotoId = photoId
            }).SingleOrDefault();

            if (photo == null)
            {
                return(false);
            }

            context_.Remove(photo);

            if (context_.SaveChanges() > 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 6
0
        public bool RemoveReward(int?rewardId)
        {
            if (rewardId == null)
            {
                return(false);
            }

            var reward = GetRewardById(rewardId);

            if (reward == null)
            {
                return(false);
            }

            context_.Remove(reward);

            if (context_.SaveChanges() > 0)
            {
                return(true);
            }

            return(false);
        }