Пример #1
0
 private StatisticsDetails(Statistics statistics)
 {
     UserId = statistics.UserId;
     RegistredPeopleQuota = statistics.RegistredPeopleQuota;
     RegistredPeopleQuotaLastMonth = statistics.RegistredPeopleQuotaLastMonth;
     PremiumPartnersQuota = statistics.PremiumPartnersQuota;
     PremiumPartnersQuotaLastMonth = statistics.PremiumPartnersQuotaLastMonth;
     BuyersQuota = statistics.BuyersQuota;
     ContactedPeopleCount = statistics.ContactedPeopleCount;
     ContactedPeopleCountLastMonth = statistics.ContactedPeopleCountLastMonth;
 }
Пример #2
0
        public static StatisticsDetails GetModelView(Statistics statistics)
        {
            if (statistics == null)
                return null;

            var statisticsDetails = new StatisticsDetails(statistics);
            return statisticsDetails;
        }
Пример #3
0
        public static StatisticsIndex GetModelView(Statistics[] statistics)
        {
            if (statistics == null || statistics.Length == 0)
                return null;

            var statisticsIndex = new StatisticsIndex(statistics);
            return statisticsIndex;
        }
Пример #4
0
 private StatisticsIndex(Statistics[] statistics)
 {
     All = StatisticsDetails.GetModelView(statistics.FirstOrDefault(s => s.StatisticsGroup == StatisticsGroup.All));
     Downline = StatisticsDetails.GetModelView(statistics.FirstOrDefault(s => s.StatisticsGroup == StatisticsGroup.Downline));
     LeaderDownline = StatisticsDetails.GetModelView(statistics.FirstOrDefault(s => s.StatisticsGroup == StatisticsGroup.LeaderDownline));
     Owner = StatisticsDetails.GetModelView(statistics.FirstOrDefault(s => s.StatisticsGroup == StatisticsGroup.Owner));
 }