diff --git a/PROMS/VEPROMS User Interface/AboutVEPROMS.cs b/PROMS/VEPROMS User Interface/AboutVEPROMS.cs index 7d426b6c..a96278f3 100644 --- a/PROMS/VEPROMS User Interface/AboutVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/AboutVEPROMS.cs @@ -7,6 +7,7 @@ using System.Reflection; using Volian.Controls.Library; using VEPROMS.CSLA.Library; using System.Text.RegularExpressions; +using Volian.Base.Library; namespace VEPROMS { @@ -22,14 +23,16 @@ namespace VEPROMS // - AssemblyInfo.cs //"Data Source=.\\SQLEXPRESS;Initial Catalog=VEPROMS_RGE_SAMG_Convert;Integrated Security=True" DateTime buildDateTime = new System.IO.FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime; + // If the AssemblyConfiguration is "DEMO" then we are running a Demo version + string demoTxt = VlnSettings.ReleaseMode.Equals("DEMO")?"(Demo)": ""; string connectionString = Database.VEPROMS_Connection; Match mServer = Regex.Match(connectionString,".*Data Source=([^;]*).*"); string server = (mServer.Success)?mServer.Groups[1].Value:"unknown"; if (server.StartsWith(@".\")) server = @"Local \ " + server.Substring(2); string databaseName = Database.SelectedDatabase; - this.Text = String.Format("About {0}", AssemblyTitle); + this.Text = String.Format("About {0}", AssemblyTitle + " " + demoTxt); this.labelProductName.Text = AssemblyProduct; - this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); + this.labelVersion.Text = String.Format("Version {0}", (demoTxt.Equals(""))? AssemblyVersion : demoTxt); this.labelVersionDateTime.Text = String.Format("Build Date: {0}", buildDateTime.ToString()); this.labelCopyright.Text = AssemblyCopyright; this.labelCompanyName.Text = AssemblyCompany; @@ -146,7 +149,8 @@ namespace VEPROMS private void btnViewEULA_Click(object sender, EventArgs e) { - string strEULA = System.Environment.CurrentDirectory + "\\EULA.TXT"; + string EulaFile = string.Format(@"\{0}", VlnSettings.EULAfile); + string strEULA = System.Environment.CurrentDirectory + EulaFile; frmViewTextFile ViewFile = new frmViewTextFile(strEULA,RichTextBoxStreamType.PlainText); ViewFile.Text = "End-User License Agreement"; ViewFile.ShowDialog(); diff --git a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs index ee48fd6a..2d6100ad 100644 --- a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs +++ b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs @@ -7,6 +7,7 @@ using System.Text; using System.Windows.Forms; using Volian.Print.Library; using VEPROMS.CSLA.Library; +using Volian.Base.Library; namespace VEPROMS { @@ -45,7 +46,9 @@ namespace VEPROMS { OpenPDF = openPDF; InitializeComponent(); - MyPromsPrinter = new PromsPrinter(myItem, rev, revDate, watermark, debugOutput, origPgBrk, pdfPath + @"\\Compare", false, overWrite, cbd, pdfFile);//openPDF); + // if the version number of PROMS is 1.0, then we are running a Demo version. + // When running a Demo version, force a "Sample" watermark when printing. + MyPromsPrinter = new PromsPrinter(myItem, rev, revDate, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\\Compare", false, overWrite, cbd, pdfFile);//openPDF); PDFPath = pdfPath; this.Text = "Creating PDF of " + myItem.DisplayNumber; _NewLocation = newLocation; diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index dfef303d..b5b4217d 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -463,7 +463,8 @@ namespace VEPROMS } private DialogResult ShowEULA() { - string strEULA = System.Environment.CurrentDirectory + "\\EULA.TXT"; + string eulaFile = string.Format(@"\{0}", VlnSettings.EULAfile); + string strEULA = System.Environment.CurrentDirectory + eulaFile; frmViewTextFile ViewFile = new frmViewTextFile(strEULA, RichTextBoxStreamType.PlainText); ViewFile.Text = "End-User License Agreement"; ViewFile.ButtonText = "Agree"; diff --git a/PROMS/Volian.Base.Library/VlnSettings.cs b/PROMS/Volian.Base.Library/VlnSettings.cs index 534e4727..d56034c2 100644 --- a/PROMS/Volian.Base.Library/VlnSettings.cs +++ b/PROMS/Volian.Base.Library/VlnSettings.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text; using System.IO; using System.Configuration; +using System.Reflection; namespace Volian.Base.Library { @@ -114,5 +115,45 @@ namespace Volian.Base.Library get { return VlnSettings._StepTypeToolTip; } set { VlnSettings._StepTypeToolTip = value; } } + private static string _ReleaseMode = null; + public static string ReleaseMode + { + get + { + if (_ReleaseMode == null) + { + string relType = "RELEASE"; // default to normal Release Mode setting + // Get the type of release: + // "Demo", "Westinghouse", "Release" + object[] attributes = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyConfigurationAttribute), false); + if (attributes.Length > 0) + relType = ((AssemblyConfigurationAttribute)attributes[0]).Configuration.ToUpper(); + _ReleaseMode = relType; + } + return _ReleaseMode; + } + } + private static string _EULAfile = null; + public static string EULAfile + { + get { + if (_EULAfile == null) + { + switch (ReleaseMode) + { + case "DEMO": // Demo CD/DVD release + _EULAfile = "DemoEULA.txt"; + break; + case "WESTINGHOUSE": + _EULAfile = "WestinghouseEULA.txt"; + break; + default: + _EULAfile = "EULA.txt"; + break; + } + } + return _EULAfile; + } + } } } diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index 591b4b07..5f851dff 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -740,6 +740,11 @@ namespace Volian.Controls.Library private void lbROId_DoubleClick(object sender, EventArgs e) { if (tvROFST.SelectedNode == null) return; + if (VlnSettings.ReleaseMode.Equals("DEMO")) + { + MessageBox.Show("Referenced Object Editor not available in the Demo version.", "PROMS Demo Version"); + return; + } string roapp = Environment.GetEnvironmentVariable("roapp"); Object obj = tvROFST.SelectedNode.Tag; if (obj is ROFSTLookup.rochild) @@ -769,6 +774,11 @@ namespace Volian.Controls.Library private void RunRoEditor() { + if (VlnSettings.ReleaseMode.Equals("DEMO")) + { + MessageBox.Show("Referenced Object Editor not available in the Demo version.", "PROMS Demo Version"); + return; + } string roapp = Environment.GetEnvironmentVariable("roapp"); Object obj = tvROFST.SelectedNode.Tag; if (obj is ROFSTLookup.rochild) diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index d6951ed0..b5741371 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -9,6 +9,7 @@ using System.IO; using System.Text.RegularExpressions; using VEPROMS.CSLA.Library; using Accentra.Controls; +using Volian.Base.Library; namespace Volian.Controls.Library { @@ -1240,6 +1241,11 @@ namespace Volian.Controls.Library } else { + if (VlnSettings.ReleaseMode.Equals("DEMO")) + { + MessageBox.Show("Referenced Object Editor not available in the Demo version.", "PROMS Demo Version"); + return; + } string myROID; RODbInfo myRODB; if (MyFlexGrid != null && MyFlexGrid.IsRoTable) @@ -1326,6 +1332,11 @@ namespace Volian.Controls.Library private void btnROEdit_Click(object sender, EventArgs e) { + if (VlnSettings.ReleaseMode.Equals("DEMO")) + { + MessageBox.Show("Referenced Object Editor not available in the Demo version.", "PROMS Demo Version"); + return; + } string roapp = Environment.GetEnvironmentVariable("roapp"); if (roapp == null) {