package com.connor.erp.ItemAddTransferSendToERP;

import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;

public class SendToERPHandler extends AbstractHandler {
  public Object execute(ExecutionEvent event) {
    AbstractAIFUIApplication application = AIFUtility.getCurrentApplication();
    TCSession session = (TCSession)application.getSession();
    try {
      SendToERPCommand command = new SendToERPCommand(session, application);
      try {
        command.executeModal();
      } catch (Exception e) {
        e.printStackTrace();
      } 
    } catch (TCException e1) {
      e1.printStackTrace();
    } 
    return null;
  }
}