public string DeleteTumblrAccount(string UserId, string ProfileId, string GroupId)
 {
     try
     {
         objTumblrAccountRepository.deleteTumblrUser(ProfileId,Guid.Parse(UserId));
         objTumblrFeedRepository.DeleteTumblrDataByUserid(Guid.Parse(UserId), ProfileId);
         Domain.Myfashion.Domain.Team objTeam = objTeamRepository.GetTeamByGroupId(Guid.Parse(GroupId));
         GroupProfileRepository objGroupProfileRepository = new GroupProfileRepository();
         objGroupProfileRepository.DeleteGroupProfile(Guid.Parse(UserId), ProfileId, Guid.Parse(GroupId));
         objTeamMemberProfileRepository.DeleteTeamMemberProfileByTeamIdProfileId(ProfileId, objTeam.Id);
         objSocialProfilesRepository.deleteProfile(Guid.Parse(UserId), ProfileId);
         return new JavaScriptSerializer().Serialize("Success");
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return "Something Went Wrong";
     }
 }
        public string GetTicketsofGroup(string GroupId, string UserId)
        {
            string AssignedUser = string.Empty;
            try
            {
                GroupProfileRepository objGroupProfileRepository = new GroupProfileRepository();
                FacebookFeedRepository objFacebookFeedRepository = new FacebookFeedRepository();
                TwitterFeedRepository objTwitterFeedRepository = new TwitterFeedRepository();
                List<Domain.Myfashion.Domain.FeedSentimentalAnalysis> lstNegativeFeedsOfUser = new List<Domain.Myfashion.Domain.FeedSentimentalAnalysis>();
                List<Domain.Myfashion.Domain.GroupProfile> objGroupProfile = new List<Domain.Myfashion.Domain.GroupProfile>();
                List<FBTwitterFeeds> objListFBTwitterFeeds = new List<FBTwitterFeeds>();

                objGroupProfile = objGroupProfileRepository.getAllGroupProfiles(Guid.Parse(UserId), Guid.Parse(GroupId));

                if (objGroupProfile.Count > 0)
                {
                    lstNegativeFeedsOfUser = _FeedSentimentalAnalysisRepository.getAllNegativeFeedsOfUser(Guid.Parse(UserId));
                }
                else
                {
                    lstNegativeFeedsOfUser = _FeedSentimentalAnalysisRepository.getNegativeFeedsOfUser(Guid.Parse(UserId));
                }
                if (lstNegativeFeedsOfUser != null)
                {
                    foreach (var item in lstNegativeFeedsOfUser)
                    {
                        FBTwitterFeeds objFBTwitterFeeds = new FBTwitterFeeds();
                        UserRepository objUserRepository = new UserRepository();
                        Domain.Myfashion.Domain.User user = objUserRepository.getUsersById(item.AssigneUserId);
                        if (objGroupProfileRepository.checkProfileExistsingroup(Guid.Parse(GroupId), item.ProfileId))
                        {
                            string Network = item.Network;
                            if (Network == "facebook")
                            {
                                Domain.Myfashion.Domain.FacebookFeed facebookfeed = objFacebookFeedRepository.getFacebookFeedByProfileId(item.ProfileId, item.FeedId);
                                if (facebookfeed != null)
                                {
                                    objFBTwitterFeeds.FacebookFeed = facebookfeed;
                                }
                            }
                            if (Network == "twitter")
                            {
                                Domain.Myfashion.Domain.TwitterFeed twtfeed = objTwitterFeedRepository.getTwitterFeedByProfileId(item.ProfileId, item.FeedId);
                                if (twtfeed != null)
                                {
                                    objFBTwitterFeeds.TwitterFeed = twtfeed;
                                }
                            }
                            if (objFBTwitterFeeds.TwitterFeed != null)
                            {
                                try
                                {
                                    objFBTwitterFeeds.TicketNo = item.TicketNo;
                                    if (user != null)
                                    {
                                        objFBTwitterFeeds.AssignedUser = user.UserName;
                                    }
                                    else
                                    {
                                        objFBTwitterFeeds.AssignedUser = "";
                                    }
                                    objListFBTwitterFeeds.Add(objFBTwitterFeeds);
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.StackTrace);
                                }
                            }
                            if (objFBTwitterFeeds.FacebookFeed != null)
                            {
                                try
                                {
                                    objFBTwitterFeeds.TicketNo = item.TicketNo;
                                    if (user != null)
                                    {
                                        objFBTwitterFeeds.AssignedUser = user.UserName;
                                    }
                                    else
                                    {
                                        objFBTwitterFeeds.AssignedUser = "";
                                    }
                                    objListFBTwitterFeeds.Add(objFBTwitterFeeds);
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.StackTrace);
                                }
                            }
                        }
                    } 
                }
               
                return new JavaScriptSerializer().Serialize(objListFBTwitterFeeds);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "SomethingWentWrong";
            }

        }