Update for "cancel" button action

This commit is contained in:
Kevin Laskey 2024-06-07 14:42:26 -04:00
parent 2ffab17caf
commit a2e830d0c3

View File

@ -230,9 +230,14 @@ namespace VEPROMS
var fileLocation = txtExport.Text; var fileLocation = txtExport.Text;
if (File.Exists(fileLocation)) if (File.Exists(fileLocation))
{ // C2022-029 if an existing export of the same name is found, provide option to overwrite it { // C2022-029 if an existing export of the same name is found, provide option to overwrite it
DialogResult ovewriteEx = FlexibleMessageBox.ShowCustom(null, "There is already another export file with the same name, you can either overwrite the existing file, or have the existing file renamed with it's created date appended?\r\n\r\nSelecting 'Cancel' will cancel the export.", "What would you like to do?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);// == DialogResult.Yes; DialogResult ovewriteEx = FlexibleMessageBox.ShowCustom(null, "There is already another export file with the same name, you can either overwrite the existing file, or have the existing file renamed with it's created date appended.\r\n\r\nSelecting 'Cancel' will cancel the export.", "What would you like to do?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);// == DialogResult.Yes;
if (ovewriteEx == DialogResult.Abort) btnCloseExport.Enabled = true; if (ovewriteEx == DialogResult.Abort)
{
MessageBox.Show("Export has been cancelled", "You have chosen to cancel the export.", MessageBoxButtons.OK, MessageBoxIcon.Information); // C2020-042 changed mesage box title
btnCloseExport.Enabled = true;
return;
}
else if (ovewriteEx == DialogResult.Retry) else if (ovewriteEx == DialogResult.Retry)
{ {
// Ovewrite // Ovewrite