// GET: IncomeExpenseReport
        public ActionResult Index(int?id)
        {
            IncomeExpensesReport ierData = null;
            IEReport             dM      = new IEReport();

            if (id == 1)
            {
                ierData = dM.GetDailyReport(_context, DateTime.Today);
            }
            else if (id == 7)
            {
                ierData = dM.GetWeeklyReport(_context);
            }
            else if (id == 30)
            {
                ierData = dM.GetMonthlyReport(_context, DateTime.Today);
            }
            else if (id == 365)
            {
                ierData = dM.GetYearlyReport(_context, DateTime.Today);
            }
            else
            {
                ierData = dM.GetDailyReport(_context, DateTime.Today);
            }

            return(View(ierData));
        }
示例#2
0
        public IActionResult IEReport()
        {
            IEReport dM   = new IEReport();
            IERVM    data = new IERVM {
                CurrentWeek = dM.GetWeeklyReport(_context),
                Monthly     = dM.GetMonthlyReport(_context, DateTime.Today),
                Today       = dM.GetDailyReport(_context, DateTime.Today),
                Yearly      = dM.GetYearlyReport(_context, DateTime.Today)
            };

            return(View(data));
        }
示例#3
0
        public IActionResult Index(int?id, DateTime?ondate)
        {
            DateTime onDate = DateTime.Today;

            if (ondate != null)
            {
                onDate = ondate ?? DateTime.Today;
            }

            IncomeExpensesReport ierData;
            IEReport             dM = new IEReport();

            if (id == 1)
            {
                ierData = dM.GetDailyReport(_context, onDate);
            }
            else if (id == 7)
            {
                ierData = dM.GetWeeklyReport(_context);
            }
            else if (id == 30)
            {
                ierData = dM.GetMonthlyReport(_context, onDate);
            }
            else if (id == 365)
            {
                ierData = dM.GetYearlyReport(_context, onDate);
            }
            else if (id == 600)
            {
                ierData = dM.GetYearlyReport(_context, onDate.AddDays(-365));
            }
            else
            {
                ierData = dM.GetDailyReport(_context, onDate);
            }

            return(View(ierData));
        }