Display the SQL Code Revision in the About form

Added Code to Purge Disconnected Data to the Admin Tool
This commit is contained in:
Rich 2016-02-26 16:08:16 +00:00
parent 4909cf689f
commit a83ac512bd
2 changed files with 68 additions and 4 deletions

View File

@ -29,7 +29,7 @@ namespace VEPROMS
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.ActiveDatabase;
string databaseName = string.Format("{0}[SQL:{1:yyMM.ddHH}]", Database.ActiveDatabase, Database.RevDate);
this.Text = String.Format("About {0}", AssemblyTitle + " " + demoTxt);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);

View File

@ -30,12 +30,36 @@ namespace VEPROMS
{
adminToolsList = new AdminTools();
adminToolsList.Add("Update RO Values", "Update RO Values Guidance", "This allows the user to update referenced objects values for multiple working drafts in a batch mode.", "It is recommended that this be done during off hours.", "WARNING:", true, false, UpdateROValues);
adminToolsList.Add("Refresh Referenced Objects", "Refresh Referenced Objects Guidance", "Occasionally, referenced objects do not get updated. One cause of this is a failure to allow the RO update to complete.\r\n\r\nThis function will refresh referenced objects (based on the current ROFst) in all procedures selected below whether they were selected individually or as a group via a procedure set.", "If more than one procedure is selected, it is recommened that this be performed during off hours.", "WARNING:", false, false, RefreshReferencedObjects);
adminToolsList.Add("Refresh Referenced Objects"
, "Refresh Referenced Objects Guidance"
, "Occasionally, referenced objects do not get updated. One cause of this is a failure to allow the RO update to complete.\r\n\r\nThis function will refresh referenced objects (based on the current ROFst) in all procedures selected below whether they were selected individually or as a group via a procedure set."
, "If more than one procedure is selected, it is recommened that this be performed during off hours."
, "WARNING:"
, false
, false
, RefreshReferencedObjects);
adminToolsList.Add("Refresh Transitions", "Refresh Transitions Guidance", "Occasionally, transitions do not get updated.\r\n\r\nThis function will refresh transitions in all procedures selected below whether they were selected individually or as a group via a procedure set.", "If more than one procedure is selected, it is recommened that this be performed during off hours.", "WARNING:", false, false, RefreshTransitions);
adminToolsList.Add("Refresh Referenced Objects and Transitions", "Referenced Objects and Transitions Guidance", "Occasionally, referenced objects and transitions do not get updated." + Environment.NewLine + Environment.NewLine + "This function will refresh referenced objects and transitions (based on the current ROFst) in all procedures selected below whether they were selected individually or as a group via a procedure set.", "If more than one procedure is selected, it is recommened that this be performed during off hours.", "WARNING:", false, false, RefreshReferencedObjectsAndTransitions);
adminToolsList.Add("Delete PDFs", "Delete PDFs Guidance", "It is sometimes desirable to clean up the database by removing extra pdf files. This process allows for this to occur", "", "", true, true, "vesp_DeletePDFs", DeletePDFs);
adminToolsList.Add("Identify Disconnected Items", "Identify Disconnected Items Guidance", "Everything in PROMS is inter-related. A working draft knows what is its first procedure and a procedure knows what is its first step. Likewise, a procedure knows what procedure is before it and after it.\r\n\r\nOccasionally, an item will become disconnected and does not know where it fits into the relationships. This tool identifies whether the database has this condition.", "This tool may take an extended period of time to execute.", "NOTE:", true, true, "vesp_GetDisconnectedItemsCount", IdentifyDisconnectedItems);
adminToolsList.Add("Identify Non-Editable Items", "Identify Non-Editable Items Guidance", "Typically, a section in PROMS only has sub-sections or sub-steps. There are times when a section has both. When this occurs, the sub-step data can be marked as non-editable. If this occurs, the user can no longer get to these steps and they can become forgotten.\r\n\r\nThis tool will identify if the database has non-editable steps and provide a listing of these steps.", "This tool may take an extended period of time to execute.", "NOTE:", true, true,"vesp_GetNonEditableItems", IdentifyNonEditableItems);
adminToolsList.Add("Identify Disconnected Items"
, "Identify Disconnected Items Guidance"
, "Everything in PROMS is inter-related. A working draft knows what is its first procedure and a procedure knows what is its first step. Likewise, a procedure knows what procedure is before it and after it.\r\n\r\nOccasionally, an item will become disconnected and does not know where it fits into the relationships. This tool identifies whether the database has this condition."
, "This tool may take an extended period of time to execute."
, "NOTE:"
, true
, true
, "vesp_GetDisconnectedItemsCount"
, IdentifyDisconnectedItems);
adminToolsList.Add("Purge Disconnected Items"
, "Purge Disconnected Items Guidance"
, "Everything in PROMS is inter-related. A working draft knows what is its first procedure and a procedure knows what is its first step. Likewise, a procedure knows what procedure is before it and after it.\r\n\r\nOccasionally, an item will become disconnected and does not know where it fits into the relationships. This tool removes any disconnected items from the database."
, "Be sure to have a backup prior to runing this!!\r\n\r\nThis tool may take an extended period of time to execute."
, "Warning:"
, true
, true
, "vesp_PurgeDisconnectedData"
, PurgeDisconnectedItems);
adminToolsList.Add("Identify Non-Editable Items", "Identify Non-Editable Items Guidance", "Typically, a section in PROMS only has sub-sections or sub-steps. There are times when a section has both. When this occurs, the sub-step data can be marked as non-editable. If this occurs, the user can no longer get to these steps and they can become forgotten.\r\n\r\nThis tool will identify if the database has non-editable steps and provide a listing of these steps.", "This tool may take an extended period of time to execute.", "NOTE:", true, true, "vesp_GetNonEditableItems", IdentifyNonEditableItems);
adminToolsList.Add("Get Database Users", "Get Database Users Guidance", "This administrative tool will return all of the users currently with open sessions in the database and the details of any items they have checked out", "", "", true, true, "vesp_GetDatabaseSessions", GetDatabaseSessions);
//adminToolsList.Add("Find Referenced Object Problems", "Find Referenced Object Problems Guidance", "description for find ro problems", "", "", true, true, "vesp_FindROProblems", FindROProblems);
adminToolsList.Sort();
@ -451,6 +475,46 @@ namespace VEPROMS
this.Cursor = Cursors.Default;
MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title));
}
private void PurgeDisconnectedItems()
{
this.Cursor = Cursors.WaitCursor;
DateTime pStart = DateTime.Now;
txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm"));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int rowCount = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount");
if (rowCount > 0)
{
ESP_PurgeDisconnectedItems.Execute(selectedAdminTool.StoredProcedure);
int rowCount2 = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount");
txtProcess.AppendText(string.Format("Disconnected Items Purged", rowCount));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
txtResults.Clear();
txtResults.AppendText(string.Format("The database contained {0} disconnected items.", rowCount));
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(string.Format("The database now contains {0} disconnected items.", rowCount2));
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
if (rowCount2 > 0)
txtResults.AppendText("It is recommended you contact Volian to assist in resolving this condition");
}
else
{
txtResults.Clear();
txtResults.AppendText(string.Format("The database contained {0} disconnected items.", rowCount));
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(string.Format("No Disconnected Data to Purge!"));
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm"));
Application.DoEvents();
this.Cursor = Cursors.Default;
MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title));
}
private void IdentifyNonEditableItems()
{
this.Cursor = Cursors.WaitCursor;