public void Create(Team item)
        {
            var organisation = _container.Organisations.Where(i => i.Name == "Standard Bank").FirstOrDefault();
            if(organisation == null)
            {
                organisation = new Organisation() { Name = "Standard Bank" };
                _container.Organisations.Add(organisation);
            }

            item.Organisation = organisation;
            item.AvatarTypeId = 1; //Barbarian

            _container.Teams.Add(item);
        }
        public void CreateAssessmentForTeam(Team team)
        {
            var assessment = this.GetCurrentAssessmentForTeam(team.Id);

            if (assessment != null && (assessment.Status.Value == "Open" || assessment.Status.Value == "Moderating"))
            {
                throw new ApplicationException("You cannot a new assessment until you complete the previous one.");
            }

            assessment = new Data.Assessment();
            assessment.TeamId = team.Id;
            assessment.DateCreated = DateTime.Now;

            this.Create(assessment);
        }
 public IEnumerable<Data.Goal> GetGoalsForTeam(Team team)
 {
     return GetGoalsForTeam(team.Id);
 }
        private void RemoveTeamMembers(Team team)
        {
            var teamMembers = team.TeamMembers.ToArray();

            foreach (var teamMember in teamMembers)
            {
                _container.TeamMembers.Remove(teamMember);
            }
        }
 public bool IsUserTeamAdmin(Team team, string userId)
 {
     return _container.TeamMembers.Any(i => i.TeamId == team.Id && i.IsAdmin);
 }