Exemple #1
0
        public ActionResult SelectAccount()
        {
            var rr       = new ReportRequestor(CurrentItem.Token);
            var accounts = rr.GetAccounts();

            return(PartialView("SelectAccount", accounts));
        }
Exemple #2
0
        private IEnumerable <GenericEntry> GetStatisticsEntries(DateTime from, DateTime to)
        {
            var rr = new ReportRequestor(CurrentItem.Token);

            var entries = rr.RequestReport(
                new AnalyticsAccountInfo {
                AccountID = CurrentItem.AccountID, ProfileID = CurrentItem.ProfileID, Title = CurrentItem.Title, AccountName = CurrentItem.AccountName
            },
                CurrentItem.Dimensions,
                CurrentItem.Metrics,
                from,
                to);

            return(entries);
        }
Exemple #3
0
        public ActionResult SaveSelectedAccount(int profileID)
        {
            var rr       = new ReportRequestor(CurrentItem.Token);
            var accounts = rr.GetAccounts();

            var account = accounts.Where(a => a.ProfileID == profileID).FirstOrDefault();

            if (account != null)
            {
                CurrentItem.ProfileID   = profileID;
                CurrentItem.AccountID   = account.AccountID;
                CurrentItem.AccountName = account.AccountName;
                CurrentItem.Title       = account.Title;
                Engine.Persister.Save(CurrentItem);
            }
            return(Redirect(CurrentPage.Url));
        }