Added code to handle importing a procedure with different RO folder

Added code to sort Administrative Tools
Added code to improve how the controls align when using a lower DPI screen resolution
Added code to refresh progress bar when updating RO's
This commit is contained in:
Rich 2015-02-27 03:54:35 +00:00
parent f73ab7c3a7
commit de51192fc0
4 changed files with 56 additions and 14 deletions

View File

@ -217,11 +217,31 @@ namespace VEPROMS
if (MyRODb == null)
{
if (localROPaths.Count == 0)
MessageBox.Show("need new ro folder assigned");
else
MessageBox.Show("pick an ro folder");
{
MessageBox.Show("There has been no RO folder defined for this database.\r\n\r\nIn order to import a procedure, you need to assign a RO folder path.\r\n\r\nImport process will terminate.");
this.Cursor = Cursors.Default;
return;
}
else
{
this.Cursor = Cursors.Default;
dlgPickROFolder dlg = new dlgPickROFolder();
dlg.ImportedROFolder = rofolderpath;
dlg.LocalROFolders = localROPaths;
dlg.ShowDialog(this);
if (dlg.SelectedROFolder != string.Empty)
{
MyRODb = RODb.GetByFolderPath(dlg.SelectedROFolder);
oldRODbID = newRODbID = MyRODb.RODbID;
MyDocVersion.RefreshDocVersionAssociations();
}
else
{
MessageBox.Show("Since you did not pick an existing RO folder defined for this database, the import process will terminate.");
return;
}
}
}
foreach (ProcedureInfo pi in MyDocVersion.Procedures)
{
if (pi.ItemID == int.Parse(xd.SelectSingleNode("procedure/@itemid").InnerText) || pi.MyContent.Number == xd.SelectSingleNode("procedure/content/@number").InnerText)

View File

@ -119,7 +119,7 @@ namespace VEPROMS
this.lblWarning.Location = new System.Drawing.Point(5, 175);
this.lblWarning.Name = "lblWarning";
this.lblWarning.Size = new System.Drawing.Size(290, 38);
this.lblWarning.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.lblWarning.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
this.lblWarning.TabIndex = 4;
this.lblWarning.Visible = false;
//
@ -128,7 +128,7 @@ namespace VEPROMS
this.lblDescription.Location = new System.Drawing.Point(5, 66);
this.lblDescription.Name = "lblDescription";
this.lblDescription.Size = new System.Drawing.Size(290, 109);
this.lblDescription.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.lblDescription.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom;
this.lblDescription.TabIndex = 3;
//
// lblCaption
@ -283,7 +283,7 @@ namespace VEPROMS
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(155, 15);
this.label5.Location = new System.Drawing.Point(105, 15);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(18, 13);
this.label5.TabIndex = 5;
@ -293,10 +293,11 @@ namespace VEPROMS
//
this.dtpTime.CustomFormat = "HH:mm";
this.dtpTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpTime.Location = new System.Drawing.Point(179, 9);
this.dtpTime.Location = new System.Drawing.Point(129, 9);
this.dtpTime.Name = "dtpTime";
this.dtpTime.ShowUpDown = true;
this.dtpTime.Size = new System.Drawing.Size(98, 20);
this.dtpTime.Size = new System.Drawing.Size(140, 20);
this.dtpTime.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.dtpTime.TabIndex = 4;
//
// dtpDate
@ -304,7 +305,7 @@ namespace VEPROMS
this.dtpDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dtpDate.Location = new System.Drawing.Point(9, 9);
this.dtpDate.Name = "dtpDate";
this.dtpDate.Size = new System.Drawing.Size(140, 20);
this.dtpDate.Size = new System.Drawing.Size(90, 20);
this.dtpDate.TabIndex = 3;
//
// btnRefresh

View File

@ -36,6 +36,8 @@ namespace VEPROMS
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("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.Sort();
cbxAdminTools.DataSource = adminToolsList;
cbxAdminTools.DisplayMember = "Title";
cbxAdminTools.SelectedIndex = -1;
@ -451,6 +453,21 @@ namespace VEPROMS
this.Cursor = Cursors.Default;
MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title));
}
private void GetDatabaseSessions()
{
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();
txtProcess.AppendText("In Progress");
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 btnRefresh_Click(object sender, EventArgs e)
{
if (btnRefresh.Text == "NO OPTION SELECTED")
@ -729,7 +746,7 @@ namespace VEPROMS
pnlLater.Enabled = chkLater.Checked;
}
}
public class AdminTool
public class AdminTool : IComparable<AdminTool>
{
private string _Title;
public string Title
@ -815,6 +832,10 @@ namespace VEPROMS
_StoredProcedure = storedProcedure;
_MyExecute = myExecute;
}
public int CompareTo(AdminTool at)
{
return this.Title.CompareTo(at.Title);
}
}
public class AdminTools : List<AdminTool>
{

View File

@ -986,7 +986,7 @@ namespace VEPROMS
// get the rodb from the selection - and then do an 'update rofst'...
RODbInfoList rdil = RODbInfoList.Get();
RODbInfo rdi = rdil[cmbRoDb.SelectedIndex];
ROFst tmp = ROFstInfo.AddRoFst(rdi, _DocVersionConfig.MyDocVersion, null); // RHM Needs To Include Delegate
ROFst tmp = ROFstInfo.AddRoFst(rdi, _DocVersionConfig.MyDocVersion, DoProgressBarRefresh); // RHM Needs To Include Delegate
if (tmp == null)
{
MessageBox.Show("Invalid ro fst directory, use the Property dialog to fix directory path to ro.fst.");