B2025-010 PROMS – Change ID Issues

Removing the change id via backspaces in the change id box in the step properties panel can cause PROMS to crash. Also, it doesn’t always remove the change id properly. Changing this to instead of updating every time text changes in the box, adding a save button. Also, adding some null exception error handling.
This commit is contained in:
Matthew Schill 2025-01-27 16:09:19 -05:00
parent e893264075
commit 5e43a8501b
3 changed files with 839 additions and 823 deletions

View File

@ -105,7 +105,7 @@ namespace VEPROMS.CSLA.Library
if (tmp._MyContent != null)
{
ContentInfo.Refresh(tmp._MyContent);
if (tmp._MyContent.MyImage != null) ImageInfo.Refresh(tmp._MyContent.MyImage);
if (tmp._MyContent?.MyImage != null) ImageInfo.Refresh(tmp._MyContent.MyImage);
}
ItemInfo.Refresh(tmp);
}

File diff suppressed because it is too large Load Diff

View File

@ -142,6 +142,7 @@ namespace Volian.Controls.Library
tbChgID.Text = "";
tbChgID.Enabled = false;
lblChgId.Visible = tbChgID.Visible = false;
btnSaveChangeID.Enabled = btnSaveChangeID.Visible = false;
CurItemInfo = null;
cbInitialLine.Visible = cbInitialLine.Enabled = false;
@ -521,9 +522,10 @@ namespace Volian.Controls.Library
tbChgID.Text = sc1.Step_ChangeID;
tbChgID.Enabled = true;
lblChgId.Visible = tbChgID.Visible = true;
btnSaveChangeID.Enabled = btnSaveChangeID.Visible = true;
}
else
lblChgId.Visible = tbChgID.Visible = false;
lblChgId.Visible = tbChgID.Visible = btnSaveChangeID.Enabled = btnSaveChangeID.Visible = false;
// Walk up tree until this step type's parentType is "Base". Start adding menuitems from this step type.
StepData top = fmtdata.StepDataList[formatSteptype];
@ -903,18 +905,6 @@ namespace Volian.Controls.Library
}
#endregion
private void tbChgID_TextChanged(object sender, EventArgs e)
{
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
// if the changeID changed, then reset the change bar override
// B2021-029: don't change changeid if the config & text box are both empty
if (sc.Step_ChangeID != tbChgID.Text && sc.Step_ChangeID != null && tbChgID.Text != "")
{
sc.Step_ChangeID = tbChgID.Text;
sc.Step_CBOverride = null;
}
}
#region WCNTRN format
// The following supports the Wolf Creek Training format/Responsibility data
// off of the High Level Step
@ -1037,25 +1027,41 @@ namespace Volian.Controls.Library
}
//private void txbxAltConActSumText_Leave(object sender, EventArgs e)
//{
// // User left Atlernate Continuous Action Text field. If text changed, then prompt
// // to see if save should occur.
// StepConfig sc = CurItemInfo.MyConfig as StepConfig;
// if (sc == null) return;
// bool bothEmpty = (sc.Step_AlternateContActSumText == null || sc.Step_AlternateContActSumText == "") && (txbxAltConActSumText.Text == null || txbxAltConActSumText.Text == "");
// if (!bothEmpty && sc.Step_AlternateContActSumText != txbxAltConActSumText.Text)
// {
// if (MessageBox.Show(this, "Do you want to save the Alternate Continuous Action Text?", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
// {
// MyEditItem.SaveContents();
// sc.Step_AlternateContActSumText = txbxAltConActSumText.Text; // this actually saves the config
// }
// else
// txbxAltConActSumText.Text = sc.Step_AlternateContActSumText;
// }
//B2025-010 PROMS -Fixed issues updating Changeid
// Changed to a Save button instead of onTextChanged
// Also was issue where sometimes would lave last character / digit (not allowing the change id to be completely removed)
private void btnSaveChangeID_Click(object sender, EventArgs e)
{
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
// if the changeID changed, then reset the change bar override
// B2021-029: don't change changeid if the config & text box are both empty
if (sc.Step_ChangeID != tbChgID.Text && (!string.IsNullOrEmpty(sc.Step_ChangeID) || !string.IsNullOrEmpty(tbChgID.Text)))
{
sc.Step_ChangeID = tbChgID.Text;
sc.Step_CBOverride = null;
}
}
//}
//private void txbxAltConActSumText_Leave(object sender, EventArgs e)
//{
// // User left Atlernate Continuous Action Text field. If text changed, then prompt
// // to see if save should occur.
// StepConfig sc = CurItemInfo.MyConfig as StepConfig;
// if (sc == null) return;
// bool bothEmpty = (sc.Step_AlternateContActSumText == null || sc.Step_AlternateContActSumText == "") && (txbxAltConActSumText.Text == null || txbxAltConActSumText.Text == "");
// if (!bothEmpty && sc.Step_AlternateContActSumText != txbxAltConActSumText.Text)
// {
// if (MessageBox.Show(this, "Do you want to save the Alternate Continuous Action Text?", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
// {
// MyEditItem.SaveContents();
// sc.Step_AlternateContActSumText = txbxAltConActSumText.Text; // this actually saves the config
// }
// else
// txbxAltConActSumText.Text = sc.Step_AlternateContActSumText;
// }
}
//}
}
}