Gramps.Controllers.ViewModels.ReportLaunchViewModel.GenerateGeneric C# (CSharp) Метод

GenerateGeneric() приватный статический Метод

private static GenerateGeneric ( ReportLaunchViewModel viewModel, Report report, CallForProposal callForProposal ) : ReportLaunchViewModel
viewModel ReportLaunchViewModel
report Report
callForProposal CallForProposal
Результат ReportLaunchViewModel
        private static ReportLaunchViewModel GenerateGeneric(ReportLaunchViewModel viewModel, Report report, CallForProposal callForProposal)
        {
            //deal with the column names
            foreach (var reportColumn in report.ReportColumns)
            {
                if (reportColumn.IsProperty || viewModel.AvailableQuestions.Contains(reportColumn.Name))
                {
                    viewModel.ColumnNames.Add(Inflector.Titleize(Inflector.Humanize(Inflector.Underscore(reportColumn.Name))));
                }
            }

            var proposals = callForProposal.Proposals.AsQueryable();
            if (!report.ShowUnsubmitted)
            {
                proposals = proposals.Where(a => a.IsSubmitted);
            }
            //foreach (var proposal in callForProposal.Proposals.Where(a => a.IsSubmitted))
            foreach (var proposal in proposals)
            {
                var row = new List<string>();

                foreach (var reportColumn in report.ReportColumns)
                {
                    if (reportColumn.IsProperty || viewModel.AvailableQuestions.Contains(reportColumn.Name))
                    {
                        row.Add(ExtractValue(reportColumn, proposal, viewModel.ForExport));
                    }
                }

                viewModel.RowValues.Add(row.ToArray());
            }

            return viewModel;
        }