only display ‘Create Enhanced’ checkbox on ‘new’

if copied item is not source or enhanced, pasting info a source is more like an ‘insert’ into enhanced.
This commit is contained in:
2016-01-26 11:46:00 +00:00
parent c035370bb0
commit c3a749e780
3 changed files with 31 additions and 11 deletions

View File

@@ -212,19 +212,11 @@ namespace VEPROMS
ppCmbxStpEditorCols.ValueMember = "EValue";
ppCmbxStpEditorCols.SelectedIndex = -1;
// if the associated DocVersion has Enhanced, make the Enhanced checkbox visible
// the only time the create enhanced checkbox is visisble is if this is a 'New' procedure in a set that is the 'Source'.
cbEnhanced.Visible = false;
DocVersionConfig dvc = _ProcedureConfig.MyProcedure.MyProcedureInfo.MyDocVersion.MyConfig as DocVersionConfig;
if (dvc != null && dvc.MyEnhancedDocuments != null && dvc.MyEnhancedDocuments.Count > 0)
{
if (dvc.MyEnhancedDocuments.Count > 1 || dvc.MyEnhancedDocuments[0].Type != 0)
{
cbEnhanced.Visible = true;
// if this procedure has enhanced data, the checkbox should not be editable:
cbEnhanced.Enabled = !(_ProcedureConfig.MyEnhancedDocuments != null && _ProcedureConfig.MyEnhancedDocuments.Count > 0);
cbEnhanced.Checked = (_ProcedureConfig.MyEnhancedDocuments != null && _ProcedureConfig.MyEnhancedDocuments.Count > 0);
}
}
if (_ProcedureConfig.CreatingNew && dvc != null && dvc.MyEnhancedDocuments != null && dvc.MyEnhancedDocuments.Count > 0 && dvc.MyEnhancedDocuments[0].Type != 0)
cbEnhanced.Visible = true;
_Initializing = false;
}