C2018-033 added enum lists for the date/time formats to use for a PDF prefix or suffix
C2018-033 added logic to save selected prefix and suffix date/time format to the config
This commit is contained in:
@@ -935,6 +935,84 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
// C2018-033 the Prefix date/time format is in the config
|
||||
[Category("Print Settings")]
|
||||
[DisplayName("PDFdtFilePrefix")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
[Description("PDF File Date Time Prefix")]
|
||||
public PDFDTPrefix Print_PDFdtFilePrefix
|
||||
{
|
||||
get
|
||||
{
|
||||
string s = _Xp["PrintSettings", "PDFdtFilePrefix"];
|
||||
|
||||
//If there is no value to get, then get the parent value (a.k.a. default value).
|
||||
if (s == string.Empty)
|
||||
s = _Xp.ParentValue("PrintSettings", "PDFdtFilePrefix"); // get the parent value
|
||||
// If there is no parent value, then use the volian default
|
||||
if (s == string.Empty)
|
||||
return PDFDTPrefix.None;// default to volian default
|
||||
|
||||
return (PDFDTPrefix)int.Parse(s);
|
||||
}
|
||||
set
|
||||
{
|
||||
// if value being saved is same as the parent value, then clear the value (save blank). This will
|
||||
// reset the data to use the parent value.
|
||||
|
||||
string parval = _Xp.ParentValue("PrintSettings", "PDFdtFilePrefix"); // get the parent value
|
||||
|
||||
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
|
||||
parval = ((int)(PDFDTPrefix.None)).ToString();
|
||||
|
||||
if (parval.Equals(((int)value).ToString()))
|
||||
_Xp["PrintSettings", "PDFdtFilePrefix"] = string.Empty; // reset to parent value
|
||||
else
|
||||
_Xp["PrintSettings", "PDFdtFilePrefix"] = ((int)value).ToString(); // save selected value
|
||||
|
||||
OnPropertyChanged("Print_PDFdtFilePrefix");
|
||||
}
|
||||
}
|
||||
|
||||
// C2018-033 the Suffix date/time format is in the config
|
||||
[Category("Print Settings")]
|
||||
[DisplayName("PDFdtFileSuffix")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
[Description("PDF File Date Time Suffix")]
|
||||
public PDFDTSuffix Print_PDFdtFileSuffix
|
||||
{
|
||||
get
|
||||
{
|
||||
string s = _Xp["PrintSettings", "PDFdtFileSuffix"];
|
||||
|
||||
//If there is no value to get, then get the parent value (a.k.a. default value).
|
||||
if (s == string.Empty)
|
||||
s = _Xp.ParentValue("PrintSettings", "PDFdtFileSuffix"); // get the parent value
|
||||
// If there is no parent value, then use the volian default
|
||||
if (s == string.Empty)
|
||||
return PDFDTSuffix.None;// default to volian default
|
||||
|
||||
return (PDFDTSuffix)int.Parse(s);
|
||||
}
|
||||
set
|
||||
{
|
||||
// if value being saved is same as the parent value, then clear the value (save blank). This will
|
||||
// reset the data to use the parent value.
|
||||
|
||||
string parval = _Xp.ParentValue("PrintSettings", "PDFdtFileSuffix"); // get the parent value
|
||||
|
||||
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
|
||||
parval = ((int)(PDFDTSuffix.None)).ToString();
|
||||
|
||||
if (parval.Equals(((int)value).ToString()))
|
||||
_Xp["PrintSettings", "PDFdtFileSuffix"] = string.Empty; // reset to parent value
|
||||
else
|
||||
_Xp["PrintSettings", "PDFdtFileSuffix"] = ((int)value).ToString(); // save selected value
|
||||
|
||||
OnPropertyChanged("Print_PDFdtFileSuffix");
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Print Settings")]
|
||||
[DisplayName("AlwaysOverwritePDF")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
|
Reference in New Issue
Block a user