/**
 * @(#)file    UserListBiz.java
 * @(#)author  [개발자명]
 * @(#)version 1.0
 * @(#)date    May 3, 2007
 * @(#)since   JDK 1.4.2
 */
package kr.co.udapsoft.ebid.buyer.sycs.security.biz;

import kr.co.hsnc.common.sql.Row;
import kr.co.hsnc.common.sql.RowImpl;
import kr.co.hsnc.common.sql.RowSet;
import kr.co.hsnc.common.sql.RowSetImpl;
import kr.co.hsnc.common.sql.WAFSQLException;
import kr.co.hsnc.common.sql.search.Search;
import kr.co.hsnc.common.sql.search.SearchImpl;
import kr.co.hsnc.common.sql.util.RowSetUtility;
import kr.co.hsnc.common.util.ValueObject;
import com.udapsoft.modular.web.ibsheet7.IBSheet7Factory;
import com.udapsoft.modular.web.ibsheet7.util.IBSheet7Utils;
import com.udapsoft.waf.system.Biz;
import com.udapsoft.waf.system.HandlerStorage;


public class ExceptionalUserInitBiz extends Biz {

	public ExceptionalUserInitBiz(HandlerStorage storage) {
		super(storage);
	}

	/* (non-Javadoc)
	 * @see kr.co.hwenc.system.Biz#doBiz()
	 */
	public void doBiz() throws Exception {
		
		RowSet positionRowSet = getPositionList(params);
		
		String selectText = "";
		String selectValue = "";
		
		for(int i=0; i<positionRowSet.size(); i++){
			Row row = positionRowSet.getRow(i);
			String code  =  row.get("GRADE_CODE");
			code = code.trim();
			String value =  row.get("GRADE_NAME");
			value = value.trim();
			
			if(selectText.equals("")){
				selectText = code;
				selectValue = value;
			}else{
				selectText = selectText + "|" + code; 
				selectValue = selectValue + "|" + value; 
			}
		}
		
		storage.addObject("selectText", selectText);
		storage.addObject("selectValue", selectValue);
	}

	private RowSet getPositionList(ValueObject Params) {
		
        Search search = new SearchImpl();
        RowSet rowSet = new RowSetImpl();
        RowSet retrowSet = new RowSetImpl();
        String sqlstr = "";  
        try {
        	
        	sqlstr += "   SELECT DISTINCT GRADE_CODE, GRADE_NAME, DECODE(SUBSTR(GRADE_CODE,1,1), '1', '0', '9') AS ORDERSEQ                      \n"
                + "       FROM PUB0120T WHERE GRADE_CODE IS NOT NULL ORDER BY ORDERSEQ ASC, GRADE_CODE DESC                                      \n";
            
        	search.setStatement(sqlstr);
            rowSet = search.execute();
            
            ValueObject vo = new ValueObject();
            RowSetUtility rsu = new RowSetUtility();
            
			String reg = null;
			String telno = null;
			String hpno = null;
        }
        catch (WAFSQLException se) {
            super.doException(se);
            this.storage.setSuccess(false);
            this.storage.setMessage(se.getMessage());
            storage.setDetailMessage(se);
        }catch (Exception e){
        	 super.doException(e);
             this.storage.setSuccess(false);
             this.storage.setMessage(e.getMessage());
             storage.setDetailMessage(e);
        }
        finally {    
            if(rowSet == null) rowSet = new RowSetImpl();
            return rowSet;
        }
	}
		
	
}
