private bool validateForm(string mthd)
{
bool validate = true;
// Does this object already exist
if (mthd == "Add" || sOriginalName != txtControlName.Text)
{
try
{
OSAEObject oExist = OSAEObjectManager.GetObjectByName(txtControlName.Text);
if (oExist != null)
{
MessageBox.Show("Control name already exist. Please Change!");
validate = false;
}
}
catch { }
}
if (string.IsNullOrEmpty(cboObject.Text))
{
MessageBox.Show("You must choose an associated object!");
validate = false;
}
if(string.IsNullOrEmpty(cboState1.Text))
{
MessageBox.Show("You must set the State 1 property!");
validate = false;
}
if (string.IsNullOrEmpty(txtState1X.Text))
{
MessageBox.Show("State 1 X Can not be empty");
validate = false;
}
if (string.IsNullOrEmpty(txtState1Y.Text))
{
MessageBox.Show("State 1 Y Can not be empty");
validate = false;
}
if (string.IsNullOrEmpty(txtState2X.Text))
{
MessageBox.Show("State 2 X Can not be empty");
validate = false;
}
if (string.IsNullOrEmpty(txtState2Y.Text))
{
MessageBox.Show("State 2 Y Can not be empty");
validate = false;
}
if (string.IsNullOrEmpty(txtZOrder.Text))
{
MessageBox.Show("ZOrder can not be empty");
validate = false;
}
return validate;
}