public int assignExistingCardToNewPerson(CsvBean bean) {
		if (isEmpty(bean.dateStart) || isEmpty(bean.cardNr))
			return 0;
		if (isEmpty(bean.dateEnd))
			bean.dateEnd = "21001231";

		try {
			cn.setAutoCommit(false);
			String sql;
			
			if (checkPersonExist(bean.personNr)) {
				sql = "Delete  from hPerson WHERE PersonalNr='" + bean.personNr + "'";
				st.execute(sql);
			}
			String persKF = insertPersonalAndRef(bean);
			if (isEmpty(persKF)) {
				return 0;
			}

			// insert card
			sql = "update bidcard set persfk = '" + persKF + "', ObsolFlag='1' where cardNr='" + bean.cardNr + "'";
			st.execute(sql);

			cn.commit();
			cn.setAutoCommit(true);

			return 1;
		} catch (Exception e) {
			try {
				cn.rollback();
			} catch (SQLException e1) {
				e1.printStackTrace();
			}
			e.printStackTrace();
			logger.error("Error while updating the card " + bean.cardNr, e);
		} finally {
			try {
				cn.setAutoCommit(true);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return 0;
	}