ActivEarth.Server.Service.Competition.ContestManager.RemoveGroup C# (CSharp) Method

RemoveGroup() public static method

Removes a group from a Contest.
public static RemoveGroup ( int contestId, Group group ) : bool
contestId int ID for the contest the group should be removed from.
group ActivEarth.Objects.Groups.Group Group to be removed.
return bool
        public static bool RemoveGroup(int contestId, Group group)
        {
            try
            {
                ContestTeam team = TeamDAO.GetTeamsFromContestId(contestId, false).Where(t => t.GroupId == group.ID).FirstOrDefault();

                if (team != null && TeamDAO.RemoveTeam(team.ID))
                {
                    Contest contest = ContestDAO.GetContestFromContestId(contestId, false, false);
                    contest.Reward = ContestManager.CalculateContestReward(
                        ContestManager.CalculateEstimatedLengthInDays(contest),
                    TeamDAO.GetTeamsFromContestId(contestId, false).Count);
                    ContestDAO.UpdateContest(contest);

                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception)
            {
                return false;
            }
        }