Added admin tool to fix hyphens

Fix hyphens when non-standard hyphens are pasted
This commit is contained in:
Rich
2017-06-26 15:19:47 +00:00
parent ee10dbde82
commit 850acf34b4
3 changed files with 72 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ namespace VEPROMS
, false
, UpdateROValues);
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("Fix Hyphens", "Fix Hyphens", "Replace various forms of Hyphens with a consistent Hyphen so that search will find all Hyphens", "", "", true, true, "vesp_FixHyphens", FixHyphens);
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"
@@ -106,6 +107,24 @@ namespace VEPROMS
cbxAdminTools.DisplayMember = "Title";
cbxAdminTools.SelectedIndex = -1;
}
private void FixHyphens()
{
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 affectedRows = ESP_FixHyphens.Execute(selectedAdminTool.StoredProcedure)/2;// Two results for each change
txtProcess.AppendText(string.Format("Fixed {0} Hyphens", affectedRows));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
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 Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
private Dictionary<TreeNode, DocVersionInfo> myDocVersions = new Dictionary<TreeNode, DocVersionInfo>();
private void frmBatchRefresh_Load(object sender, EventArgs e)