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"));
            }
        }
Example #2
0
 public string getAllSentMessageDetails(string profileid, string userid)
 {
     try
     {
         ScheduledMessageRepository objScheduledMessageRepository = new ScheduledMessageRepository();
         List <Domain.Socioboard.Domain.ScheduledMessage> lstallScheduledMessage = objScheduledMessageRepository.getAllMessagesDetail(profileid, Guid.Parse(userid));
         return(new JavaScriptSerializer().Serialize(lstallScheduledMessage));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(new JavaScriptSerializer().Serialize("plese try again"));
     }
 }