private void GetMonthlyReportData(int year, IList <MonthlyReportData> onlineList, IList <MonthlyReportData> inHouseList)
        {
            var monthlyRunsCount     = _dataSheetService.GetMonthlyRunsCount(year);
            var monthlyConsultations = _dataSheetService.GetMonthlyConsultationReport(year);
            var monthlyNewUsers      = _dataSheetService.GetMonthlyNewUserReport(year);

            foreach (var month in MonthYearHelper.GetMonths())
            {
                //inhouse
                inHouseList.Add(new MonthlyReportData
                {
                    Month           = month.Item1,
                    MonthName       = month.Item2,
                    Inhouse         = Common.Constants.Constants.INHOUSE,
                    NoOfRuns        = GetMonthlyRunsCount(monthlyRunsCount, month.Item1, Common.Constants.Constants.INHOUSE),
                    ConsultationACT = GetMonthlyConsultationACTCount(monthlyConsultations, month.Item1, Common.Constants.Constants.INHOUSE),
                    NUACT           = GetMonthlyNewUserCount(monthlyNewUsers, month.Item1, Common.Constants.Constants.INHOUSE)
                });

                //online
                onlineList.Add(new MonthlyReportData
                {
                    Month           = month.Item1,
                    MonthName       = month.Item2,
                    Inhouse         = Common.Constants.Constants.INHOUSE,
                    NoOfRuns        = GetMonthlyRunsCount(monthlyRunsCount, month.Item1, Common.Constants.Constants.ONLINE),
                    ConsultationACT = GetMonthlyConsultationACTCount(monthlyConsultations, month.Item1, Common.Constants.Constants.ONLINE),
                    NUACT           = GetMonthlyNewUserCount(monthlyNewUsers, month.Item1, Common.Constants.Constants.ONLINE)
                });
            }
        }
示例#2
0
        public ActionResult NewUserMTDDataSheet(int?month = null, int?year = null)
        {
            var now = DateTime.Now;
            var m   = month ?? now.Month;
            var y   = year ?? now.Year;

            var datasheet = _dataSheetService.GetMonthlyNewUserReport(y, m).ToList();
            var viewModel = new NewUserDataSheetViewModel
            {
                Year       = y,
                Month      = m,
                DataSheets = datasheet,
                Years      = MonthYearHelper.GetYearList(),
                Months     = MonthYearHelper.GetMonthList()
            };

            return(View(viewModel));
        }