package com.gx.obe.management.action;

import org.eclipse.swt.SWT;
import org.eclipse.swt.core.MessageDialog;

import com.gx.obe.action.bean.Action;
import com.gx.obe.action.listener.ActionListener;
import com.gx.obe.management.composite.EvaluationStepProgressComposite;
import com.gx.obe.message.Messages;
import com.gx.obe.web.entity.tender.TenderProjectEntity;
import com.gx.obe.web.service.evaluation.EvaluationStepService;

/**
 * @Description: 评标进度管理
 * @author guoyr
 */
public class LoadEvaluationStepProgressAction extends Action{

	public void run() {
		ActionListener listener = this.getListener();
		TenderProjectEntity tenderProjectEntity = this.getTenderProject();
		if (null != tenderProjectEntity) {
			boolean hasNode = new EvaluationStepService().isHasEvaluationStep(tenderProjectEntity.getId());
			if (!hasNode) {
				MessageDialog.openWarning(listener.getParentComposite().getShell(), Messages.Tips_creatEvalStep);
				return ;
			}
			listener.onLoad(this);
			if (hasNode) {
				listener.loadComposite(this, new EvaluationStepProgressComposite(listener.getParentComposite(), this, SWT.NONE));
			} else {
				
			}
		}
		
	}
}
