private int validateInsert()
	{
	    try
	    {
	    String cid;
	    String cpassword;
		String cname;
		String caddr;
		String cphone;

		if (custID.getText().trim().length() != 0)
		{
		    cid = custID.getText().trim();
		}
		else
		{
		    return VALIDATIONERROR;
		}
		
		if (String.valueOf(password.getPassword()).trim().length() != 0)
		{
		    cpassword = String.valueOf(password.getPassword()).trim();
		}
		else
		{
		    return VALIDATIONERROR; 
		}

		if (custName.getText().trim().length() != 0)
		{
		    cname = custName.getText().trim();
		}
		else
		{
		    cname = null; 
		}

		if (custAddr.getText().trim().length() != 0)
		{
		    caddr = custAddr.getText().trim();
		}
		else
		{
		    caddr = null; 
		}

		if (custPhone.getText().trim().length() != 0 && isNumeric(custPhone.getText()))
		{
		    cphone = custPhone.getText().trim();
		}
		else
		{
		    cphone = null; 
		}

		if (customer.findCustomer(cid))
		{
			JOptionPane.showMessageDialog(this, "Customer ID \"" + cid + "\" already exists. Try another one.", "Error", JOptionPane.ERROR_MESSAGE);
			return OPERATIONFAILED;
		} 
		else if (customer.insertCustomer(cid, cname, cpassword, caddr, cphone))
		{
		    JOptionPane.showMessageDialog(this, "Registration of \"" + cid + "\" complete! Login now.");
		    return OPERATIONSUCCESS;
		}
		else
		{
		    Toolkit.getDefaultToolkit().beep();
		    return OPERATIONFAILED; 
		}
	    }
	    catch (NumberFormatException ex)
	    {
		// this exception is thrown when a string 
		// cannot be converted to a number
		return VALIDATIONERROR; 
	    }
	}