Changes for Xylem Nanjing, ver. 3.1.1676
This commit is contained in:
@@ -3,15 +3,16 @@
|
||||
///
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using MySql.Data.MySqlClient;
|
||||
using NHibernate;
|
||||
using Common;
|
||||
using Results;
|
||||
using Results.Entities;
|
||||
using TBF.Resources;
|
||||
using System.Text;
|
||||
|
||||
namespace TBF.UI.Settings
|
||||
{
|
||||
@@ -116,7 +117,7 @@ namespace TBF.UI.Settings
|
||||
|
||||
try
|
||||
{
|
||||
session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
|
||||
session = Config.FluentCommon.CreateSession(DBKind.Config);
|
||||
|
||||
var testParams = session.QueryOver<Config.Entities.ComponentTest>()
|
||||
.Where(x => (x.CmpntName == errorFlagsCmpntName))
|
||||
@@ -176,7 +177,7 @@ namespace TBF.UI.Settings
|
||||
|
||||
ActivityStart();
|
||||
|
||||
if (!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), commands))
|
||||
if (!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString), commands))
|
||||
{
|
||||
ActivityEnd();
|
||||
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
@@ -226,7 +227,7 @@ namespace TBF.UI.Settings
|
||||
|
||||
ActivityStart();
|
||||
|
||||
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
|
||||
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
|
||||
(!upgradeResultsDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(DB.ConnectionString), resultsDbCommands)))
|
||||
{
|
||||
ActivityEnd();
|
||||
@@ -285,12 +286,12 @@ namespace TBF.UI.Settings
|
||||
|
||||
ActivityStart();
|
||||
|
||||
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
|
||||
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
|
||||
(!upgradeResultsDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(DB.ConnectionString), resultsDbCommands)))
|
||||
{
|
||||
if (upgradeConfigDBCheckBox.Checked)
|
||||
{
|
||||
MySqlConnection dbConn = new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
|
||||
MySqlConnection dbConn = new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
|
||||
try
|
||||
{
|
||||
dbConn.Open();
|
||||
@@ -409,12 +410,12 @@ namespace TBF.UI.Settings
|
||||
|
||||
ActivityStart();
|
||||
|
||||
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
|
||||
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
|
||||
(!upgradeResultsDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(DB.ConnectionString), resultsDbCommands)))
|
||||
{
|
||||
if (upgradeConfigDBCheckBox.Checked)
|
||||
{
|
||||
MySqlConnection dbConn = new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
|
||||
MySqlConnection dbConn = new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
|
||||
try
|
||||
{
|
||||
dbConn.Open();
|
||||
@@ -614,7 +615,7 @@ namespace TBF.UI.Settings
|
||||
|
||||
ActivityStart();
|
||||
|
||||
if (!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), commands))
|
||||
if (!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString), commands))
|
||||
{
|
||||
ActivityEnd();
|
||||
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
@@ -785,7 +786,7 @@ namespace TBF.UI.Settings
|
||||
|
||||
if (upgradeConfigDBCheckBox.Checked)
|
||||
{
|
||||
success = success && ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands);
|
||||
success = success && ExecuteCommands(new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands);
|
||||
|
||||
if (!string.IsNullOrEmpty(errorFlagsComponentsTextBox.Text))
|
||||
{
|
||||
@@ -824,7 +825,7 @@ namespace TBF.UI.Settings
|
||||
|
||||
try
|
||||
{
|
||||
dbConn = new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
|
||||
dbConn = new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
|
||||
dbConn.Open();
|
||||
|
||||
cmd = dbConn.CreateCommand();
|
||||
@@ -839,7 +840,7 @@ namespace TBF.UI.Settings
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Dispose();
|
||||
|
||||
int[] groupIdsToKeep = new int[(int)Users.Entities.GID.NrOfGroups];
|
||||
int[] groupIdsToKeep = new int[(int)Common.GID.NrOfGroups];
|
||||
IList<GroupTableRow> groupTable = new List<GroupTableRow>();
|
||||
|
||||
cmd = dbConn.CreateCommand();
|
||||
@@ -848,12 +849,12 @@ namespace TBF.UI.Settings
|
||||
while (dr.Read())
|
||||
{
|
||||
int groupId = dr.GetInt32(0);
|
||||
Users.Entities.GID gid = (Users.Entities.GID)dr.GetInt32(1);
|
||||
Common.GID gid = (Common.GID)dr.GetInt32(1);
|
||||
int userId = dr.GetInt32(2);
|
||||
|
||||
groupTable.Add(new GroupTableRow(groupId, gid, userId));
|
||||
|
||||
if ((gid >= 0) && (gid < Users.Entities.GID.NrOfGroups) && (groupIdsToKeep[(int)gid] == 0))
|
||||
if ((gid >= 0) && (gid < Common.GID.NrOfGroups) && (groupIdsToKeep[(int)gid] == 0))
|
||||
{
|
||||
groupIdsToKeep[(int)gid] = groupId;
|
||||
}
|
||||
@@ -965,7 +966,7 @@ namespace TBF.UI.Settings
|
||||
|
||||
ActivityStart();
|
||||
|
||||
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
|
||||
if ((!upgradeConfigDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(Common.Data.CurrentBench.ProceduresDBSettings.ConnectionString), configDbCommands)) &&
|
||||
(!upgradeResultsDBCheckBox.Checked || ExecuteCommands(new MySqlConnection(DB.ConnectionString), resultsDbCommands)))
|
||||
{
|
||||
ActivityEnd();
|
||||
@@ -1049,7 +1050,7 @@ namespace TBF.UI.Settings
|
||||
|
||||
try
|
||||
{
|
||||
var session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
|
||||
var session = Config.FluentCommon.CreateSession(DBKind.Config);
|
||||
|
||||
var components = session.QueryOver<Config.Entities.Component>()
|
||||
.List();
|
||||
|
||||
Reference in New Issue
Block a user