public IHttpActionResult GetGroupGoogleAnalytics(string GroupId, string UserId)
 {
     Guid grpId = Guid.Empty;
     try
     {
         grpId = Guid.Parse(GroupId);
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
         logger.Error(ex.StackTrace);
         return BadRequest("Invalid GroupId");
     }
     List<Domain.Socioboard.Domain.GroupProfile> lstGroupProfiles = grpProfilesRepo.GetAllGroupProfilesByProfileType(grpId, "googleanalytics");
     List<Domain.Socioboard.Domain.GoogleAnalyticsAccount> lstGoogleAnalyticsAccount = new List<Domain.Socioboard.Domain.GoogleAnalyticsAccount>();
     GoogleAnalyticsAccountRepository _GoogleAnalyticsAccountRepository = new GoogleAnalyticsAccountRepository();
     foreach (var profile in lstGroupProfiles)
     {
         try
         {
             Domain.Socioboard.Domain.GoogleAnalyticsAccount _GoogleAnalyticsAccount = _GoogleAnalyticsAccountRepository.getGoogleAnalyticsAccountDetailsById(profile.ProfileId, Guid.Parse(UserId));
             lstGoogleAnalyticsAccount.Add(_GoogleAnalyticsAccount);
         }
         catch (Exception ex)
         {
             logger.Error(ex.Message);
             logger.Error(ex.StackTrace);
         }
     }
     return Ok(lstGoogleAnalyticsAccount);
 }
 public IHttpActionResult DeleteUserDetails(string user)
 {
     GroupsRepository _GroupsRepository=new GroupsRepository();
     GroupMembersRepository _GroupMembersRepository = new GroupMembersRepository();
     GroupProfileRepository _GroupProfileRepository = new GroupProfileRepository();
     TaskRepository _TaskRepository = new TaskRepository();
     TaskCommentRepository _TaskCommentRepository = new TaskCommentRepository();
     InboxMessagesRepository _InboxMessagesRepository=new InboxMessagesRepository();
     FacebookAccountRepository _FacebookAccountRepository=new FacebookAccountRepository();
     GoogleAnalyticsAccountRepository _GoogleAnalyticsAccountRepository=new GoogleAnalyticsAccountRepository();
     GooglePlusAccountRepository _GooglePlusAccountRepository=new GooglePlusAccountRepository();
     InstagramAccountRepository _InstagramAccountRepository=new InstagramAccountRepository();
     LinkedInAccountRepository _LinkedInAccountRepository=new LinkedInAccountRepository();
     LinkedinCompanyPageRepository _LinkedinCompanyPageRepository=new LinkedinCompanyPageRepository();
     ScheduledMessageRepository _ScheduledMessageRepository=new ScheduledMessageRepository();
     SocialProfilesRepository _SocialProfilesRepository = new SocialProfilesRepository();
     TwitterAccountRepository _TwitterAccountRepository=new TwitterAccountRepository();
     TumblrAccountRepository _TumblrAccountRepository = new TumblrAccountRepository();
     YoutubeAccountRepository _YoutubeAccountRepository = new YoutubeAccountRepository();
     YoutubeChannelRepository _YoutubeChannelRepository = new YoutubeChannelRepository();
     try
     {
         Domain.Socioboard.Domain.User _User = userrepo.getUserInfoByEmail(user);
         if (_User != null)
         {
             List<Domain.Socioboard.Domain.Groups> lstGroups = _GroupsRepository.getAllGroups(_User.Id);
             foreach (Domain.Socioboard.Domain.Groups item_group in lstGroups)
             {
                 int i = _GroupMembersRepository.DeleteGroupMember(item_group.Id.ToString());
                 int j = _GroupProfileRepository.DeleteAllGroupProfile(item_group.Id);
                 bool rt = _GroupProfileRepository.DeleteGroupReport(item_group.Id);
                 int k = _TaskRepository.DeleteTaskOfGroup(item_group.Id);
             }
             int g = _GroupMembersRepository.DeleteGroupMemberByUserId(user);
             int h = _GroupsRepository.DeleteGroupsByUserid(_User.Id);
             int l = _TaskCommentRepository.DeleteTaskCommentByUserid(_User.Id);
             int m = _InboxMessagesRepository.DeleteInboxMessages(_User.Id);
             int n = _FacebookAccountRepository.DeleteAllFacebookAccount(_User.Id);
             int o = _GoogleAnalyticsAccountRepository.DeleteGoogleAnalyticsAccountByUserid(_User.Id);
             int p = _GooglePlusAccountRepository.DeleteGooglePlusAccountByUserid(_User.Id);
             int q = _InstagramAccountRepository.DeleteInstagramAccountByUserid(_User.Id);
             int r = _LinkedInAccountRepository.DeleteLinkedInAccountByUserid(_User.Id);
             int s = _LinkedinCompanyPageRepository.DeleteLinkedinCompanyPage(_User.Id);
             int t = _ScheduledMessageRepository.DeleteScheduledMessageByUserid(_User.Id);
             int u = _SocialProfilesRepository.DeleteSocialProfileByUserid(_User.Id);
             int v = _TwitterAccountRepository.DeleteTwitterAccountByUserid(_User.Id);
             int w = _TumblrAccountRepository.DeletetumblraccountByUserid(_User.Id);
             int x = _YoutubeAccountRepository.DeleteYoutubeAccount(_User.Id);
             int y = _YoutubeChannelRepository.DeleteYoutubeChannelByUserid(_User.Id);
             int z = userrepo.DeleteUser(_User.Id);
         }
         else {
             return Ok(false);
         }
     }
     catch (Exception ex)
     {
         return BadRequest(ex.StackTrace);
     }
     return Ok(true);
 }