public static void AddTeamByGroupIdUserId(Guid userId, string userEmailId, Guid groupId) { Domain.Socioboard.Domain.Team teams = new Domain.Socioboard.Domain.Team(); TeamRepository objTeamRepository = new TeamRepository(); teams.Id = Guid.NewGuid(); teams.GroupId = groupId; teams.UserId = userId; teams.EmailId = userEmailId; objTeamRepository.addNewTeam(teams); }
public string GetSociaoQueueMessageByUserIdAndGroupId(string UserId, string GroupId) { string profileid = string.Empty; TeamRepository objTeamRepository = new TeamRepository(); try { Guid userid = Guid.Parse(UserId); Guid groupid = Guid.Parse(GroupId); List <Domain.Socioboard.Domain.ScheduledMessage> lstfianlscoailqueue = new List <Domain.Socioboard.Domain.ScheduledMessage>(); //Domain.Socioboard.Domain.Team objTeam = objTeamRepository.GetTeamByGroupId(groupid); //List<Domain.Socioboard.Domain.TeamMemberProfile> allprofiles = objTeamMemberProfileRepository.getAllTeamMemberProfilesOfTeam(objTeam.Id); GroupProfileRepository grpProfileRepo = new GroupProfileRepository(); List <Domain.Socioboard.Domain.GroupProfile> allprofiles = grpProfileRepo.GetAllGroupProfiles(groupid); ScheduledMessageRepository objScheduledMessageRepository = new ScheduledMessageRepository(); List <Domain.Socioboard.Domain.ScheduledMessage> lstScheduledMessages = new List <Domain.Socioboard.Domain.ScheduledMessage>(); Dictionary <string, List <Domain.Socioboard.Domain.ScheduledMessage> > objdic = new Dictionary <string, List <Domain.Socioboard.Domain.ScheduledMessage> >(); foreach (var item in allprofiles) { lstScheduledMessages = objScheduledMessageRepository.getAllMessagesDetail(item.ProfileId, userid); if (lstScheduledMessages.Count > 0) { objdic.Add(item.ProfileId, lstScheduledMessages); } } foreach (var item in objdic) { foreach (var ScheduledMessage in item.Value) { lstfianlscoailqueue.Add(ScheduledMessage); } } //FacebookAccountRepository facebookAccountRepo = new FacebookAccountRepository(); // FacebookAccount facebook = facebookAccountRepo.getFacebookAccountDetailsById(FacebookId, userid); return(new JavaScriptSerializer().Serialize(lstfianlscoailqueue)); } catch (Exception ex) { logger.Error(ex.Message); Console.WriteLine(ex.StackTrace); return(new JavaScriptSerializer().Serialize("Please try Again")); } }