public void GetDetails(string teacherID, DateTime summaryDate, bool isTotal) { List <ClassInfoForTeacherModel> res = new List <ClassInfoForTeacherModel>(); if (isTotal) { foreach (List <ClassInfoForTeacherModel> lst in _teachingCountGroups.Where(t => t.TeacherID == teacherID).First().DetailsGroup.Values) { res.AddRange(lst); } } else { res.AddRange(_teachingCountGroups.Where(t => t.TeacherID == teacherID).First().DetailsGroup[summaryDate]); } ShowDetailsEvent?.Invoke(res); }
public void GetDetails(StatisticTypeEnum statisticType, DateTime summaryDate, bool isTotal) { List <AccountInfoModel> normalStatistic; List <TeacherFeeModel> teacherFeeStatistic; List <ClassPaymentModel> classpaymentStatistic; normalStatistic = new List <AccountInfoModel>(); teacherFeeStatistic = new List <TeacherFeeModel>(); classpaymentStatistic = new List <ClassPaymentModel>(); if (isTotal) { if (statisticType == StatisticTypeEnum.AllIncome) { foreach (List <AccountInfoModel> item in _normalStatisticGroup.Where(g => g.StatisticType == StatisticTypeEnum.AllIncome).First().FinanceDetails.Values) { if (item != null) { normalStatistic.AddRange(item); } } if (_classPaymentStatisticGroup != null) { foreach (List <ClassPaymentModel> item in _classPaymentStatisticGroup.FinanceDetails.Values) { classpaymentStatistic.AddRange(item); } } } else if (statisticType == StatisticTypeEnum.AllOutcome) { foreach (List <AccountInfoModel> item in _normalStatisticGroup.Where(g => g.StatisticType == StatisticTypeEnum.AllOutcome).First().FinanceDetails.Values) { if (item != null) { normalStatistic.AddRange(item); } } if (_teacherFeeStatistcGroup != null) { foreach (List <TeacherFeeModel> item in _teacherFeeStatistcGroup.FinanceDetails.Values) { teacherFeeStatistic.AddRange(item); } } } else if (statisticType == StatisticTypeEnum.ClassFee) { if (_classPaymentStatisticGroup != null) { foreach (List <ClassPaymentModel> item in _classPaymentStatisticGroup.FinanceDetails.Values) { classpaymentStatistic.AddRange(item); } } } else if (statisticType == StatisticTypeEnum.TeacherFee) { if (_teacherFeeStatistcGroup != null) { foreach (List <TeacherFeeModel> item in _teacherFeeStatistcGroup.FinanceDetails.Values) { teacherFeeStatistic.AddRange(item); } } } else { foreach (List <AccountInfoModel> item in _normalStatisticGroup.Where(g => g.StatisticType == statisticType).First().FinanceDetails.Values) { if (item != null) { normalStatistic.AddRange(item); } } } } else { if (statisticType == StatisticTypeEnum.AllIncome) { normalStatistic = _normalStatisticGroup.Where(s => s.StatisticType == StatisticTypeEnum.AllIncome).First().FinanceDetails[summaryDate]; if (_classPaymentStatisticGroup != null) { classpaymentStatistic = _classPaymentStatisticGroup.FinanceDetails[summaryDate]; } } else if (statisticType == StatisticTypeEnum.AllOutcome) { normalStatistic = _normalStatisticGroup.Where(s => s.StatisticType == StatisticTypeEnum.AllOutcome).First().FinanceDetails[summaryDate]; if (_teacherFeeStatistcGroup != null) { teacherFeeStatistic = _teacherFeeStatistcGroup.FinanceDetails[summaryDate]; } } else if (statisticType == StatisticTypeEnum.ClassFee) { if (_classPaymentStatisticGroup != null) { classpaymentStatistic = _classPaymentStatisticGroup.FinanceDetails[summaryDate]; } } else if (statisticType == StatisticTypeEnum.TeacherFee) { if (_teacherFeeStatistcGroup != null) { teacherFeeStatistic = _teacherFeeStatistcGroup.FinanceDetails[summaryDate]; } } else { normalStatistic = _normalStatisticGroup.Where(s => s.StatisticType == statisticType).First().FinanceDetails[summaryDate]; } } ShowDetailsEvent?.Invoke(normalStatistic, teacherFeeStatistic, classpaymentStatistic); }