private void addCustomer() {

		String id = formMain.txtCustId.getText();

		if (selectedCustomer != null && !id.isEmpty()) {

			if (selectedCustomer.getId() == Integer.parseInt(id)) {
				JOptionPane.showMessageDialog(null, "The customer "
						+ formMain.txtCustName.getText()
						+ " already exist in the system!",
						"Customer Already Exist!", JOptionPane.ERROR_MESSAGE);
				return;
			}
		}

		Customer c = new Customer();
		JTextField[] txts = new JTextField[] { formMain.txtContact,
				formMain.txtCustName, formMain.txtEmail };

		if (!validateEmpty(txts)) {
			return;
		}

		c.setContact(formMain.txtContact.getText());
		c.setName(formMain.txtCustName.getText());
		c.setEmail(formMain.txtEmail.getText());
		dao.addEntity(c);
		formMain.txtCustId.setText(String.valueOf(c.getId()));
		selectedCustomer = c;
		Vector<Customer> vector = new Vector<Customer>();
		vector.add(c);
		formMain.customerTableModel.setDataVector(vector);
		formMain.customerTableModel.fireTableDataChanged();
	}