Added logic to allow a merge of 16-bit data into a 32-bit database. Also tried to add an update formats for all database, but isn’t working yet, so I commented the logic out for now.
This commit is contained in:
@@ -379,6 +379,7 @@ namespace DataLoader
|
||||
ssr.InfoMessage += new SQLScriptRunnerEvent(ssr_InfoMessage);
|
||||
try
|
||||
{
|
||||
AddError("Running Script '{0}'", scriptName);
|
||||
ssr.Run();
|
||||
Status = String.Format("Script '{0}' Complete", scriptName);
|
||||
ok = true;
|
||||
@@ -833,16 +834,21 @@ namespace DataLoader
|
||||
Status = "Backing up Phase 2 Data";
|
||||
Backup("_" + MySettings.Phase2Suffix);
|
||||
mb.Append("Phase 2 Backup Complete");
|
||||
// Phase 3 - Convert to Change Manager Version
|
||||
if(!ConvertToChangeManager()) return;
|
||||
mb.Append("Conversion to Change Manager Complete");
|
||||
Status = "Backing up Phase 3 Data";
|
||||
Backup("_" + MySettings.Phase3Suffix);
|
||||
mb.Append("Phase 3 Backup Complete");
|
||||
//Phase 4 - Convert to Approval Version
|
||||
if(!ConvertToApproval()) return;
|
||||
// only do the following two steps if we are NOT appending to an existing set
|
||||
if (MySettings.PurgeExistingData)
|
||||
{
|
||||
// Phase 3 - Convert to Change Manager Version
|
||||
if (!ConvertToChangeManager()) return;
|
||||
mb.Append("Conversion to Change Manager Complete");
|
||||
Status = "Backing up Phase 3 Data";
|
||||
Backup("_" + MySettings.Phase3Suffix);
|
||||
mb.Append("Phase 3 Backup Complete");
|
||||
//Phase 4 - Convert to Approval Version
|
||||
if (!ConvertToApproval()) return;
|
||||
mb.Append("Conversion to Approval Complete");
|
||||
}
|
||||
if(!FixProceduresAndFunctions()) return;
|
||||
mb.Append("Conversion to Approval Complete");
|
||||
mb.Append("FixProceduresAndFunctions Complete");
|
||||
if (MySettings.LoadApproved)
|
||||
{
|
||||
Status = "Backing up Phase 4 Data";
|
||||
@@ -1069,6 +1075,65 @@ namespace DataLoader
|
||||
Status = String.Format("Fixing databases complete. {0} Fixed, {1} Failures", good, bad);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateFormatsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Can't get this to work yet");
|
||||
//this.Cursor = Cursors.WaitCursor;
|
||||
////MySettings.ConnectionString
|
||||
////"{DBName}", dbName
|
||||
//string tmp = MySettings.ConnectionString.Replace("{DBName}", "master");
|
||||
//SqlConnection cn = new SqlConnection(tmp);
|
||||
//cn.Open();
|
||||
//SqlDataAdapter da = new SqlDataAdapter("select name, case when object_id(name + '..Items') is null then 'Not PROMS' when object_id(name + '..Revisions') is not null then 'Approval' when object_id(name + '..ContentAudits') is not null then 'Change Manager' else 'Original' end functionality from sysdatabases where name not in ('master','model','msdb','tempdb') order by name", cn);
|
||||
//DataSet ds = new DataSet();
|
||||
//da.Fill(ds);
|
||||
//cn.Close();
|
||||
//List<string> cms = new List<string>();
|
||||
//StringBuilder sb = new StringBuilder();
|
||||
//sb.Append("Formats will be updated in the following databases ...\r\n");
|
||||
//foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
//{
|
||||
// if (dr["functionality"].ToString() == "Approval") // get only the databases with Approval fnctionality
|
||||
// {
|
||||
// cms.Add(dr["name"].ToString());
|
||||
// sb.Append("\r\n " + dr["name"].ToString());
|
||||
// }
|
||||
//}
|
||||
//this.Cursor = Cursors.Default;
|
||||
//if (MessageBox.Show(sb.ToString(), "Format Updates", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
|
||||
//{
|
||||
// int good = 0;
|
||||
// int bad = 0;
|
||||
// string saveDbName = MySettings.DBName;
|
||||
// foreach (string s in cms)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// AddInfo("\r\nUpdating Formats in database {0}\r\n", s);
|
||||
// MySettings.DBName = s;
|
||||
// Database.VEPROMS_Connection = MySettings.ConnectionString.Replace("{DBName}", s);
|
||||
// Format.UpdateFormats(MySettings.FormatFolder, MySettings.GenMacFolder);
|
||||
// Database.VEPROMS_SqlConnection.Close();
|
||||
// //RunScript("PROMSFixes.sql", s);
|
||||
// good++;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// AddInfo("====****====");
|
||||
// AddError(ex, "While Updating Formats for database {0}", s);
|
||||
// AddInfo("====****====");
|
||||
// bad++;
|
||||
// }
|
||||
// }
|
||||
// MySettings.DBName = saveDbName;
|
||||
// AddInfo("\r\nUpdating Formats in databases complete. {0} Fixed, {1} Failures", good, bad);
|
||||
// Status = String.Format("Updating Formats in databases complete. {0} Fixed, {1} Failures", good, bad);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public class MessageBuilder
|
||||
{
|
||||
|
Reference in New Issue
Block a user