package com.seeyon.apps.src_ydctdatasync.utils;

import com.seeyon.ctp.common.AppContext;
import com.seeyon.ctp.services.ServiceException;
import com.seeyon.v3x.services.form.FormFactory;
import com.seeyon.v3x.services.form.bean.FormExport;

public class DataInsertWithFormUtils {
	private FormFactory formFactory;

	public FormFactory getFormFactory() {
		if (formFactory == null) {
			formFactory = (FormFactory) AppContext.getBean("formFactory");
		}
		return formFactory;
	}

	public void setFormFactory(FormFactory formFactory) {
		this.formFactory = formFactory;
	}
	
	/**
	 * 
	 * @param loginName 登录名
	 * @param formNo 表单模板编号
	 * @param formExport 要插入的表单数据
	 */
	public void dataInsert(String loginName , String formNo , FormExport formExport) {
		try {
			getFormFactory().importBusinessFormData(loginName, formNo,
			        formExport, new String[] {});
		} catch (ServiceException e) {
			
		}
	}
}
