C2022-030 display message when PROMSFixes is not up to date

C2022030 function to read RevDate from PROMSFixes file located in exe folder
This commit is contained in:
2022-11-01 15:40:44 +00:00
parent 20b645a378
commit 2f4b33b621
2 changed files with 74 additions and 9 deletions

View File

@@ -9,6 +9,7 @@ using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Configuration;
using System.Reflection;
using VEPROMS.CSLA.Library;
//using Csla;
using DevComponents;
@@ -397,6 +398,27 @@ namespace VEPROMS
_MyLog.InfoFormat("\r\nSession Beginning\r\n<===={0}[SQL:{1:yyMM.ddHH}]====== User: {2}/{3} Started {4} ===============>{5}"
, Application.ProductVersion, Database.RevDate, Environment.UserDomainName, Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt"), FormatInfo.Failed ?? "");
// C2022-030 Notify the user if the stored procedure in the database are not update to date
// with those in the PROMSFixes.sql delivered with the PROMS executable
string pfVersion = ExeInfo.GetAssocicatedPROMSFixesVersion();
string dbpfVersion = string.Format("{0:yyMM.ddHH}", Database.RevDate);
// if pfVersion is null, that means there was a problem finding or reading the PROMSFixes.SQL file in the executable folder
if (pfVersion != null && !pfVersion.Equals(dbpfVersion))
{
_MyLog.WarnFormat("PROMSFixes Version - in Data Version is {0} PROMS is Expecting Version {1}", dbpfVersion, pfVersion);
StringBuilder sbMsg = new StringBuilder();
//sbMsg.Append("The SQL Stored Procedures in the Database are a different version than what PROMS is expecting.");
sbMsg.Append("The SQL Stored Procedures version in the database is different than what PROMS is expecting.");
sbMsg.Append("\nPROMS may not run properly until the lastest SQL Stored Procedures are installed.");
sbMsg.AppendFormat("\n\n The database has SQL Stored Procedures version: {0}", dbpfVersion);
sbMsg.AppendFormat("\n PROMS is expecting SQL Stored Procedures version: {0}", pfVersion);
sbMsg.Append("\n\nPlease have your DBA update the database with the PROMSFixes.sql script file that was\ndelivered with this PROMS executable.");
sbMsg.Append("\n\nThe PROMSFixes.sql file is included with the PROMS installation download.");
sbMsg.Append("\n\nIt can also be found in your PROMS executable folder:");
sbMsg.AppendFormat("\n\t{0}",ExeInfo.PROMSExecutableFolderPath());
FlexibleMessageBox.Show(sbMsg.ToString(),"SQL Stored Procedures Version Difference");
}
foreach (string parameter in parameters)
{
if (parameter.ToUpper().StartsWith("/UF="))