public string GetAllUnSentMessagesAccordingToGroup(string UserId, string profileid, string network) { try { Guid userid = Guid.Parse(UserId); ScheduledMessageRepository objScheduledMessageRepository = new ScheduledMessageRepository(); List <Domain.Socioboard.Domain.ScheduledMessage> lstScheduledMessages = new List <Domain.Socioboard.Domain.ScheduledMessage>(); lstScheduledMessages = objScheduledMessageRepository.GetAllUnSentMessagesAccordingToGroup(userid, profileid, network); //FacebookAccountRepository facebookAccountRepo = new FacebookAccountRepository(); // FacebookAccount facebook = facebookAccountRepo.getFacebookAccountDetailsById(FacebookId, userid); return(new JavaScriptSerializer().Serialize(lstScheduledMessages)); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return(new JavaScriptSerializer().Serialize("Please try Again")); } }