コード例 #1
0
        private OperationDataConfigurationViewModel ConfigurationViewModel(OperationDataParamConfigurationViewModel paramViewModel, bool?isIncludeGroup)
        {
            PeriodeType pType = string.IsNullOrEmpty(paramViewModel.PeriodeType)
                                    ? PeriodeType.Yearly
                                    : (PeriodeType)Enum.Parse(typeof(PeriodeType), paramViewModel.PeriodeType);

            var request = paramViewModel.MapTo <GetOperationDataConfigurationRequest>();

            request.PeriodeType = pType;
            request.IsPartial   = isIncludeGroup.HasValue && isIncludeGroup.Value;
            var response  = _operationDataService.GetOperationDataConfiguration(request);
            var viewModel = response.MapTo <OperationDataConfigurationViewModel>();

            viewModel.Years       = _dropdownService.GetYearsForOperationData().MapTo <SelectListItem>();
            viewModel.PeriodeType = pType.ToString();
            viewModel.Year        = request.Year;
            viewModel.ConfigType  = ConfigType.OperationData.ToString();
            return(viewModel);
        }
コード例 #2
0
        public ActionResult DownloadTemplateForAllGroup(OperationDataParamConfigurationViewModel paramViewModel)
        {
            PeriodeType pType = string.IsNullOrEmpty(paramViewModel.PeriodeType)
                                   ? PeriodeType.Yearly
                                   : (PeriodeType)Enum.Parse(typeof(PeriodeType), paramViewModel.PeriodeType);

            var request = paramViewModel.MapTo <GetOperationDataConfigurationRequest>();

            request.PeriodeType = pType;
            request.IsPartial   = false;
            var response  = _operationDataService.GetOperationDataConfigurationForAllGroup(request);
            var viewModel = response.MapTo <OperationDataConfigurationViewModel>();

            viewModel.Years       = _dropdownService.GetYearsForOperationData().MapTo <SelectListItem>();
            viewModel.PeriodeType = pType.ToString();
            viewModel.Year        = request.Year;
            viewModel.ConfigType  = ConfigType.OperationData.ToString();
            return(ConvertToExcelFile(paramViewModel, viewModel));
        }