Add implementation code for Get Database Users and updated other adminstrative tools to standardize naming of functions

Standardized naming of adminsitrative tools implementing code functions
This commit is contained in:
Jim
2015-04-14 01:35:29 +00:00
parent ac85235031
commit 5282ef114d
3 changed files with 129 additions and 14 deletions

View File

@@ -345,7 +345,7 @@ namespace VEPROMS
//
// txtResults
//
this.txtResults.AcceptsReturn = true;
//this.txtResults.AcceptsReturn = true;
this.txtResults.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtResults.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtResults.Location = new System.Drawing.Point(0, 52);

View File

@@ -37,6 +37,7 @@ namespace VEPROMS
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("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();
cbxAdminTools.DataSource = adminToolsList;
cbxAdminTools.DisplayMember = "Title";
@@ -389,7 +390,7 @@ namespace VEPROMS
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int affectedRows = ExecuteStoredProcedureRowsAffected.Execute(selectedAdminTool.StoredProcedure);
int affectedRows = ESP_DeletePDFs.Execute(selectedAdminTool.StoredProcedure);
txtProcess.AppendText(string.Format("Deleted {0} PDFs", affectedRows));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
@@ -407,12 +408,13 @@ namespace VEPROMS
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int rowCount = ExecuteStoredProcedureRowCount.Execute(selectedAdminTool.StoredProcedure);
int rowCount = ESP_IdentifyDisconnectedItems.Execute(selectedAdminTool.StoredProcedure);
txtProcess.AppendText(string.Format("Disconnected Items Count: {0}", rowCount));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
if (rowCount > 0)
{
txtResults.Clear();
txtResults.AppendText(string.Format("The database contains {0} disconnected items.", rowCount));
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
@@ -432,12 +434,13 @@ namespace VEPROMS
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
List<ItemInfo> myItems = ExecuteStoredProcedureItemInfoList.Execute(selectedAdminTool.StoredProcedure);
List<ItemInfo> myItems = ESP_IdentifyNonEditableItems.Execute(selectedAdminTool.StoredProcedure);
txtProcess.AppendText(string.Format("Non-Editable Items Count: {0}",myItems.Count));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
if (myItems.Count > 0)
{
txtResults.Clear();
txtResults.AppendText("The following items are non-editable...");
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
@@ -461,7 +464,24 @@ namespace VEPROMS
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
txtProcess.AppendText("In Progress");
txtResults.Clear();
txtResults.AppendText(ESP_GetDatabaseSessions.Execute(selectedAdminTool.StoredProcedure));
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 FindROProblems()
{
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();
txtResults.Clear();
//txtResults.AppendText(ExecuteStoredProcedureString.Execute(selectedAdminTool.StoredProcedure));
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm"));
Application.DoEvents();
@@ -470,6 +490,7 @@ namespace VEPROMS
}
private void btnRefresh_Click(object sender, EventArgs e)
{
txtProcess.Clear();
if (btnRefresh.Text == "NO OPTION SELECTED")
{
MessageBox.Show("You must select an option under the Option panel", btnRefresh.Text);