public TeamCategoryServiceTesting() { Data.ScheduleContext context = new Data.ScheduleContext(); context.Migrate(); Service = new TeamCategoryService(); }
public TeamPage(Team t) { InitializeComponent(); BindingContext = t; PS = new PropertyService(); NS = new NotificationService(); TCS = new TeamCategoryService(); TMS = new TeamMemberService(); TS = new TeamService(); US = new UserService(); _userID = PS.GetUser().Id; if (IsAdmin(t.CreatorID)) { Edit_button.IsVisible = true; } else { if (NS.ExistsNotification(_userID, t.Id) || TMS.IsTeamMember(t.Id, _userID) || t.NumOfMembers == t.MaxMembers || TMS.GetRequests(t.Id, _userID) > 3) { SendRequest_button.IsVisible = false; } else { SendRequest_button.IsVisible = true; } if (TMS.IsTeamMember(t.Id, _userID)) { RemoveUser_button.IsVisible = true; } } //Ho assegnato il riferimento alle categorie del team team_categories = TCS.GetCategories(t.Id); CategoryLabel.Text = CategoryService.GetCategory(team_categories[0]) + " - " + DifficultyService.GetDifficulty(t.Difficulty); teamImage.Source = CategoryService.GetImage(team_categories[0]).Item1; foreach (TeamMemberButton b in CreateTMButtons(t)) { if (t.CreatorID == b._user.Id) { b.ChangeButtonColor(Color.FromHex("#A1A1A1"), Color.White); } teamMembersStack.Children.Add(b); } creationDateLabel.Text = "Created on " + t.CreationDate.Date.ToString("dd MMMM yyyy"); terminationDateLabel.Text = "Subscriptions end on " + t.TerminationDate.Date.ToString("dd MMMM yyyy"); }
public ProfileService(string userID) { UserID = userID; TMS = new TeamMemberService(); TCS = new TeamCategoryService(); }