C2019-042 Added a check box to identify a section as being a foldout – used in with printing in duplex

C2019-042 use new format config setting to check if sections are foldouts
C2019-042 use new format config setting to check if sections are foldout
B2019-134 code cleanup, discovered we were missing a “break;” statement in processing folder specific information
This commit is contained in:
2019-11-06 20:50:29 +00:00
parent e8cac09909
commit cfb847de9c
10 changed files with 294 additions and 198 deletions

View File

@@ -564,6 +564,9 @@ namespace VEPROMS
// for word docs, no enhanced controls should be visible:
grpLnkEnh.Visible = false;
}
//C2019-042 a section cannot be a foldout section and the default step section
cbIsFoldoutSection.Checked = _SectionConfig.Section_IsFoldout == "Y";
cbIsFoldoutSection.Enabled = !_isDefaultStepSection;
_Initializing = false;
//_InitialIndex = ppCmbxFormat.SelectedIndex;
}
@@ -1279,29 +1282,44 @@ namespace VEPROMS
// The bug was on changing a transition type that included a section header - but the section header was not included
// in the transition text if it was a default:
int cntDefaultSect = 0;
string defSectDesc = "";
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections)
{
SectionConfig sc = si.MyConfig as SectionConfig;
if (sc != null && sc.Section_OriginalSteps == "Y") cntDefaultSect++;
if (sc != null && sc.Section_OriginalSteps == "Y")
{
cntDefaultSect++;
if (cntDefaultSect == 1) defSectDesc = string.Format("{0} {1}", sc.Number, sc.Title).Trim(); // get default section name - used in Warning message if another section is checked to be default
}
}
if (!ppCbDefaultStepSection.Checked && cntDefaultSect==1)
if (!ppCbDefaultStepSection.Checked) //user un-checked the default section box
{
// If user unchecks this section, i.e. wants to clear it from being 'Default Step Section'
// just tell user that only 1 section can be the default step section.
// The way this is supported in code is to only allow the user to check
// the checkbox if it is not already set. This is the way the code supported only
// allowing 1 section to have this flag.
MessageBox.Show("Only one section can be set as the 'Default Step Section'. To make another section the 'Default Step Section', select the checkbox on the Properties of that section.", "WARNING");
ppCbDefaultStepSection.Checked = true;
if (cntDefaultSect == 1)
{
// If user unchecks this section, i.e. wants to clear it from being 'Default Step Section'
// remind user that one section Must be the default step section.
MessageBox.Show("One section MUST be set as the 'Default Step Section'.\n\nTo make another section the 'Default Step Section',\n select the checkbox on the Properties of that section.", "WARNING");
//ppCbDefaultStepSection.Checked = true;
}
}
else
else // user checked the default section box
{
// Note that this just sets the config item - it does not save it. Save is
// done when the 'OK' button is clicked. At that time, if this section's
// Section_OriginalSteps is set, then all other sections will need to have this
// property cleared (Only 1 section can be the OriginalStep section.
_SectionConfig.Section_OriginalSteps = ppCbDefaultStepSection.Checked ? "Y" : "N";
if (cntDefaultSect != 0)
{
// Note that this just sets the config item - it does not save it. Save is
// done when the 'OK' button is clicked. At that time, if this section's
// Section_OriginalSteps is set, then all other sections will need to have this
// property cleared (Only 1 section can be the OriginalStep section.
string msg = string.Format("Only one section can be set as the 'Default Step Section'.\n\nYou need to un-select \"{0}\" as the default section before selecting this one.", defSectDesc);
MessageBox.Show(msg, "WARNING");
_Initializing = true;
ppCbDefaultStepSection.Checked = false; // reset the check box back to unchecked
_Initializing = false;
}
}
//C2019-042 a section cannot be a foldout section and the default step section
cbIsFoldoutSection.Enabled = !ppCbDefaultStepSection.Checked; // disable the foldout checkbox if this is the default step section
_SectionConfig.Section_OriginalSteps = ppCbDefaultStepSection.Checked ? "Y" : "N";
}
}
private void ppBtnConvertToDocX_Click(object sender, EventArgs e)
@@ -1357,6 +1375,14 @@ namespace VEPROMS
}
}
//C2019-042 added check box to identify a Foldout Section
private void cbIsFoldoutSection_CheckedChanged(object sender, EventArgs e)
{
// don't allow a foldout section be the default step section
ppCbDefaultStepSection.Enabled = !cbIsFoldoutSection.Checked;
_SectionConfig.Section_IsFoldout = (cbIsFoldoutSection.Checked) ? "Y" : "N";
}
//private void ppBtnDefaultPrintSize_Click(object sender, EventArgs e)
//{
// // Get the parent setting