Exemple #1
0
        private StandaloneDigitalInfoOneSheetOutputModel PrepareOneSheetOutput()
        {
            var outputPage = new StandaloneDigitalInfoOneSheetOutputModel(_dataContainer);

            outputPage.Advertiser    = _dataContainer.ParentScheduleSettings.BusinessName;
            outputPage.DecisionMaker = _dataContainer.ParentScheduleSettings.DecisionMaker;

            var temp = new List <string>();

            if (_digitalInfo.ShowMonthlyInvestemt && _digitalInfo.MonthlyInvestment.HasValue)
            {
                temp.Add(String.Format("Monthly Digital Investment: {0}", _digitalInfo.MonthlyInvestment.Value.ToString("$#,###.00")));
            }
            if (_digitalInfo.ShowTotalInvestemt && _digitalInfo.TotalInvestment.HasValue)
            {
                temp.Add(String.Format("Total Digital Investment: {0}", _digitalInfo.TotalInvestment.Value.ToString("$#,###.00")));
            }
            outputPage.SummaryInfo = temp.Any() ? String.Join("     ", temp) : String.Empty;

            outputPage.Color = MediaMetaData.Instance.SettingsManager.SelectedColor ??
                               BusinessObjects.Instance.OutputManager.ScheduleColors.Items.Select(ci => ci.Name).FirstOrDefault();

            #region Set OutputDigitalProduct Values
            for (var j = 0; j < _digitalInfo.Records.Count; j++)
            {
                var digitalInfoRecord = _digitalInfo.Records[j];
                var outputProduct     = new DigitalInfoRecordOutputModel();
                outputProduct.LineID = digitalInfoRecord.Index.ToString("00");
                outputProduct.Logo   = _digitalInfo.ShowLogo ?
                                       digitalInfoRecord.Logo?.Clone <ImageSource, ImageSource>() :
                                       null;
                outputProduct.Details = digitalInfoRecord.OneSheetDetails;
                outputPage.Records.Add(outputProduct);
                Application.DoEvents();
            }
            #endregion

            outputPage.GetLogos();
            outputPage.PopulateReplacementsList();

            return(outputPage);
        }