📄 gbs_productavailabilityconditionactionlogic.java
字号:
/**
* method GBS_ProductAvailabilityConditionActionLogic.java
* created on 08-02-2004
*
* @author GXK
* @version 1.0
*/
package LOGIC;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import java.util.ArrayList;
import COMMON.ReturnValue;
import COMMON.SystemConstants;
import DB.GBS_MCountryProductR_DB;
import DB.GBS_MCountry_DB;
import DB.GBS_MProduct_DB;
import DB.GBS_MSubsidiary_DB;
import DataBean.GBS_MCountry_stBean;
import DataBean.GBS_LittleCountry_stBean;
public class GBS_ProductAvailabilityConditionActionLogic implements SystemConstants {
private DataSource datasource = null;
/**
* trans datasource to db
* @param datasource
*/
public GBS_ProductAvailabilityConditionActionLogic(DataSource datasource) {
this.datasource = datasource;
}
/**
* get country code and name list from DB
* @return ArrayList
* @exception ExceptionException for information of other errors
* @since 2004/08/02
* @author Gxk
*/
public ReturnValue getCountryList()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 );
}
return returnValue;
}
/**
* get product code and name list from DB
* @return ArrayList
* @exception ExceptionException for information of other errors
* @since 2004/08/03
* @author Gxk
*/
public ReturnValue getProductList()throws Exception{
GBS_MProduct_DB DB = new GBS_MProduct_DB(this.datasource);
return DB.getProductCodeNameList();
}
/**
* get Subsidiary code and name list from DB
* @return ArrayList
* @exception ExceptionException for information of other errors
* @since 2004/08/03
* @author Gxk
*/
public ReturnValue getSubsidiaryList()throws Exception{
GBS_MSubsidiary_DB DB = new GBS_MSubsidiary_DB(this.datasource);
return DB.getSubsidiaryCodeNameList();
}
/**
* get the country and producd info from DB.M_COUNTRY_PRODUCT_R
* @param colorCpm String
* @param bwCpm String
* @param fax String
* @param printer String
* @param cpmFrom String
* @param cpmTo String
* @param subsidiary String[]
* @param country String[]
* @param product String[]
* @return ReturnValue
* @exception Exception Exception for information of other errors
* @author gxk
* @since 2004/08/03
*/
public ReturnValue getCountryProductInfo(String colorCpm,String bwCpm,String fax,String printer,String cpmFrom,String cpmTo,
String subsidiary[],String country[],String product[])throws Exception{
GBS_MCountryProductR_DB DB = new GBS_MCountryProductR_DB(this.datasource);
return DB.selectCountryProductInfo(colorCpm,bwCpm,fax,printer,cpmFrom,cpmTo,subsidiary,country,product,"1",null);
}
/**
* get Attachment file from db by productID
* @param String strProductID
* @param HttpServletResponse response
* @return ReturnValue
* @throws Exception
* @author gxk
* @since 20040816
*/
public ReturnValue getAttachmentFile( String strProductID,HttpServletResponse response)throws Exception{
GBS_MProduct_DB Product_DB = new GBS_MProduct_DB(this.datasource);
return Product_DB.getAttachmentFile( strProductID,response);
}
//Delete by Gxk 2004/08/23
// /**
// * get product code and name list by sql
// * @param String productId
// * @return boolean
// * @exception ExceptionException for information of other errors
// * @since 2004/08/04
// * @author Gxk
// */
// public ReturnValue getCanDownload(String productId) throws Exception {
// GBS_MProduct_DB Product_DB = new GBS_MProduct_DB(this.datasource);
// return Product_DB.getCanDownload( productId );
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -