Replace ‘?’ with ‘_’ for pdf filename so file can be created

Allow for setting of section’s ‘Default Step Section’ property
Fix page numbering for {secondary page} page list token
This commit is contained in:
2015-02-09 14:05:22 +00:00
parent e0cd24b61d
commit 0e9302f206
4 changed files with 260 additions and 206 deletions

View File

@@ -26,6 +26,7 @@ namespace VEPROMS
private StepTabRibbon _MyStepTabRibbon;
private bool _isStepSection = true;
private bool _hasSectionCheckoffDefault = false;
private bool _isDefaultStepSection = false;
public frmSectionProperties(SectionConfig sectionConfig)
{
@@ -117,6 +118,24 @@ namespace VEPROMS
_DocumentToDelete = null;
}
mySection.Dispose();
// if this section is now the 'DefaultStepSection', clear all others (only 1 section can have
// this property set - it is used when printing page numbers with 'WithSteps' numbering sequence.
if (!_isDefaultStepSection && ppCbDefaultStepSection.Checked)
{
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections)
{
SectionConfig sc = si.MyConfig as SectionConfig;
if (si.ItemID != _SectionConfig.MySection.ItemID && sc!=null && sc.Section_OriginalSteps == "Y")
{
using (Section ssav = si.Get())
{
ssav.SectionConfig.Section_OriginalSteps = "N";
ssav.Save();
}
}
}
}
this.DialogResult = DialogResult.OK;
this.Close();
}
@@ -356,6 +375,25 @@ namespace VEPROMS
ppCbPhoneList.Checked = _SectionConfig.Section_PhoneList == "Y";
}
// Handle Default Step Section. First, this checkbox is only visible if it is
// a step section & it is the highest level (top, right below procedures).
ppCbDefaultStepSection.Visible = false;
if (_isStepSection && _SectionConfig.MySection.MySectionInfo.MyParent.IsProcedure)
{
ppCbDefaultStepSection.Visible = true;
ppCbDefaultStepSection.Checked = _SectionConfig.Section_OriginalSteps == "Y";
// Use checkbox text to clarify what is case for this section, i.e. is it already
// the default or can it be set. Note that this is used when printing of page numbers
// that use the 'WithSteps' numbering sequence.
if (_SectionConfig.Section_OriginalSteps == "Y")
{
ppCbDefaultStepSection.Text = "This is Default Step Section";
_isDefaultStepSection = true;
}
else
ppCbDefaultStepSection.Text = "Make this the Default Step Section";
}
_Initializing = false;
}
@@ -959,6 +997,31 @@ namespace VEPROMS
_SectionConfig.Section_PhoneList = ppCbPhoneList.Checked ? "Y" : "N";
}
private void ppCbDefaultStepSection_CheckedChanged(object sender, EventArgs e)
{
if (!_Initializing)
{
if (!ppCbDefaultStepSection.Checked)
{
// 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;
}
else
{
// 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";
}
}
}
//private void ppBtnDefaultPrintSize_Click(object sender, EventArgs e)
//{
// // Get the parent setting