?? gbs_priceedithardwareorcpcactionlogic.java
字號:
package LOGIC;
import java.util.ArrayList;
import javax.sql.DataSource;
import COMMON.ReturnValue;
import COMMON.SystemConstants;
import DB.GBS_MCountry_DB;
import DB.GBS_MWideUse_DB;
import DB.GBS_TProductPrice_DB;
import DataBean.GBS_TProductPrice_stBean;
import DataBean.GBS_MCountry_stBean;
import DataBean.GBS_LittleCountry_stBean;
/**
* public class GBS_PriceEditHardwareORCPCActionLogic implements SystemConstants
* created on 07-30-2004
* @author wxf
* @version 1.0
*/
public class GBS_PriceEditHardwareORCPCActionLogic implements SystemConstants {
private DataSource datasource = null;
/**
* trans datasource to db
* @param datasource
*/
public GBS_PriceEditHardwareORCPCActionLogic(DataSource datasource) {
this.datasource = datasource;
}
/**
* select one record by max date
* @param GBS_TProductPrice_stBean in
* @throws Exception
* @return ReturnValue
*/
public ReturnValue selectOneByMaxDate(GBS_TProductPrice_stBean in)throws Exception {
GBS_TProductPrice_DB db= new GBS_TProductPrice_DB(datasource);
return db.selectOneByMaxDate(in);
}
/**
* submit
* @param String userid
* @param ArrayList in
* @throws Exception
* @return ReturnValue
*/
public ReturnValue submit(String userid, ArrayList in)throws Exception {
GBS_TProductPrice_DB db= new GBS_TProductPrice_DB(datasource);
return db.insert( userid, in );
}
/**
* get hardware price information
* @param String countryCode
* @throws Exception
* @return ReturnValue
*/
public ReturnValue getEditHardwareInfo(String countryCode)throws Exception {
GBS_TProductPrice_DB db=new GBS_TProductPrice_DB(datasource);
return db.selectEditHardwarePrice(countryCode);
}
/**
* get CPC price inforamtion
* @param String countryCode
* @throws Exception
* @return ReturnValue
*/
public ReturnValue getEditCPCInfo(String countryCode)throws Exception {
GBS_TProductPrice_DB db=new GBS_TProductPrice_DB(datasource);
return db.selectEditCPCPrice(countryCode);
}
/**
* get country information
* @throws Exception
* @return ReturnValue
*/
public ReturnValue getCountryInfo()throws Exception {
GBS_MCountry_DB countryDB = new GBS_MCountry_DB(datasource);
ArrayList countryList = new ArrayList();
ReturnValue returnValue = countryDB.seletAllCountry();
if ( !returnValue.isError() ){
ArrayList list = ( ArrayList ) returnValue.getDataValue();
for ( int i = 0; list != null && i < list.size() ; i ++ ){
GBS_MCountry_stBean mCountry_st = ( GBS_MCountry_stBean )list.get( i );
GBS_LittleCountry_stBean littleCountry_st = new GBS_LittleCountry_stBean();
littleCountry_st.setCountryCode( mCountry_st.getCountryCode() );
littleCountry_st.setCountryName( mCountry_st.getCountryName() );
countryList.add(littleCountry_st);
}
returnValue.setDataValue( countryList );
}
// DataBean.GBS_MCountry_stBean mCountry_st = new GBS_MCountry_stBean();
// GBS_LittleCountry_stBean littleCountry_st = new GBS_LittleCountry_stBean();
// littleCountry_st.setCountryCode(rset.getString("COUNTRY_CODE"));
// littleCountry_st.setCountryName(rset.getString("COUNTRY_NAME"));
// countryList.add(littleCountry_st);
return returnValue;
}
/**
* get local currency information
* @throws Exception
* @return ReturnValue
*/
public ReturnValue getAllLocalCurrencyInfo()throws Exception {
GBS_MWideUse_DB db=new GBS_MWideUse_DB(datasource);
return db.selectByTargetUse("CURRENCY");
}
/**
* selectByPK
* @param GBS_TProductPrice_stBean in
* @throws Exception
* @return ReturnValue
*/
public ReturnValue getLocalCurencyName(String TargetUse)throws Exception {
GBS_MWideUse_DB db= new GBS_MWideUse_DB(datasource);
return db.selectByTargetUse(TargetUse);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -