B2026-057 - Issue when ROs are out of date and swapping between sets – sometimes asked if want to update ROs twice if said no the first time. #781
@@ -2,13 +2,12 @@ using DevComponents.DotNetBar;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
@@ -92,6 +91,10 @@ namespace Volian.Controls.Library
|
||||
//This flag will be set when the docversion gets updated to let it know that the full tree needs a refresh
|
||||
private bool changedDocVersion = false;
|
||||
|
||||
//B2026-057 PROMS Crash when Closing Tabs
|
||||
// this flag will prevent multiple asking in a row if should updste ROs
|
||||
private static bool askedAboutchangedDocVersion = false;
|
||||
|
||||
public ROFstInfo MyROFST
|
||||
{
|
||||
get { return _myROFST; }
|
||||
@@ -135,6 +138,7 @@ namespace Volian.Controls.Library
|
||||
if (_docVersionInfo?.VersionID != value?.VersionID)
|
||||
{
|
||||
changedDocVersion = true;
|
||||
askedAboutchangedDocVersion = false;
|
||||
}
|
||||
|
||||
_docVersionInfo = value;
|
||||
@@ -648,9 +652,12 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
//do nothing - is still checked out
|
||||
}
|
||||
else if (changedDocVersion && MessageBox.Show($"There exists a newer ROFST for this RO database that was loaded for other sets.\r\n\r\nDo you want to update this set's ROs to be consistent/use the latest loaded ROFST?", "Load ROs", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
else if (changedDocVersion && !askedAboutchangedDocVersion)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (MessageBox.Show($"There exists a newer ROFST for this RO database that was loaded for other sets.\r\n\r\nDo you want to update this set's ROs to be consistent/use the latest loaded ROFST?", "Load ROs", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
{
|
||||
|
||||
InitialProgressBarMessage = "Updating ROs";
|
||||
|
||||
ROFstInfo roFstInfo = ROFstInfo.Get(fstid);
|
||||
@@ -664,6 +671,15 @@ namespace Volian.Controls.Library
|
||||
MyROFST = roFstInfo;
|
||||
|
||||
updatedROs = true;
|
||||
|
||||
askedAboutchangedDocVersion = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
askedAboutchangedDocVersion = true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user