// Path: src/java/is/idega/idegaweb/egov/accounting/data/CaseCodeAccountingKey.java
// public interface CaseCodeAccountingKey extends IDOEntity {
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getPrimaryKeyClass
// 	 */
// 	public Class getPrimaryKeyClass();
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getCaseCode
// 	 */
// 	public CaseCode getCaseCode();
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getCaseCodeString
// 	 */
// 	public String getCaseCodeString();
// 	
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getAccountingKey
// 	 */
// 	public String getAccountingKey();
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getDescription
// 	 */
// 	public String getDescription();
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#setCaseCode
// 	 */
// 	public void setCaseCode(CaseCode code);
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#setAccountingKey
// 	 */
// 	public void setAccountingKey(String key);
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#setDescription
// 	 */
// 	public void setDescription(String description);
// }
// 
// Path: src/java/is/idega/idegaweb/egov/accounting/data/CaseCodeAccountingKeyHome.java
// public interface CaseCodeAccountingKeyHome extends IDOHome {
// 
// 	public CaseCodeAccountingKey create() throws CreateException;
// 
// 	public CaseCodeAccountingKey findByPrimaryKey(Object pk) throws FinderException;
// 
// 	public CaseCodeAccountingKey create(CaseCode code) throws CreateException;
// 
// 	public CaseCodeAccountingKey findByPrimaryKey(CaseCode code) throws FinderException;
// 
// 	public CaseCodeAccountingKey findByAccountingKey(String accountingKey) throws FinderException;
// 	
// 	public Collection findAllCaseCodeAccountingKeys() throws FinderException;
// }


import is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKey;
import is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyHome;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.util.logging.Logger;
import com.idega.block.process.data.CaseCode;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.util.IWTimestamp;
import com.idega.util.database.ConnectionBroker;
/*
 * $Id$ Created on Dec 18, 2006
 * 
 * Copyright (C) 2006 Idega Software hf. All Rights Reserved.
 * 
 * This software is the proprietary information of Idega hf. Use is subject to
 * license terms.
 */
package is.idega.idegaweb.egov.accounting.business;




public class AgressoBusinessBean extends IBOServiceBean implements AgressoBusiness {

	static Logger log = Logger.getLogger(AgressoBusinessBean.class.getName());

	public void executeAfterSchoolCareUpdate() {
		log.info("Starting Agresso after school care update");

		Connection conn = ConnectionBroker.getConnection();
		int prevTransactionLevel = Connection.TRANSACTION_SERIALIZABLE;
		boolean prevAutoComm = true;
		try {
			prevTransactionLevel = conn.getTransactionIsolation();
			prevAutoComm = conn.getAutoCommit();
		}
		catch (SQLException e1) {
			e1.printStackTrace();
		}
		AccountingEntry entry;
		try {
			String tableName = "RRVK_AGRESSO";

			conn.setAutoCommit(false);

			conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);

			Statement stmt1 = conn.createStatement();
			stmt1.executeUpdate("delete from " + tableName);
			stmt1.close();

// Path: src/java/is/idega/idegaweb/egov/accounting/data/CaseCodeAccountingKey.java
// public interface CaseCodeAccountingKey extends IDOEntity {
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getPrimaryKeyClass
// 	 */
// 	public Class getPrimaryKeyClass();
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getCaseCode
// 	 */
// 	public CaseCode getCaseCode();
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getCaseCodeString
// 	 */
// 	public String getCaseCodeString();
// 	
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getAccountingKey
// 	 */
// 	public String getAccountingKey();
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#getDescription
// 	 */
// 	public String getDescription();
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#setCaseCode
// 	 */
// 	public void setCaseCode(CaseCode code);
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#setAccountingKey
// 	 */
// 	public void setAccountingKey(String key);
// 
// 	/**
// 	 * @see is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyBMPBean#setDescription
// 	 */
// 	public void setDescription(String description);
// }
// 
// Path: src/java/is/idega/idegaweb/egov/accounting/data/CaseCodeAccountingKeyHome.java
// public interface CaseCodeAccountingKeyHome extends IDOHome {
// 
// 	public CaseCodeAccountingKey create() throws CreateException;
// 
// 	public CaseCodeAccountingKey findByPrimaryKey(Object pk) throws FinderException;
// 
// 	public CaseCodeAccountingKey create(CaseCode code) throws CreateException;
// 
// 	public CaseCodeAccountingKey findByPrimaryKey(CaseCode code) throws FinderException;
// 
// 	public CaseCodeAccountingKey findByAccountingKey(String accountingKey) throws FinderException;
// 	
// 	public Collection findAllCaseCodeAccountingKeys() throws FinderException;
// }


// Path: src/java/is/idega/idegaweb/egov/accounting/business/AgressoBusinessBean.java
import is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKey;
import is.idega.idegaweb.egov.accounting.data.CaseCodeAccountingKeyHome;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.util.logging.Logger;
import com.idega.block.process.data.CaseCode;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.util.IWTimestamp;
import com.idega.util.database.ConnectionBroker;

/*
 * $Id$ Created on Dec 18, 2006
 * 
 * Copyright (C) 2006 Idega Software hf. All Rights Reserved.
 * 
 * This software is the proprietary information of Idega hf. Use is subject to
 * license terms.
 */
package is.idega.idegaweb.egov.accounting.business;




public class AgressoBusinessBean extends IBOServiceBean implements AgressoBusiness {

	static Logger log = Logger.getLogger(AgressoBusinessBean.class.getName());

	public void executeAfterSchoolCareUpdate() {
		log.info("Starting Agresso after school care update");

		Connection conn = ConnectionBroker.getConnection();
		int prevTransactionLevel = Connection.TRANSACTION_SERIALIZABLE;
		boolean prevAutoComm = true;
		try {
			prevTransactionLevel = conn.getTransactionIsolation();
			prevAutoComm = conn.getAutoCommit();
		}
		catch (SQLException e1) {
			e1.printStackTrace();
		}
		AccountingEntry entry;
		try {
			String tableName = "RRVK_AGRESSO";

			conn.setAutoCommit(false);

			conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);

			Statement stmt1 = conn.createStatement();
			stmt1.executeUpdate("delete from " + tableName);
			stmt1.close();

			CaseCodeAccountingKeyHome ccah = (CaseCodeAccountingKeyHome) IDOLookup.getHome(CaseCodeAccountingKey.class);