コード例 #1
0
        public ActionResult Index(int accountId, string graphType)
        {
            StatsManager manager = new StatsManager();
            GraphType type = manager.ParseStringToGrphType(graphType);

            if (type == GraphType.none)
                return RedirectToAction("Index", "Stats", new { accountId = accountId, graphType = "growth" });

            if (accountId == 0)
                ViewData["AccountError"] = true;

            manager.IncrementViews(accountId);

            Statistic stat = new Statistic();
            stat.CurrentGraphType = type;

            ShortStatistic shortStat = new ShortStatistic();
            shortStat.Settings = manager.GetAccountSettings(accountId);

            manager.FillUserStatistic(accountId, shortStat, stat);
            stat.ShortStatisticData = shortStat;

            return View("Index", stat);
        }
コード例 #2
0
            private ActionResult InitiateAccountView()
            {
            AddEmailValidator();
            StatsManager statsManager = new StatsManager();
            ViewBag.StatisticSettings = statsManager.GetOrCreateUserSettings(User.Identity.Name);
            if (!User.Identity.IsAuthenticated)
                return View("Index");
            ViewBag.Title =
            ViewData["PartnerCode"] = UsersManager.GetIdAsPartner(User.Identity.Name);

            return View("Account");
            }
コード例 #3
0
            public ActionResult UpdateSettings(UserStatisticSettings settings)
            {
            StatsManager statsManager = new StatsManager();
            statsManager.UpdateUserSettings(settings);
            ViewData["IsPostSuccess"] = true;

            return InitiateAccountView();
            }