This commit is contained in:
Kathy Ruffing 2012-04-09 13:33:40 +00:00
parent 8cb0c78730
commit 204db5b92c
3 changed files with 31 additions and 8 deletions

View File

@ -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
//

View File

@ -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);

View File

@ -121,8 +121,8 @@
<data name="ppBtnFldrDlg.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALBQAA
CwUByY3ISQAAAn9JREFUOE+lk2tI01EYxhf0oU8WqVEIRpaIBWJgSPUhROmippS3QkkTylsXDMW8ts3b
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALAwAA
CwMBSY6M0gAAAn9JREFUOE+lk2tI01EYxhf0oU8WqVEIRpaIBWJgSPUhROmippS3QkkTylsXDMW8ts3b
1G06daVibuqaOq0sxbBCKBSJ0PJCialZUFSKqaGSt1//TbIsww8deOBwznl+5zkv71kHiP5rGAFrKb1Q
5ypR6bmaVU6m2kCiXJv007Om2XgwJEaNT4QiyDi/GF9mKRVgsWkav+CYQkR1utwAQfypphqZ4l/JIhOL
jvtGKfCOyDMB6O/WMjNea9L3MT1zIxoM5QrqdWnS1SA+kUq8w1V4hhUgqq1QMj1WtcK88KmIud5oqsqy