public IHttpActionResult GetGooglePlusAccountDetailsById(string ProfileId, string UserId)
 {
     Domain.Socioboard.Domain.GoogleAnalyticsAccount _GoogleAnalyticsAccount = new Domain.Socioboard.Domain.GoogleAnalyticsAccount();
     try
     {
         _GoogleAnalyticsAccount = objGoogleAnalyticsAccountRepository.getGoogleAnalyticsAccountDetailsById(ProfileId, Guid.Parse(UserId));
         return(Ok(_GoogleAnalyticsAccount));
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
         logger.Error(ex.StackTrace);
         return(BadRequest("Worng Input"));
     }
 }
Пример #2
0
        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));
        }