/[AnywhereTS-MSSQL]/trunk/TSAdminTool/Database.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/Database.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/TSAdminTool/Database.cs	2012/07/13 01:12:48	75
+++ trunk/TSAdminTool/Database.cs	2012/07/13 01:22:58	76
@@ -67,23 +67,23 @@
                 //bCreateDB = true;
                 try
                 {
-                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", Resource1.CreateDatabase.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName))))
+                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateDatabase)))
                     {
                         Logging.ATSAdminLog.Debug(string.Format("Creating Database {0}", ATSGlobals.strDatabaseName));
                         sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                         if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
-                        RunScript(Resource1.CreateDatabase.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName));
+                        RunScript(SQLServerResources.CreateDatabase);
                         //RunScript(CreateDatabaseUserScript());
                         sqlCon.Close();
                     }
                     Logging.ATSAdminLog.Debug(string.Format("Created Database {0}", ATSGlobals.strDatabaseName));
 
-                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", Resource1.CreateTables.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName))))
+                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateTables)))
                     {
                         Logging.ATSAdminLog.Debug(string.Format("Creating Tables in {0} Database", ATSGlobals.strDatabaseName));
                         sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                         if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
-                        RunScript(Resource1.CreateTables.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName));
+                        RunScript(SQLServerResources.CreateTables);
                         //sqlCon.Close();
                     }
                     Logging.ATSAdminLog.Debug(string.Format("Created Tables in {0} Database", ATSGlobals.strDatabaseName));
@@ -127,28 +127,28 @@
                             case "1.0.0.0":
                                 {   // Current database is version 1.0.0.0, update to 1.0.0.1
                                     Logging.ATSAdminLog.DebugFormat("Upgrading Database from version: {0} to version: {1}", "1.0.0.0", "1.0.0.1");
-                                    bContinue = RunScript(Resource1.UpdateDatabase1.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName));
+                                    bContinue = RunScript(SQLServerResources.UpdateDatabase1);
                                     Logging.ATSAdminLog.DebugFormat("Upgraded Database from version: {0} to version: {1}", "1.0.0.0", "1.0.0.1");
                                     goto case "1.0.0.1"; // Continue and upgrade one more step
                                 }
                             case "1.0.0.1":
                                 {   // Current database is version 1.0.0.1, update to 1.0.0.2
                                     Logging.ATSAdminLog.DebugFormat("Upgrading Database from version: {0} to version: {1}", "1.0.0.1", "1.0.0.2");
-                                    bContinue = RunScript(Resource1.UpdateDatabase2.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName));
+                                    bContinue = RunScript(SQLServerResources.UpdateDatabase2);
                                     Logging.ATSAdminLog.DebugFormat("Upgraded Database from version: {0} to version: {1}", "1.0.0.2", "1.0.0.2");
                                     goto case "1.0.0.2"; // Continue and upgrade one more step
                                 }
                             case "1.0.0.2":
                                 {   // Current database is version 1.0.0.2, update to 1.0.0.3
                                     Logging.ATSAdminLog.DebugFormat("Upgrading Database from version: {0} to version: {1}", "1.0.0.2", "1.0.0.3");
-                                    bContinue = RunScript(Resource1.UpdateDatabase3.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName));
+                                    bContinue = RunScript(SQLServerResources.UpdateDatabase3);
                                     Logging.ATSAdminLog.DebugFormat("Upgraded Database from version: {0} to version: {1}", "1.0.0.2", "1.0.0.3");
                                     goto case "1.0.0.3"; // Continue and upgrade one more step
                                 }
                             case "1.0.0.3":
                                 {   // Current database is version 1.0.0.3, update to 1.0.0.4
                                     Logging.ATSAdminLog.DebugFormat("Upgrading Database from version: {0} to version: {1}", "1.0.0.3", "1.0.0.4");
-                                    bContinue = RunScript(Resource1.UpdateDatabase4.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName));
+                                    bContinue = RunScript(SQLServerResources.UpdateDatabase4);
                                     Logging.ATSAdminLog.DebugFormat("Upgraded Database from version: {0} to version: {1}", "1.0.0.4", "1.0.0.4");
                                     break;
                                 } 
@@ -277,7 +277,7 @@
 
                 //Verify that the AnywhereTS database exists
 
-                using (log4net.NDC.Push(string.Format("SQL STATMENT={0}", "select count(*) from master..sysdatabases where name='{0}'", ATSGlobals.strDatabaseName)))
+                using (log4net.NDC.Push(string.Format("SQL STATMENT={0}", string.Format("select count(*) from master..sysdatabases where name='{0}'", ATSGlobals.strDatabaseName))))
                 {
                     Logging.ATSAdminLog.Debug(string.Format("Getting Coount of {0} databases", ATSGlobals.strDatabaseName));
                     if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
@@ -290,23 +290,23 @@
                 {
 
 
-                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", Resource1.CreateDatabase.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName))))
+                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateDatabase)))
                     {
                         Logging.ATSAdminLog.Debug(string.Format("Creating Database {0} in CheckVersion()", ATSGlobals.strDatabaseName));
                         sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                         if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
-                        RunScript(Resource1.CreateDatabase.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName));
+                        RunScript(SQLServerResources.CreateDatabase);
                         //RunScript(CreateDatabaseUserScript());
                         sqlCon.Close();
                     }
                     Logging.ATSAdminLog.Debug(string.Format("Created Database {0} in CheckVersion()",ATSGlobals.strDatabaseName));
 
-                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", Resource1.CreateTables.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName))))
+                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateTables)))
                     {
                         Logging.ATSAdminLog.Debug(string.Format("Creating Tables in {0} Database in CheckVersion()", ATSGlobals.strDatabaseName));
                         sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                         if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
-                        RunScript(Resource1.CreateTables.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName));
+                        RunScript(SQLServerResources.CreateTables);
                         sqlCon.Close();
                     }
                     Logging.ATSAdminLog.Debug(string.Format("Created Tables in {0} Database in CheckVersion()", ATSGlobals.strDatabaseName));
@@ -334,12 +334,12 @@
                     try
                     {
 
-                        using (log4net.NDC.Push(string.Format("SQL Statment={0}", Resource1.CreateTables.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName))))
+                        using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateTables)))
                         {
                             Logging.ATSAdminLog.Debug(string.Format("Creating Tables in {0} Database in CheckVersion()", ATSGlobals.strDatabaseName));
                             sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                             if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
-                            RunScript(Resource1.CreateTables.ToString().Replace("AnywhereTS", ATSGlobals.strDatabaseName));
+                            RunScript(SQLServerResources.CreateTables);
                             sqlCon.Close();
                         }
                         Logging.ATSAdminLog.Debug(string.Format("Created Tables in {0} Database in CheckVersion()", ATSGlobals.strDatabaseName));

 

  ViewVC Help
Powered by ViewVC 1.1.22