C2018-039: Upgrade – User Control of Format
This commit is contained in:
@@ -72,6 +72,29 @@ namespace VEPROMS
|
||||
SaveText(ppProcTitleStpRTB);
|
||||
SaveText(ppProcNumStpRTB);
|
||||
_ProcedureConfig.MyProcedure.MyProcedureInfo.CreateEnhanced = cbEnhanced.Checked;
|
||||
|
||||
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
|
||||
// To determine a change to the format, first see if selection changed in list and then see if the format selected does not match
|
||||
// what was set on procedure, if necessary resolve for an inherited format.
|
||||
|
||||
if (_ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat != null &&
|
||||
_ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat.FormatID != _cmbxformatOriginal)
|
||||
{
|
||||
// clean up & then refresh the configs
|
||||
using (ContentInfoList cil = ContentInfoList.ClearOverrideFormatsByItem(_ProcedureConfig.MyProcedure.ItemID, _cmbxformatOriginal, _ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
@@ -149,7 +172,7 @@ namespace VEPROMS
|
||||
|
||||
_ProcedureConfig.ParentLookup = false;
|
||||
}
|
||||
|
||||
private int? _cmbxformatOriginal = null;
|
||||
private void frmProcedureProperties_Load(object sender, EventArgs e)
|
||||
{
|
||||
_Initializing = true;
|
||||
@@ -161,10 +184,11 @@ namespace VEPROMS
|
||||
ppCmbxFormat.DisplayMember = "FullName";
|
||||
ppCmbxFormat.ValueMember = "FullName";
|
||||
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
|
||||
if (_ProcedureConfig.FormatSelection != null)
|
||||
ppCmbxFormat.SelectedValue = _ProcedureConfig.FormatSelection;
|
||||
else
|
||||
ppCmbxFormat.SelectedIndex = -1;
|
||||
if (_ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat != null) _cmbxformatOriginal = _ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat.FormatID;
|
||||
if (_ProcedureConfig.FormatSelection != null)
|
||||
ppCmbxFormat.SelectedValue = _ProcedureConfig.FormatSelection;
|
||||
else
|
||||
ppCmbxFormat.SelectedIndex = -1;
|
||||
|
||||
// Get the saved settings for this user
|
||||
//
|
||||
|
Reference in New Issue
Block a user