public WebsitePageModel DeepClone()
        {
            var clone = new WebsitePageModel();

            clone.WebsitePages = WebsitePages.DeepClone();
            clone.IsModified   = IsModified;
            return(clone);
        }
Example #2
0
        public void AssignFrom(ReportManifest manifest)
        {
            //Filters = new List<Filter>();
            Columns            = Columns ?? new List <ReportColumn>();
            WebsitePages       = WebsitePages ?? new List <ReportWebsitePage>();
            ComparisonKeyIcons = ComparisonKeyIcons ?? new List <ComparisonKeyIconSet>();
            _rptfilters        = _rptfilters ?? new List <RptFilter>();
            Audiences          = Audiences ?? new List <Audience>();

            Columns.Clear();
            WebsitePages.Clear();
            ComparisonKeyIcons.Clear();
            _rptfilters.Clear();
            Audiences.Clear();

            ComparisonKeyIcons.AddRange(manifest.ToComparisonKeyIconSet(manifest.IconSets, this).ToList());
            Audiences.AddRange(manifest.Audiences.Select(a => a.AudienceType).ToList());
            Category   = manifest.Category;
            IsTrending = manifest.IsTrending;
            Datasets   = manifest.Datasets.Select(d => d.Name).ToList();
            manifest.Columns.ForEach(col => new ReportColumn(this, col.Name)
            {
                IsMeasure = col.IsMeasure, MeasureCode = col.MeasureCode, IsIncluded = true
            });
            manifest.WebsitePages.ForEach(wp => new ReportWebsitePage(this, wp));

            Name                      = manifest.Name;
            ReportAttributes          = manifest.ReportAttributes;
            SourceTemplate            = manifest;
            Description               = !string.IsNullOrWhiteSpace(manifest.Description) ? manifest.Description.TrimStart().TrimEnd() : null;
            Filter                    = CandidateFilters.ToReportFilter();
            RequiresCmsProviderId     = manifest.RequiresCmsProviderId;
            RequiresCostToChargeRatio = manifest.RequiresCostToChargeRatio;
            ReportType                = manifest.Name;
            ShowInterpretationText    = manifest.ShowInterpretationText;
            InterpretationText        = !string.IsNullOrWhiteSpace(manifest.InterpretationText) ? manifest.InterpretationText.TrimStart().TrimEnd() : null;
            Footnote                  = !string.IsNullOrWhiteSpace(manifest.Footer) ? manifest.Footer.TrimStart().TrimEnd() : null;
            ReportOutputSql           = !string.IsNullOrWhiteSpace(manifest.ReportOutputSql) ? manifest.ReportOutputSql.TrimStart().TrimEnd() : null;
            OutputFileName            = !string.IsNullOrWhiteSpace(manifest.OutputFileName) ? manifest.OutputFileName.TrimStart().TrimEnd() : null;
            OutputJsNamespace         = !string.IsNullOrWhiteSpace(manifest.OutputJsNamespace) ? manifest.OutputJsNamespace.TrimStart().TrimEnd() : null;

            _rptfilters.AddRange(RptFilter.FromFilterList(manifest.Filters, this).ToList());

            LastReportManifestUpdate = manifest.FileLastModifiedDate;
        }
Example #3
0
 public void AddWebsitePage(ReportWebsitePage rwp)
 {
     WebsitePages.Add(rwp);
     rwp.Report = this;
 }
 public void DeepAssignmentFrom(WebsitePageModel other)
 {
     WebsitePages.DeepAssignmentFrom(other.WebsitePages, (me, ot) => me.Name == ot.Name && me.Audience == ot.Audience, true);
     IsModified = other.IsModified;
 }