public string GetSociaoQueueMessageByUserIdAndGroupIdBetweenDates(string UserId, string GroupId, string StartDate, string EndDate)
        {
            string   profileid = string.Empty;
            DateTime stDate    = DateTime.Parse(StartDate);
            DateTime endDate   = DateTime.Parse(EndDate);

            // 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 = new 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.getAllMessagesDetailsByDate(item.ProfileId, userid, stDate, endDate);
                    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"));
            }
        }
예제 #2
0
        public void AddTeamMembers(string groupid, string teamid)
        {
            List <Domain.Socioboard.Domain.GroupProfile> lstGroupProfile = objGroupProfileRepository.GetAllGroupProfiles(Guid.Parse(groupid));

            foreach (var GroupProfile in lstGroupProfile)
            {
                objTeamMemberProfile                  = new Domain.Socioboard.Domain.TeamMemberProfile();
                objTeamMemberProfile.Id               = Guid.NewGuid();
                objTeamMemberProfile.TeamId           = Guid.Parse(teamid);
                objTeamMemberProfile.ProfileId        = GroupProfile.ProfileId;
                objTeamMemberProfile.ProfileType      = GroupProfile.ProfileType;
                objTeamMemberProfile.Status           = 1;
                objTeamMemberProfile.StatusUpdateDate = DateTime.Now;
                objTeamMemberProfileRepository.addNewTeamMember(objTeamMemberProfile);
            }
        }
예제 #3
0
 public string UpdateTeam(string userid, string teamid, string UserName)
 {
     try
     {
         string[] fnamelname = UserName.Split(' ');
         string   fname      = fnamelname[0];
         string   lname      = string.Empty;
         for (int i = 1; i < fnamelname.Length; i++)
         {
             lname += fnamelname[i];
         }
         team                  = new Domain.Socioboard.Domain.Team();
         team.Id               = Guid.Parse(teamid);
         team.UserId           = Guid.Parse(userid);
         team.FirstName        = fname;
         team.LastName         = lname;
         team.StatusUpdateDate = DateTime.Now;
         team.InviteStatus     = 1;
         teamrepo.updateTeam(team);
         Domain.Socioboard.Domain.Team objTeam = teamrepo.getTeamById(Guid.Parse(teamid));
         List <Domain.Socioboard.Domain.GroupProfile> lstGroupProfile = objGroupProfileRepository.GetAllGroupProfiles(objTeam.GroupId);
         foreach (var item in lstGroupProfile)
         {
             objTeamMemberProfile                  = new Domain.Socioboard.Domain.TeamMemberProfile();
             objTeamMemberProfile.Id               = Guid.NewGuid();
             objTeamMemberProfile.TeamId           = Guid.Parse(teamid);
             objTeamMemberProfile.ProfileId        = item.ProfileId;
             objTeamMemberProfile.ProfileType      = item.ProfileType;
             objTeamMemberProfile.Status           = 1;
             objTeamMemberProfile.StatusUpdateDate = DateTime.Now;
             objTeamMemberProfileRepository.addNewTeamMember(objTeamMemberProfile);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return("Something Went Wrong");
     }
     return(new JavaScriptSerializer().Serialize(team));
 }