added SQL Server name (and if it’s local) and the current database name

fine-tuned our PROMS version string
fixed NULL reference with changing a section number/title on a property page that uses StepRTB
This commit is contained in:
2012-04-13 14:42:53 +00:00
parent 4b68ddca70
commit 84185d3a45
4 changed files with 53 additions and 12 deletions

View File

@@ -5,6 +5,8 @@ using System.Drawing;
using System.Windows.Forms;
using System.Reflection;
using Volian.Controls.Library;
using VEPROMS.CSLA.Library;
using System.Text.RegularExpressions;
namespace VEPROMS
{
@@ -18,7 +20,13 @@ namespace VEPROMS
// Change assembly information settings for your application through either:
// - Project->Properties->Application->Assembly Information
// - AssemblyInfo.cs
//"Data Source=.\\SQLEXPRESS;Initial Catalog=VEPROMS_RGE_SAMG_Convert;Integrated Security=True"
DateTime buildDateTime = new System.IO.FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
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.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
@@ -28,6 +36,8 @@ namespace VEPROMS
// this.textBoxDescription.Text = AssemblyDescription;
this.labelCompanyName.Links[0].LinkData = "Volian Enterprises Inc.";
this.labelCompanyName.Links.Add(0,23,"www.volian.com");
this.labelServer.Text = string.Format("SQL Server: {0}", server);
this.labelDatabase.Text = string.Format("Database: {0}", databaseName);
}
#region Assembly Attribute Accessors