public static MemberProfileModel Load(int memberID) { Data.DataClasses.Member m = Data.Entities.Members.GetMemberAt(memberID); MemberProfileModel model = new MemberProfileModel { Nickname = m.Nickname, Status = m.Status, Faculty = m.Faculty, DateOfBirth = m.DateOfBirth, Phone = m.Phone, Facebook = m.Facebook, LinkedIn = m.LinkedIn, Skype = m.Skype, Id = m.MemberId, Name = m.Name, Surname = m.Surname, Avatar = m.Avatar, JoinDate = m.JoinDate, Gmail = m.Gmail, FeePayedUntil = m.FeePayedUntil, Role = (Data.Enumerations.Role)m.Role.RoleId }; List <Project> projects = Data.Entities.Projects.GetTeamProjectsOfMember(memberID); List <Project> projectsPomagao = Data.Entities.Projects.GetProjectsOfMember(memberID); List <Badge> badges = Data.Entities.Badges.GetAllBadgesOfMember(memberID); model.MemberBadges = BadgeListModel.CreateBadgeDTOs(badges); model.MemberTeamProjects = ProjectModel.CreateMemberTeamProjectDTOList(m, projects) ?? new List <MemberProjectDTO>(); model.MemberHelpProjects = ProjectModel.CreateMemberHelpProjectDTOList(m, projectsPomagao) ?? new List <MemberProjectDTO>(); return(model); }
public static MemberDTO CreateMemberDTO(Data.DataClasses.Member m) { MemberDTO member = new MemberDTO() { Name = m.Name, Surname = m.Surname, MemberId = m.MemberId }; return(member); }
public static MemberIndexModel Load(int memberID, DateTime?date = null) { date = date ?? DateTime.Now; Data.DataClasses.Member m = Data.Entities.Members.GetMemberAt(memberID); MemberIndexModel model = new MemberIndexModel { Avatar = m.Avatar, CurrentProject = CreateProjectDTOListForDate(), CurrentPoll = CreatePollDTOListForDate(), Birthtdays = CreateMemberDTOListForDateBirth((DateTime)date), Anniversary = CreateMemberDTOListForDateAnniversary((DateTime)date) }; return(model); }
public static MemberEditProfileModel Load(int memberID) { Data.DataClasses.Member m = Data.Entities.Members.GetMemberAt(memberID); MemberEditProfileModel model = new MemberEditProfileModel { Nickname = m.Nickname, Status = m.Status, Faculty = m.Faculty, DateOfBirth = m.DateOfBirth, Phone = m.Phone, //Avatar = m.Avatar, Facebook = m.Facebook, LinkedIn = m.LinkedIn, Skype = m.Skype }; return(model); }