Exemplo n.º 1
0
        public void PopulateDocument(IBaseTemplate template, string previousCoverPageTitle, string previousLogoTitle, IDocument document)
        {
            var tmpPresenter = new BaseWizardPresenter(document, this);

            //populate the content controls
            tmpPresenter.PopulateData(template);
            //change the graphics selected
            // if (Streams == null) return;
            tmpPresenter.PopulateGraphics(template, previousCoverPageTitle, previousLogoTitle);
            tmpPresenter.UpdateFields();
            tmpPresenter.CreateOrUpdateDocumentProperty(Constants.WordDocumentProperties.DocumentGeneratedDate, DateTime.Now.ToString(CultureInfo.CurrentUICulture));
        }
Exemplo n.º 2
0
        private void PopulateImages()
        {
            var template = GenerateTempalteObject();

            //change the graphics selected
            //if (Streams == null) return;

            LogTemplateDetails(template);

            _wizardPresenter.PopulateGraphics(template, lblCoverPageTitle.Text, lblLogoTitle.Text);
            BaseWizardPresenter.CreateOrUpdateDocumentProperty(Constants.WordDocumentProperties.Speciality,
                                                               lblSpeciality.Text);
        }
Exemplo n.º 3
0
        public virtual void PopulateDocument(IBaseTemplate template, string previousCoverPageTitle, string previousLogoTitle)
        {
            //populate the content controls
            BaseWizardPresenter.PopulateData(template);
            //change the graphics selected
            // if (Streams == null) return;
            BaseWizardPresenter.PopulateGraphics(template, previousCoverPageTitle, previousLogoTitle);
            BaseWizardPresenter.UpdateFields();
            var type = template.GetType();

            //var propertyName = Constants.WordDocumentProperties.UsedDateOfLogo;

            //if(key.Equals("Themes",StringComparison.OrdinalIgnoreCase))
            //    propertyName = Constants.WordDocumentProperties.UsedDateOfTheme;


            var date     = DateTime.Now.ToString("dd/MM/yy");
            var logoVal  = string.Format("{0};{1}", template.LogoImageUrl, date);
            var themeVal = string.Format("{0};{1}", template.CoverPageImageUrl, date);

            BaseWizardPresenter.CreateOrUpdateDocumentProperty(Constants.WordDocumentProperties.UsedDateOfLogo, logoVal);
            BaseWizardPresenter.CreateOrUpdateDocumentProperty(Constants.WordDocumentProperties.UsedDateOfTheme, themeVal);
            BaseWizardPresenter.CreateOrUpdateDocumentProperty(Constants.WordDocumentProperties.DocumentGeneratedDate, date);
        }
        private void PopulateDocument()
        {
            BaseWizardPresenter.CreateOrUpdateDocumentProperty(Constants.WordDocumentProperties.Speciality,
                                                               lblSpeciality.Text);

            var template = GenerateTempalteObject();

            //change the graphics selected
            //if (Streams == null) return;
            if (LoadType == Enums.FormLoadType.ConvertWizard)
            {
//if we are running a convert we want to force the repopulation of the images.
                lblCoverPageTitle.Text = string.Empty;
                lblLogoTitle.Text      = string.Empty;
            }

            LogTemplateDetails(template);
            _wizardPresenter.PopulateGraphics(template, lblCoverPageTitle.Text, lblLogoTitle.Text);

            if (LoadType == Enums.FormLoadType.RibbonClick)
            {
                LogUsage(template, Enums.UsageTrackingType.UpdateData);
                _wizardPresenter.PopulateData(template);
                return;
            }

            _wizardPresenter.PopulateImportantNotices();

            if (rdoClitProfileYes.Checked)
            {
                _wizardPresenter.PopulateclientProfile(Settings.Default.FragmentClientProfile);
            }

            if (rdoContractProcedYes.Checked)
            {
                _wizardPresenter.PopulateContractingProcedure(Settings.Default.FragmentContractingProcedure);
            }


            var urls =
                (from object i in clbClaimsProcedures.CheckedItems select((ISharePointListItem)i).FileRef).ToList();

            _wizardPresenter.PopulateClaimsProcedures(urls);

            _wizardPresenter.PopulatePolicyTable(template.SelectedPolicyClasses);

            _wizardPresenter.PopulateProgramSummarys(template.SelectedPolicyClasses,
                                                     Settings.Default.InsuranceManualProgramSummary);

            //_wizardPresenter.PopulateClaimsProcedures(template.SelectedPolicyClasses);

            _wizardPresenter.PopulateData(template);
            _wizardPresenter.MoveToStartOfDocument();

            _wizardPresenter.ForceUpdateToc();


            Enums.UsageTrackingType loggingtype;

            if (LoadType == Enums.FormLoadType.ConvertWizard)
            {
                loggingtype = Enums.UsageTrackingType.ConvertDocument;
            }
            else
            {
                loggingtype = (LoadType == Enums.FormLoadType.RegenerateTemplate
                    ? Enums.UsageTrackingType.RegenerateDocument
                    : Enums.UsageTrackingType.NewDocument);
            }
            //tracking
            LogUsage(template, loggingtype);
        }