//Initializes and displays the form to create a new Template
        private void NewTemplateButton_MouseClick(object sender, MouseEventArgs e)
        {
            this.Hide();
            CreateNewTemplateForm NewCreateNewTemplateForm = new CreateNewTemplateForm();

            NewCreateNewTemplateForm.ShowDialog();
        }
Exemple #2
0
        public void NewTemplateError()
        {
            if (MessageBox.Show("One or more fields contain no text, you must go back.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Stop) == DialogResult.OK)
            {
                ;
            }
            {
                //what do do when button pressed

                CreateNewTemplateForm NewCreateNewTemplateForm = new CreateNewTemplateForm();
                NewCreateNewTemplateForm.ShowDialog();
            }
        }
Exemple #3
0
        private void SaveHeaderAndFooter_MouseClick(object sender, MouseEventArgs e)
        {
            this.Hide();
            //Creates a new generic tempate
            GenericTemplate newGenericTemplate = new GenericTemplate();

            //Temporary storing strings set by user input into textboxes
            string title  = TitleTextBox.Text;
            string header = HeaderTextBox.Text;
            string footer = FooterTextBox.Text;

            //Exception Handling for "get"

            //is there text in the field?

            if (string.IsNullOrWhiteSpace(title))
            {
                //TODO code for handling here
                //ErrorForm errorForm = new CVFeedbackApp.ErrorForm();
                //errorForm.Show();

                //trying messagebox instead of a form
                if (MessageBox.Show("One or more fields contain no text, you must go back.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Stop) == DialogResult.OK)
                {
                    ;
                }
                {
                    //what do do when button pressed
                    this.Hide();
                    CreateNewTemplateForm NewCreateNewTemplateForm = new CreateNewTemplateForm();
                    NewCreateNewTemplateForm.ShowDialog();
                }
            }
            else
            {
                //continue
            }
            //is there text in the field?
            if (string.IsNullOrWhiteSpace(header))
            {
                if (MessageBox.Show("One or more fields contain no text, you must go back.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Stop) == DialogResult.OK)
                {
                    ;
                }
                {
                    //what do do when button pressed
                    this.Hide();
                    CreateNewTemplateForm NewCreateNewTemplateForm = new CreateNewTemplateForm();
                    NewCreateNewTemplateForm.ShowDialog();
                }
            }
            else
            {
                //continue
            }
            //is there text in the field?
            if (string.IsNullOrWhiteSpace(footer))
            {
                if (MessageBox.Show("One or more fields contain no text, you must go back.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Stop) == DialogResult.OK)
                {
                    ;
                }
                {
                    //what do do when button pressed
                    this.Hide();
                    CreateNewTemplateForm NewCreateNewTemplateForm = new CreateNewTemplateForm();
                    NewCreateNewTemplateForm.ShowDialog();
                }
            }
            else
            {
                //continue
            }

            //Using contructors from Generic template to store user input;
            newGenericTemplate.GetTemplateTitle(title);
            newGenericTemplate.GetHeader(header);
            newGenericTemplate.GetFooter(footer);


            //Creates AddOptionset Template and displays it
            AddOptionSet Optionset1 = new AddOptionSet();

            Optionset1.ShowDialog();
        }