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; }
public static StatisticsDetails GetModelView(Statistics statistics) { if (statistics == null) return null; var statisticsDetails = new StatisticsDetails(statistics); return statisticsDetails; }
public static StatisticsIndex GetModelView(Statistics[] statistics) { if (statistics == null || statistics.Length == 0) return null; var statisticsIndex = new StatisticsIndex(statistics); return statisticsIndex; }
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)); }