C2018-015 made fields to get SQL server name and database name static for use in generating the baseline meta file.
This commit is contained in:
parent
30b837e6b1
commit
b5787b153c
@ -13,6 +13,36 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
partial class AboutVEPROMS : DevComponents.DotNetBar.Office2007Form //Form
|
partial class AboutVEPROMS : DevComponents.DotNetBar.Office2007Form //Form
|
||||||
{
|
{
|
||||||
|
private static string _SQLServerName = null;
|
||||||
|
|
||||||
|
public static string SQLServerName // C2018-015 made this information static so we can use in meta files
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_SQLServerName == null)
|
||||||
|
{
|
||||||
|
string connectionString = Database.VEPROMS_Connection;
|
||||||
|
Match mServer = Regex.Match(connectionString, ".*Data Source=([^;]*).*");
|
||||||
|
_SQLServerName = (mServer.Success) ? mServer.Groups[1].Value : "unknown";
|
||||||
|
if (_SQLServerName.StartsWith(@".\")) _SQLServerName = @"Local \ " + _SQLServerName.Substring(2);
|
||||||
|
}
|
||||||
|
return _SQLServerName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private static string _DatabaseName = null;
|
||||||
|
|
||||||
|
public static string DatabaseName // C2018-015 made this information static so we can use in meta files
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_DatabaseName == null)
|
||||||
|
{
|
||||||
|
_DatabaseName = string.Format("{0}[SQL:{1:yyMM.ddHH}]", Database.ActiveDatabase, Database.RevDate);
|
||||||
|
}
|
||||||
|
return _DatabaseName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public AboutVEPROMS()
|
public AboutVEPROMS()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -25,11 +55,12 @@ namespace VEPROMS
|
|||||||
DateTime buildDateTime = new System.IO.FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
|
DateTime buildDateTime = new System.IO.FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
|
||||||
// If the AssemblyConfiguration is "DEMO" then we are running a Demo version
|
// If the AssemblyConfiguration is "DEMO" then we are running a Demo version
|
||||||
string demoTxt = VlnSettings.DemoMode ? "(Demo)": VlnSettings.DebugMode ? "(Debug)" : "(Production)";
|
string demoTxt = VlnSettings.DemoMode ? "(Demo)": VlnSettings.DebugMode ? "(Debug)" : "(Production)";
|
||||||
string connectionString = Database.VEPROMS_Connection;
|
// C2018-015 made this information static so we can use in meta files
|
||||||
Match mServer = Regex.Match(connectionString,".*Data Source=([^;]*).*");
|
//string connectionString = Database.VEPROMS_Connection;
|
||||||
string server = (mServer.Success)?mServer.Groups[1].Value:"unknown";
|
//Match mServer = Regex.Match(connectionString,".*Data Source=([^;]*).*");
|
||||||
if (server.StartsWith(@".\")) server = @"Local \ " + server.Substring(2);
|
//string server = (mServer.Success)?mServer.Groups[1].Value:"unknown";
|
||||||
string databaseName = string.Format("{0}[SQL:{1:yyMM.ddHH}]", Database.ActiveDatabase, Database.RevDate);
|
//if (server.StartsWith(@".\")) server = @"Local \ " + server.Substring(2);
|
||||||
|
//string databaseName = string.Format("{0}[SQL:{1:yyMM.ddHH}]", Database.ActiveDatabase, Database.RevDate);
|
||||||
this.Text = String.Format("About {0}", AssemblyTitle + " " + demoTxt);
|
this.Text = String.Format("About {0}", AssemblyTitle + " " + demoTxt);
|
||||||
this.labelProductName.Text = AssemblyProduct;
|
this.labelProductName.Text = AssemblyProduct;
|
||||||
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
|
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
|
||||||
@ -39,9 +70,11 @@ namespace VEPROMS
|
|||||||
// this.textBoxDescription.Text = AssemblyDescription;
|
// this.textBoxDescription.Text = AssemblyDescription;
|
||||||
this.labelCompanyName.Links[0].LinkData = "Volian Enterprises Inc.";
|
this.labelCompanyName.Links[0].LinkData = "Volian Enterprises Inc.";
|
||||||
this.labelCompanyName.Links.Add(0,23,"www.volian.com");
|
this.labelCompanyName.Links.Add(0,23,"www.volian.com");
|
||||||
this.labelServer.Text = string.Format("SQL Server: {0}", server);
|
//this.labelServer.Text = string.Format("SQL Server: {0}", server);
|
||||||
|
this.labelServer.Text = string.Format("SQL Server: {0}", SQLServerName); // C2018-015 use static for this info.
|
||||||
//if (databaseName == null) databaseName = Regex.Replace(connectionString, "^.*Initial Catalog=([^;]*);.*$", "$1", RegexOptions.IgnoreCase);
|
//if (databaseName == null) databaseName = Regex.Replace(connectionString, "^.*Initial Catalog=([^;]*);.*$", "$1", RegexOptions.IgnoreCase);
|
||||||
this.labelDatabase.Text = string.Format("Database: {0}", databaseName);
|
//this.labelDatabase.Text = string.Format("Database: {0}", databaseName);
|
||||||
|
this.labelDatabase.Text = string.Format("Database: {0}", DatabaseName); // C2018-015 use static for this info.
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Assembly Attribute Accessors
|
#region Assembly Attribute Accessors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user