diff --git a/PROMS/VEPROMS User Interface/frmRODbProperties.cs b/PROMS/VEPROMS User Interface/frmRODbProperties.cs index ed7f6b3e..0143e6f7 100644 --- a/PROMS/VEPROMS User Interface/frmRODbProperties.cs +++ b/PROMS/VEPROMS User Interface/frmRODbProperties.cs @@ -66,11 +66,15 @@ namespace VEPROMS InitializeComponent(); _origROName = (_roDbInfo == null) ? null : _roDbInfo.ROName; _origFolderPath = (_roDbInfo == null) ? null : _roDbInfo.FolderPath; + // Disable the OK button when initialized. Enable it if the user makes changes + ppBtnOk.Enabled = false; } private void ppBtnFldrDlg_Click(object sender, EventArgs e) { FolderBrowserDialog dlgROFolder = new FolderBrowserDialog(); + // Initialize the starting location in the Browser window + dlgROFolder.SelectedPath = ppTxtPath.Text; if (dlgROFolder.ShowDialog() == DialogResult.OK) { ppTxtPath.Text = dlgROFolder.SelectedPath; @@ -104,6 +108,12 @@ namespace VEPROMS { if (ppTxtPath.Text.ToUpper() == rdi.FolderPath.ToUpper()) { + // if this has a previously defined path and a different name, do not save it. + if(ppRTxtName.Text.ToUpper() != rdi.ROName.ToUpper()) + { + MessageBox.Show(string.Format("This path has been used for \"{0}\" Database",rdi.ROName), "Previously Used RO Path", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } // get the most recent rofst data for this rodb: ROFstInfoList roFstList = ROFstInfoList.GetByRODbID(rdi.RODbID); DateTime dts = new DateTime(1900, 1, 1); @@ -197,12 +207,22 @@ namespace VEPROMS { string newFolderPath = null; FolderBrowserDialog dlgROFolder = new FolderBrowserDialog(); + dlgROFolder.RootFolder = Environment.SpecialFolder.MyComputer; + dlgROFolder.SelectedPath = ppTxtPath.Text; if (dlgROFolder.ShowDialog() == DialogResult.OK) { newFolderPath = dlgROFolder.SelectedPath; } ppTxtPath.Text = newFolderPath; } + // Initialize the enabled status for the OK button to false. + ppBtnOk.Enabled = false; + ppTxtPath.TextChanged += ppTxtPath_TextChanged; + } + void ppTxtPath_TextChanged(object sender, EventArgs e) + { + //The OK button should only be enabled if the path has changed + ppBtnOk.Enabled = _origFolderPath != ppTxtPath.Text; } } } \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index bf98a6b3..8f301a41 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2148,7 +2148,12 @@ namespace VEPROMS.CSLA.Library get { if (_SearchDVPath == null) - _SearchDVPath = ActiveParent.SearchDVPath; + { + if (ActiveParent != null) + _SearchDVPath = ActiveParent.SearchDVPath; + else // RHM 20151026 - B2015-171 This was added to handle an error in the Library Document Report + _SearchDVPath = string.Format("Disconnected Data {0}", ItemID); + } return _SearchDVPath; } }