C2018-039: Upgrade – User Control of Format

This commit is contained in:
2018-12-12 15:25:53 +00:00
parent dcefdc8754
commit e2392f5fec
20 changed files with 5491 additions and 1203 deletions

View File

@@ -113,6 +113,26 @@ namespace VEPROMS
private void btnVersionsPropOK_Click(object sender, EventArgs e)
{
docVersionConfigBindingSource.EndEdit(); // need to end the edit session first or any format selection chanage will not stick B2015-157
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
if (_DocVersionConfig.MyDocVersion.FormatID != _cmbxformatOriginal)
{
// clean up & then refresh the configs
string strdv = _DocVersionConfig.MyDocVersion.VersionID.ToString();
using (ContentInfoList cil = ContentInfoList.ClearOverrideFormatsByDocVersion(strdv, _cmbxformatOriginal, _DocVersionConfig.MyDocVersion.FormatID))
{
foreach (ContentInfo ci in cil)
{
using (Content c = ci.Get())
{
// first refresh configs because the ContentInfo.Refresh causes events to occur that refresh screen
// and if configs aren't done first, the screen refresh, if based on config data, will not be correct.
foreach (ItemInfo ii in ci.ContentItems) ii.RefreshConfig();
ContentInfo.Refresh(c);
}
}
}
}
if (_DocVersionConfig.Unit_Count > 0 || (_Apples != null && _Apples.Count > 0))
{
if (_DeletedApples != null && _DeletedApples.Count > 0)
@@ -315,7 +335,7 @@ namespace VEPROMS
_DocVersionConfig.ParentLookup = false;
}
private int? _cmbxformatOriginal = null;
private void frmVersionsProperties_Load(object sender, EventArgs e)
{
_Initializing = true;
@@ -328,6 +348,7 @@ namespace VEPROMS
ppCmbxFormat.DisplayMember = "FullName";
ppCmbxFormat.ValueMember = "FullName";
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
_cmbxformatOriginal = _DocVersionConfig.MyDocVersion.FormatID;
if (_DocVersionConfig.FormatSelection != null)
{
ppCmbxFormat.SelectedValue = _DocVersionConfig.FormatSelection;