コード例 #1
0
ファイル: ReportsController.cs プロジェクト: atk0dev/DataGate
        public async Task <IActionResult> TSReports(string type, int?id)
        {
            int typeIndex = (type == EndpointsConstants.DisplaySub + EndpointsConstants.FundArea) ?
                            2 : 3;

            this.SetViewDataValues(type, typeIndex);

            var today = DateTime.Today;

            var viewModel = new TimeSerieReportsListViewModel
            {
                AreaName  = type,
                StartDate = today.BuildReportDate(null, 1),
                EndDate   = DateTime.Today,
            };

            //viewModel.TimeSerieReports = await this.repository.GetAllTSReports(type, id, viewModel.TimeSeriesType);

            if (id.HasValue)
            {
                viewModel.Entity = await this.repository.ByName(type, id);
            }

            await this.recentService.Save(this.User, this.Request.Path);

            return(this.View(viewModel));
        }
コード例 #2
0
        public async Task <IActionResult> TSReports(string type, int?id)
        {
            int typeIndex = (type == EndpointsConstants.DisplaySub + EndpointsConstants.FundArea) ?
                            2 : 3;

            this.SetViewDataValues(type, typeIndex);

            var viewModel = new TimeSerieReportsListViewModel
            {
                AreaName  = type,
                StartDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month - 1, DateTime.Today.Day),
                EndDate   = DateTime.Today,
            };

            //viewModel.TimeSerieReports = await this.repository.GetAllTSReports(type, id, viewModel.TimeSeriesType);

            if (id.HasValue)
            {
                viewModel.Entity = await this.repository.ByName(type, id);
            }

            return(this.View(viewModel));
        }