package com.gx.obe.evaluation.step.resutl.action;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;

import com.gx.obe.action.bean.Action;
import com.gx.obe.action.listener.ActionListener;
import com.gx.obe.components.core.Constants;
import com.gx.obe.evaluation.step.resutl.composite.MultiRoundsPriceResultComposite;
import com.gx.obe.evaluation.step.review.composite.RemoteMultiRoundsPriceComposite;
import com.gx.obe.web.entity.evaluation.EvaluationStep;
import com.gx.obe.web.entity.tender.TenderProjectEntity;
import com.gx.obe.web.entity.tender.TenderProjectRuleEntity;
/**
 * @Description: 多轮报价评审
 * @author guoyr
 */
public class MultiWheelPriceEvaluationResultAction extends Action {
		
	public void run() {
		ActionListener actionListener = this.getListener();
		if(null != actionListener){
			actionListener.onLoad(this);
			TenderProjectEntity tenderProjectEntity = this.getTenderProject();//(TenderProjectEntity)this.getData("tenderProjectEntity");
			EvaluationStep evaluationStep = this.getEvaluationStep();//(EvaluationStep)this.getData("evaluationStep");
			Boolean result = (Boolean)this.getData("result");
			TenderProjectRuleEntity tenderProjectRuleEntity = this.getTenderProjectRule();//(TenderProjectRuleEntity)this.getData("tenderProjectRuleEntity");
			Composite composite = actionListener.getParentComposite();
			if(com.gx.obe.components.core.enumeration.EvaluationStepEnum.REMOTE.equals(evaluationStep.getEvaluationParamByKey("BidPriceSource"))){
				composite.setData("result", true);
				RemoteMultiRoundsPriceComposite evaluationComposite = new RemoteMultiRoundsPriceComposite(composite, this, SWT.NONE);
				actionListener.loadComposite(this, evaluationComposite);
			}else{
				MultiRoundsPriceResultComposite evaluationResultComposite = new MultiRoundsPriceResultComposite(composite, SWT.NONE);
				evaluationResultComposite.refresh(tenderProjectEntity, tenderProjectRuleEntity, evaluationStep, (String)this.getData(Constants.OPERATOR_USERID));
				actionListener.loadComposite(this, evaluationResultComposite);
			}
		}
	}
}
