Exemplo n.º 1
0
        public AccountSettingsViewModel GetAccountSettings(long accountId)
        {
            var account    = _accountManager.GetAccountById(accountId);
            var statistics = _accountStatisticsManager.GetAccountStatistics(accountId);

            var detailedStatistic = new DetailedStatisticsModel
            {
                AllTimeStatistic  = _accountStatisticsManager.GetAllTimeAccountStatistics(statistics),
                LastHourStatistic = _accountStatisticsManager.GetLastHourAccountStatistics(statistics),
            };

            var accountViewModel = new AccountSettingsViewModel
            {
                Statistics = detailedStatistic,
                Account    = new AccountViewModel
                {
                    Id                        = accountId,
                    Name                      = account.Name,
                    PageUrl                   = account.PageUrl,
                    FacebookId                = account.FacebookId,
                    Password                  = account.Password,
                    Login                     = account.Login,
                    Proxy                     = account.Proxy,
                    ProxyLogin                = account.ProxyLogin,
                    ProxyPassword             = account.ProxyPassword,
                    Cookie                    = account.Cookie,
                    GroupSettingsId           = account.GroupSettingsId,
                    AuthorizationDataIsFailed = account.AuthorizationDataIsFailed,
                    IsDeleted                 = account.IsDeleted,
                    ProxyDataIsFailed         = account.ProxyDataIsFailed,
                    ConformationDataIsFailed  = account.ConformationDataIsFailed,
                    UserAgentId               = account.UserAgentId
                }
            };

            return(accountViewModel);
        }