Example #1
0
 private void btnNext_Click(object sender, EventArgs e)
 {
     if (String.Equals(btnNext.Text, "&Finish", StringComparison.CurrentCultureIgnoreCase))
     {
         if (Validation.HasValidationErrors(Controls))
         {
             MessageBox.Show(@"Please ensure all required fields are populated", @"Required fields are missing",
                             MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             return;
         }
         try
         {
             Cursor = Cursors.WaitCursor;
             BaseWizardPresenter.SwitchScreenUpdating(false);
             RunPopulate();
         }
         catch (Exception ex)
         {
             OnError(ex);
         }
         finally
         {
             Cursor = Cursors.Default;
             BaseWizardPresenter.SwitchScreenUpdating(true);
         }
     }
     else
     {
         SwitchTab(tbcWizardScreens.SelectedIndex + 1);
     }
 }
        private void btnNext_Click(object sender, EventArgs e)
        {
            if (String.Equals(btnNext.Text, "&Finish", StringComparison.CurrentCultureIgnoreCase))
            {
                try
                {
                    Cursor = Cursors.WaitCursor;
                    BaseWizardPresenter.SwitchScreenUpdating(false);
                    //call presenter to populate
                    PopulateDocument();
                }
                catch (Exception ex)
                {
                    OnError(ex);
                }
                finally
                {
                    Cursor = Cursors.Default;
                    BaseWizardPresenter.SwitchScreenUpdating(true);
                    //thie information panel loads when a document is in sharePoint that has metadata
                    //clients don't wish to see this so force the close of the panel once the wizard completes.
                    _wizardPresenter.CloseInformationPanel();
                }


                Close();
            }
            else
            {
                SwitchTab(tbcWizardScreens.SelectedIndex + 1);
            }
        }
Example #3
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            if (string.Equals(btnNext.Text, "&Finish", StringComparison.CurrentCultureIgnoreCase))
            {
                if (Validation.HasValidationErrors(Controls))
                {
                    MessageBox.Show(@"Please ensure all required fields are populated", @"Required fields are missing",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                try
                {
                    Cursor = Cursors.WaitCursor;
                    BaseWizardPresenter.SwitchScreenUpdating(false);
                    //call presenter to populate
                    //buid the marketing template
                    var template = new Agenda
                    {
                        DocumentTitle    = _meetingType,
                        DocumentSubTitle = string.Empty,
                        AgendaDate       = dateAgenda.Text,
                        AgendaTimeFrom   = timeAgendaFrom.Text,
                        AgendaTimeTo     = timeAgendaTo.Text,
                        Subject          = txtClientSubject.Text,
                        ClientName       = txtClientName.Text,
                        Location         = txtLocation.Text
                    };

                    var baseTemplate = (BaseTemplate)template;
                    var logoTab      = tbcWizardScreens.TabPages[Constants.ControlNames.TabPageLogosName];
                    PopulateLogosToTemplate(logoTab, ref baseTemplate);
                    var covberTab = tbcWizardScreens.TabPages[Constants.ControlNames.TabPageCoverPagesName];
                    PopulateCoversToTemplate(covberTab, ref baseTemplate);
                    if (GenerateNewTemplate)
                    {
                        Cache.Add(Constants.CacheNames.RegenerateTemplate, template, new CacheItemPolicy());
                        _wizardPresenter.GenerateNewTemplate(Constants.CacheNames.RegenerateTemplate,
                                                             Settings.Default.TemplateAgenda);
                    }
                    else
                    {
                        if (rdoMeetingMinutes.Checked && !Reload)
                        {
                            _wizardPresenter.InsertMinutesFragement(Settings.Default.FragmentAGMinutes);
                        }

                        if (rdoMeetingMinutes.Checked && AutoComplete)
                        {
                            _wizardPresenter.InsertMinutesFragement(Settings.Default.FragmentAGMinutes);
                        }
                        PopulateDocument(template, lblCoverPageTitle.Text, lblLogoTitle.Text);

                        //tracking
                        LogUsage(template,
                                 Reload
                                ? Enums.UsageTrackingType.UpdateData
                                : Enums.UsageTrackingType.NewDocument);
                    }
                    //thie information panel loads when a document is in sharePoint that has metadata
                    //clients don't wish to see this so force the close of the panel once the wizard completes.
                    _wizardPresenter.CloseInformationPanel();
                    Close();
                }
                catch (Exception ex)
                {
                    OnError(ex);
                }
                finally
                {
                    Cursor = Cursors.Default;
                    BaseWizardPresenter.SwitchScreenUpdating(true);
                }
            }
            else
            {
                SwitchTab(tbcWizardScreens, tbcWizardScreens.SelectedIndex + 1);
            }
        }