示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ReportParametersDTO"/> class
        /// </summary>
        /// <param name="reportId">The report Id</param>
        /// <param name="reportName">The report Name</param>
        /// <param name="reportType">The report Type</param>
        /// <param name="currencyCode">The currency code</param>
        /// <param name="entityTypes">The entity types</param>
        /// <param name="entityList">The entity list</param>
        /// <param name="sensitizeMRIPayrollData">Whether to sensitize payroll data</param>
        /// <param name="calculationMethod">The calculation method</param>
        /// <param name="glCategorization">The gl categorization</param>
        /// <param name="functionalDepartments">The functional departments</param>
        /// <param name="allocationSubRegions">The allocation sub regions</param>
        /// <param name="originatingSubRegions">The originating sub regions</param>
        /// <param name="financialCategories">The financial categories</param>
        /// <param name="majorCategories">The major categories</param>
        /// <param name="minorCategories">The minor categories</param>
        /// <param name="activityTypes">The activity types</param>
        /// <param name="includeGrossNonPayrollExpenses">Whether to include gross non payroll expenses</param>
        /// <param name="includeFeeAdjustments">Whether to include fee adjustments</param>
        /// <param name="displayOverheadBy">What to display overhead by</param>
        /// <param name="overheadOriginatingSubRegions">The overhead originating sub regions</param>
        /// <param name="consolidationRegions">The consolidation sub regions</param>
        /// <param name="reportReceivers">The report receivers</param>
        /// <param name="minorCategoryActivityTypeCombinations">The minorCategoryActivityTypeCombinations</param>
        public ReportParametersDTO(
            int reportId,
            string reportName,
            ReportType reportType,
            string currencyCode,
            List<string> entityTypes,
            List<string> entityList,
            bool? sensitizeMRIPayrollData,
            string calculationMethod,
            string glCategorization,
            List<string> functionalDepartments,
            List<string> allocationSubRegions,
            List<string> originatingSubRegions,
            List<string> financialCategories,
            List<string> majorCategories,
            List<string> minorCategories,
            List<string> activityTypes,
            bool? includeGrossNonPayrollExpenses,
            bool? includeFeeAdjustments,
            string displayOverheadBy,
            List<string> overheadOriginatingSubRegions,
            List<string> consolidationRegions,
            List<string> reportReceivers,
            MinorCategoryActivityTypeCombination minorCategoryActivityTypeCombinations)
        {
            this.ReportId = reportId;
            this.ReportName = reportName;
            this._ReportType = reportType;
            this.CurrencyCode = currencyCode;
            this._EntityTypes = entityTypes;
            this._EntityList = entityList;
            this._SensitizeMRIPayrollData = sensitizeMRIPayrollData;
            this.CalculationMethod = calculationMethod;
            this.GLCategorization = glCategorization;
            this._FunctionalDepartments = functionalDepartments;
            this._AllocationSubRegions = allocationSubRegions;
            this._OriginatingSubRegions = originatingSubRegions;
            this._FinancialCategories = financialCategories;
            this._MajorCategories = majorCategories;
            this._MinorCategories = minorCategories;
            this._ActivityTypes = activityTypes;
            this._IncludeGrossNonPayrollExpenses = includeGrossNonPayrollExpenses;
            this._IncludeFeeAdjustments = includeFeeAdjustments;
            this._DisplayOverheadBy = displayOverheadBy;
            this._OverheadOriginatingSubRegions = overheadOriginatingSubRegions;
            this._ConsolidationRegions = consolidationRegions;
            this._ReportReceivers = reportReceivers;

             this.MinorCategoryActivityTypeCombinations = minorCategoryActivityTypeCombinations;
        }
示例#2
0
        /// <summary>
        /// Gets a Expense Czar Report DTO
        /// </summary>
        /// <param name="report">The report for which to create the DTO</param>
        /// <returns>The report parameter DTO object</returns>
        public static ReportParametersDTO GetExpenseCzarReportDTO(Report report)
        {
            List<string> entityTypeList = new List<string>();

            foreach (ReportParameterEntityType entityType in report.ReportParameterEntityTypes)
            {
                entityTypeList.Add(entityType.ParameterEntityType == null ? InvalidParameterString : entityType.ParameterEntityType.Name);
            }

            List<string> entityList = new List<string>();

            foreach (ReportParameterEntityType entityType in report.ReportParameterEntityTypes)
            {
                foreach (ReportParameterPropertyFund entity in entityType.ReportParameterPropertyFunds)
                {
                    if (!entityList.Contains(entity.ParameterPropertyFund == null ? InvalidParameterString : entity.ParameterPropertyFund.Name))
                    {
                        entityList.Add(entity.ParameterPropertyFund == null ? InvalidParameterString : entity.ParameterPropertyFund.Name);
                    }
                }
            }

            List<string> functionalDepartmentList = new List<string>();

            foreach (ReportParameterFunctionalDepartment functionalDepartment in report.ReportParameterFunctionalDepartments)
            {
                functionalDepartmentList.Add(functionalDepartment.ParameterFunctionalDepartment == null ? InvalidParameterString : functionalDepartment.ParameterFunctionalDepartment.Name);
            }

            List<string> allocationSubRegionList = new List<string>();

            foreach (ReportParameterAllocationSubRegion allocationSubRegion in report.ReportParameterAllocationSubRegions)
            {
                allocationSubRegionList.Add(allocationSubRegion.ParameterAllocationSubRegion == null ? InvalidParameterString : allocationSubRegion.ParameterAllocationSubRegion.Name);
            }

            List<string> financialCategoryList = new List<string>();

            List<string> majorCategoryList = new List<string>();

            List<string> minorCategoryList = new List<string>();

            List<string> activityTypeList = new List<string>();

            MinorCategoryActivityTypeCombination minorCategoryActivityTypes = new MinorCategoryActivityTypeCombination();

            if (report.ReportParameterGLCategorization != null)
            {
                foreach (ReportParameterGLFinancialCategory financialCategory in report.ReportParameterGLCategorization.ReportParameterGLFinancialCategories)
                {
                    if (!financialCategoryList.Contains(financialCategory.ParameterGLFinancialCategory == null ? InvalidParameterString : financialCategory.ParameterGLFinancialCategory.Name))
                    {
                    financialCategoryList.Add(financialCategory.ParameterGLFinancialCategory == null ? InvalidParameterString : financialCategory.ParameterGLFinancialCategory.Name);
                    }

                    foreach (ReportParameterGLMajorCategory majorCategory in financialCategory.ReportParameterGLMajorCategories)
                    {
                        if (!majorCategoryList.Contains(majorCategory.ParameterGLMajorCategory == null ? InvalidParameterString : majorCategory.ParameterGLMajorCategory.Name))
                        {
                            majorCategoryList.Add(majorCategory.ParameterGLMajorCategory == null ? InvalidParameterString : majorCategory.ParameterGLMajorCategory.Name);
                        }

                        foreach (ReportParameterGLMinorCategory minorCategory in majorCategory.ReportParameterGLMinorCategories)
                        {
                            if (!minorCategoryList.Contains(minorCategory.ParameterGLMinorCategory == null ? InvalidParameterString : minorCategory.ParameterGLMinorCategory.Name))
                            {
                                minorCategoryList.Add(minorCategory.ParameterGLMinorCategory == null ? InvalidParameterString : minorCategory.ParameterGLMinorCategory.Name);
                            }

                            if (minorCategory.ParameterGLMinorCategory != null)
                            {
                                foreach (ReportParameterGLMinorCategoryActivityType minorCategoryActivityType in minorCategory.ReportParameterGLMinorCategoryActivityTypes)
                                {
                                    // we want to distinct the list of activity types, otherwise we will add one for each minor category, leading to duplicates
                                    if (!activityTypeList.Contains(minorCategoryActivityType.ParameterActivityType == null ? InvalidParameterString : minorCategoryActivityType.ParameterActivityType.Name))
                                    {
                                        activityTypeList.Add(minorCategoryActivityType.ParameterActivityType == null ? InvalidParameterString : minorCategoryActivityType.ParameterActivityType.Name);
                                    }

                                    minorCategoryActivityTypes.AddMinorCategoryActivityType(minorCategoryActivityType.GroupId, minorCategory.ParameterGLMinorCategory == null ? InvalidParameterString : minorCategory.ParameterGLMinorCategory.Name, minorCategoryActivityType.ParameterActivityType == null ? InvalidParameterString : minorCategoryActivityType.ParameterActivityType.Name);
                                }
                            }
                        }
                    }
                }
            }

            List<string> reportReceiversList = new List<string>();

            foreach (ReportParameterReportReceiver reportReceiver in report.ReportParameterReportReceivers)
            {
                if (reportReceiver.ParameterReportReceiver != null)
                {
                    reportReceiversList.Add(reportReceiver.ParameterReportReceiver.StaffName);
                }
            }

            string reportParameterCurrency = report.ReportParameterCurrency == null ? InvalidParameterString : report.ReportParameterCurrency.CurrencyCode;
            bool? reportParameterShowMRISourceForPayroll = report.ReportParameterShowMRISourceForPayroll == null ? (bool?)null : report.ReportParameterShowMRISourceForPayroll.ShowMRISourceForPayroll;
            string reportParameterCalculationMethod = report.ReportParameterCalculationMethod == null ? InvalidParameterString : report.ReportParameterCalculationMethod.ParameterCalculationMethod == null ? InvalidParameterString : report.ReportParameterCalculationMethod.ParameterCalculationMethod.Name;

            return new ReportParametersDTO(
                report.ReportId,
                report.Name,
                EnumHelper.GetEnum<GRP.BusinessLayer.Automation.Enums.ReportType>(report.ReportType.Name),
                reportParameterCurrency,
                entityTypeList,
                entityList,
                reportParameterShowMRISourceForPayroll,
                reportParameterCalculationMethod,
                "Global",
                functionalDepartmentList,
                allocationSubRegionList,
                null,
                financialCategoryList,
                majorCategoryList,
                minorCategoryList,
                activityTypeList,
                null,
                null,
                null,
                null,
                null,
                reportReceiversList,
                minorCategoryActivityTypes);
        }