From 204db5b92c210631e5d90e1a3b3f292b5926d979 Mon Sep 17 00:00:00 2001 From: Kathy Date: Mon, 9 Apr 2012 13:33:40 +0000 Subject: [PATCH] --- .../frmRODbProperties.Designer.cs | 6 ++-- .../frmRODbProperties.cs | 29 +++++++++++++++++-- .../frmRODbProperties.resx | 4 +-- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmRODbProperties.Designer.cs b/PROMS/VEPROMS User Interface/frmRODbProperties.Designer.cs index 8338938c..fbade8dc 100644 --- a/PROMS/VEPROMS User Interface/frmRODbProperties.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmRODbProperties.Designer.cs @@ -46,7 +46,6 @@ namespace VEPROMS // ppBtnOk // this.ppBtnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ppBtnOk.DialogResult = System.Windows.Forms.DialogResult.OK; this.ppBtnOk.Location = new System.Drawing.Point(471, 201); this.ppBtnOk.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.ppBtnOk.Name = "ppBtnOk"; @@ -134,6 +133,7 @@ namespace VEPROMS // this.ppBtnFldrDlg.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; this.ppBtnFldrDlg.BackColor = System.Drawing.Color.Transparent; + this.ppBtnFldrDlg.FocusOnLeftMouseButtonDown = true; this.ppBtnFldrDlg.Image = ((System.Drawing.Image)(resources.GetObject("ppBtnFldrDlg.Image"))); this.ppBtnFldrDlg.Location = new System.Drawing.Point(539, 62); this.ppBtnFldrDlg.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); @@ -168,9 +168,9 @@ namespace VEPROMS this.ppLblName.BackColor = System.Drawing.Color.Transparent; this.ppLblName.Location = new System.Drawing.Point(30, 31); this.ppLblName.Name = "ppLblName"; - this.ppLblName.Size = new System.Drawing.Size(93, 17); + this.ppLblName.Size = new System.Drawing.Size(79, 17); this.ppLblName.TabIndex = 15; - this.ppLblName.Text = "RO Fst Name"; + this.ppLblName.Text = "Description"; // // frmRODbProperties // diff --git a/PROMS/VEPROMS User Interface/frmRODbProperties.cs b/PROMS/VEPROMS User Interface/frmRODbProperties.cs index 87ff2b46..e56f2a6d 100644 --- a/PROMS/VEPROMS User Interface/frmRODbProperties.cs +++ b/PROMS/VEPROMS User Interface/frmRODbProperties.cs @@ -12,6 +12,12 @@ namespace VEPROMS { public partial class frmRODbProperties : Form { + private Point _ParentLocation; + public Point ParentLocation + { + get { return _ParentLocation; } + set { _ParentLocation = value; } + } private RODbInfo _roDbInfo; private string _origROName; private string _origFolderPath; @@ -41,6 +47,16 @@ namespace VEPROMS // Then close & return. if (_origROName !=null && _origFolderPath !=null && (_origROName != ppRTxtName.Text || _origFolderPath != ppTxtPath.Text)) { + if (!File.Exists(ppTxtPath.Text)) + { + MessageBox.Show(ppTxtPath.Text, "Invalid Directory for RO Database"); + return; + } + if (!File.Exists(ppTxtPath.Text + @"\ro.fst")) + { + MessageBox.Show(ppTxtPath.Text, "Ro.Fst Doesn't Exist"); + return; + } RODb roDb = RODb.Get(_roDbInfo.RODbID); if (_origROName != ppRTxtName.Text) roDb.ROName = ppRTxtName.Text; if (_origFolderPath != ppTxtPath.Text) @@ -89,15 +105,20 @@ namespace VEPROMS RODbInfoList allrodbinfo = RODbInfoList.Get(); foreach (RODbInfo rdi in allrodbinfo) { - if (ppRTxtName.Text == rdi.ROName || ppTxtPath.Text.ToUpper() == rdi.FolderPath.ToUpper()) + if (ppRTxtName.Text == rdi.ROName) { - MessageBox.Show("Name and/or folder path are not unique, create unique names."); + MessageBox.Show("Create unique Description.", "Description is not unique"); + return; + } + if (ppTxtPath.Text.ToUpper() == rdi.FolderPath.ToUpper()) + { + MessageBox.Show("Specify unique Folder Path or cancel and select an existing RO Database from drop-down.", "Folder Path is not unique" ); return; } } if (ppRTxtName.Text == null || ppRTxtName.Text == "") { - MessageBox.Show("You must enter a Name."); + MessageBox.Show("You must enter a Description."); return; } if (ppTxtPath.Text == null || ppTxtPath.Text == "") @@ -118,10 +139,12 @@ namespace VEPROMS RODbInfo newrdi = RODbInfo.Get(newroDb.RODbID); newroDb.Save().Dispose(); ROFst rofst = ROFstInfo.AddRoFst(newrdi, _docVersion); + DialogResult = DialogResult.OK; Close(); } private void frmRODbProperties_Load(object sender, EventArgs e) { + Location = ParentLocation; ppRTxtName.Text = (_roDbInfo == null) ? null : _roDbInfo.ROName; ppTxtPath.Text = (_roDbInfo == null) ? null : _roDbInfo.FolderPath; RODbConfig cfg = (_roDbInfo == null) ? new RODbConfig() : new RODbConfig(_roDbInfo); diff --git a/PROMS/VEPROMS User Interface/frmRODbProperties.resx b/PROMS/VEPROMS User Interface/frmRODbProperties.resx index 2e56328a..26ba1fa3 100644 --- a/PROMS/VEPROMS User Interface/frmRODbProperties.resx +++ b/PROMS/VEPROMS User Interface/frmRODbProperties.resx @@ -121,8 +121,8 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALBQAA - CwUByY3ISQAAAn9JREFUOE+lk2tI01EYxhf0oU8WqVEIRpaIBWJgSPUhROmippS3QkkTylsXDMW8ts3b + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAwAA + CwMBSY6M0gAAAn9JREFUOE+lk2tI01EYxhf0oU8WqVEIRpaIBWJgSPUhROmippS3QkkTylsXDMW8ts3b 1G06daVibuqaOq0sxbBCKBSJ0PJCialZUFSKqaGSt1//TbIsww8deOBwznl+5zkv71kHiP5rGAFrKb1Q 5ypR6bmaVU6m2kCiXJv007Om2XgwJEaNT4QiyDi/GF9mKRVgsWkav+CYQkR1utwAQfypphqZ4l/JIhOL jvtGKfCOyDMB6O/WMjNea9L3MT1zIxoM5QrqdWnS1SA+kUq8w1V4hhUgqq1QMj1WtcK88KmIud5oqsqy