<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__aJYOKAulxFNbc2IrmSG">
  <name>保存</name>
  <parentId>__eDEGIasKvMsg6wZKMH3</parentId>
  <type>13</type>
  <onActionForm></onActionForm>
  <onActionView></onActionView>
  <onActionFlow></onActionFlow>
  <onActionPrint></onActionPrint>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[//在表单控件值脚本中获取当前文档对象
(function(){
var doc=getCurrentDocument();
var trainRuleName = getItemValueAsString("trainRuleName");
var trainType = getItemValueAsString("trainType");
var trainOnlineType = getItemValueAsString("trainOnlineType");
var onlineLessonType = getItemValueAsString("onlineLessonType");
var onlineLessonName = getItemValueAsString("onlineLessonName");
var onlineLessonPrice = getItemValueAsInt("onlineLessonPrice");
var timingVerifyType = getItemValueAsString("timingVerifyType");
var timingVerifyInterval = getItemValueAsInt("timingVerifyInterval");
var collectPictureType = getItemValueAsString("collectPictureType");
var collectPictureInterval = getItemValueAsInt("collectPictureInterval");
var trainOfflineType = getItemValueAsString("trainOfflineType");
var practiceType = getItemValueAsString("practiceType");
var practiceCompleteType = getItemValueAsString("practiceCompleteType");
var practiceMinDay = getItemValueAsInt("practiceMinDay");
var practiceMaxDay = getItemValueAsInt("practiceMaxDay");
var practiceMinHour = getItemValueAsInt("practiceMinHour");
var practiceMaxHour = getItemValueAsInt("practiceMaxHour");
var practiceCheckType = getItemValueAsString("practiceCheckType");
var openClassType = getItemValueAsString("openClassType");
var openClassCompleteType = getItemValueAsString("openClassCompleteType");
var informStudentType = getItemValueAsString("informStudentType");

if(trainRuleName==null || trainRuleName.trim().length()<=0) {
    return "培训名称必须填写！";
}
if(trainType==null || trainType.trim().length()<=0) {
    return "培训分类必须填写！";
}

if(trainOnlineType == '1' && onlineLessonType == '1'){
  if(onlineLessonName==null || onlineLessonName.trim().length()<=0) {
    return "在线课程必须选择！";
  }
  if(onlineLessonPrice==0) {
    return "课程价格必须填写！";
  }
  if(timingVerifyType == "1" && timingVerifyInterval == 0){
  	return "定时观看确认间隔必须填写！";
  }
  if(collectPictureType == "1" && collectPictureInterval == 0){
  	return "随机人脸识别间隔必须填写！";
  }
}

if(trainOfflineType == '1' && practiceType == '1'){
  if(practiceMinDay==0) {
    return "实习合格最小天数必须填写！";
  }
  if(practiceMaxDay==0) {
    return "实习合格最大天数必须填写！";
  }
  if(practiceMinHour==0) {
    return "实习合格最小小时数必须填写！";
  }
  if(practiceMaxHour==0) {
    return "实习合格最大小时数必须填写！";
  }

}

})()]]></beforeActionScript>
  <afterActionScript><![CDATA[]]></afterActionScript>
  <retractBeforeActionScript><![CDATA[]]></retractBeforeActionScript>
  <retractAfterActionScript><![CDATA[]]></retractAfterActionScript>
  <hiddenScript><![CDATA[]]></hiddenScript>
  <readonlyScript><![CDATA[]]></readonlyScript>
  <startFlowScript><![CDATA[							]]></startFlowScript>
  <editMode>0</editMode>
  <flowShowType>表单中显示流程操作</flowShowType>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <orderno>1</orderno>
  <stateToShow></stateToShow>
  <parentView></parentView>
  <parentForm>__eDEGIasKvMsg6wZKMH3</parentForm>
  <impmappingconfigid>__7tkXQ8UWGSqrTJkHtCB</impmappingconfigid>
  <jumpType>0</jumpType>
  <expSub>false</expSub>
  <icon></icon>
  <disableFlowNode>true</disableFlowNode>
  <changeFlowOperator>true</changeFlowOperator>
  <changeFlowCc>true</changeFlowCc>
  <multiLanguageLabel></multiLanguageLabel>
  <dispatcherMode>0</dispatcherMode>
  <dispatcherUrl><![CDATA[]]></dispatcherUrl>
  <dispatcherParams><![CDATA[]]></dispatcherParams>
  <jumpMode>0</jumpMode>
  <jumpActOpenType>0</jumpActOpenType>
  <withOld>false</withOld>
  <actionType>1</actionType>
  <actionDispatcherUrlScript><![CDATA[]]></actionDispatcherUrlScript>
  <actionSelection>0</actionSelection>
  <relatedFormId>选择</relatedFormId>
  <actionScript><![CDATA[//在表单控件值脚本中获取当前文档对象
#include "getDsName"
(function(){
var trainRuleId = getItemValueAsString("trainRuleId");
var lessonId = getItemValueAsString("lessonId");
var onlineId = getItemValueAsString("onlineId");
var offlineId = getItemValueAsString("offlineId");
var trainRuleName = getItemValueAsString("trainRuleName");
var trainType = getItemValueAsString("trainType");
var trainOnlineType = getItemValueAsString("trainOnlineType");
var onlineLessonType = getItemValueAsString("onlineLessonType");
var onlineLessonId = getItemValueAsString("onlineLessonId");
var onlineLessonName = getItemValueAsString("onlineLessonName");
var onlineLessonPrice = getItemValueAsInt("onlineLessonPrice");
var studyRequireType = getItemValueAsString("studyRequireType");
var speedPlayType = getItemValueAsString("speedPlayType");
var multiplierSpeedPlayType = getItemValueAsString("multiplierSpeedPlayType");
var timingVerifyType = getItemValueAsString("timingVerifyType");
var timingVerifyInterval = getItemValueAsInt("timingVerifyInterval");
var collectPictureType = getItemValueAsString("collectPictureType");
var collectPictureInterval = getItemValueAsInt("collectPictureInterval");
var faceRecognitionType = getItemValueAsString("faceRecognitionType");
var liveType = getItemValueAsString("liveType");
var trainOfflineType = getItemValueAsString("trainOfflineType");
var practiceType = getItemValueAsString("practiceType");
var practiceCompleteType = getItemValueAsString("practiceCompleteType");
var practiceMinDay = getItemValueAsInt("practiceMinDay");
var practiceMaxDay = getItemValueAsInt("practiceMaxDay");
var practiceMinHour = getItemValueAsInt("practiceMinHour");
var practiceMaxHour = getItemValueAsInt("practiceMaxHour");
var practiceCheckType = getItemValueAsString("practiceCheckType");
var openClassType = getItemValueAsString("openClassType");
var openClassCompleteType = getItemValueAsString("openClassCompleteType");
var informStudentType = getItemValueAsString("informStudentType");

var userName= getWebUser().getName(); 
var dsName = getDsName();
//try {

  var process = getDocProcess(getApplication());//Document 操作类
  var trainRuleInfoDoc = findDocument(trainRuleId);
  trainRuleInfoDoc.findItem("trainRuleName").setValue(trainRuleName);
  trainRuleInfoDoc.findItem("trainType").setValue(trainType);

  var trainLessonInfoDoc = findDocument(lessonId);  
  trainLessonInfoDoc.findItem("onlineLessonId").setValue(onlineLessonId);
  trainLessonInfoDoc.findItem("onlineLessonName").setValue(onlineLessonName);
  trainLessonInfoDoc.findItem("onlineLessonPrice").setValue(onlineLessonPrice);
     
  var trainOnlineInfoDoc = findDocument(onlineId);     
  trainOnlineInfoDoc.findItem("trainOnlineType").setValue(trainOnlineType);
  trainOnlineInfoDoc.findItem("studyRequireType").setValue(studyRequireType);
  trainOnlineInfoDoc.findItem("onlineLessonType").setValue(onlineLessonType);
  trainOnlineInfoDoc.findItem("speedPlayType").setValue(speedPlayType);
  trainOnlineInfoDoc.findItem("multiplierSpeedPlayType").setValue(multiplierSpeedPlayType);
  trainOnlineInfoDoc.findItem("timingVerifyType").setValue(timingVerifyType);
  trainOnlineInfoDoc.findItem("timingVerifyInterval").setValue(timingVerifyInterval);
  trainOnlineInfoDoc.findItem("collectPictureType").setValue(collectPictureType);
  trainOnlineInfoDoc.findItem("collectPictureInterval").setValue(collectPictureInterval);
  trainOnlineInfoDoc.findItem("faceRecognitionType").setValue(faceRecognitionType);
  trainOnlineInfoDoc.findItem("liveType").setValue(liveType);
 
  var trainOfflineInfoDoc = findDocument(offlineId);   
  trainOfflineInfoDoc.findItem("trainOfflineType").setValue(trainOfflineType);
  trainOfflineInfoDoc.findItem("practiceType").setValue(practiceType);
  trainOfflineInfoDoc.findItem("practiceCompleteType").setValue(practiceCompleteType);
  trainOfflineInfoDoc.findItem("practiceMinDay").setValue(practiceMinDay);
  trainOfflineInfoDoc.findItem("practiceMaxDay").setValue(practiceMaxDay);
  trainOfflineInfoDoc.findItem("practiceMinHour").setValue(practiceMinHour);
  trainOfflineInfoDoc.findItem("practiceMaxHour").setValue(practiceMaxHour);
  trainOfflineInfoDoc.findItem("practiceCheckType").setValue(practiceCheckType);
  trainOfflineInfoDoc.findItem("openClassType").setValue(openClassType);
  trainOfflineInfoDoc.findItem("openClassCompleteType").setValue(openClassCompleteType);
  trainOfflineInfoDoc.findItem("informStudentType").setValue(informStudentType);

  beginTransaction(dsName);  
  process.doUpdate(trainRuleInfoDoc); 
  process.doUpdate(trainLessonInfoDoc); 
  process.doUpdate(trainOnlineInfoDoc); 
  process.doUpdate(trainOfflineInfoDoc); 
  commitTransaction(dsName);                       
//} catch(e) {
//  println("异常信息==>" + e);
//  rollbackTransaction(dsName);     
//  return "保存失败，请稍后重试！";    
//}   
})()]]></actionScript>
  <workFlowType>0</workFlowType>
  <isneedcomment>0</isneedcomment>
  <contextMenu>true</contextMenu>
  <showInToolbar>true</showInToolbar>
  <transpond>选择</transpond>
  <targetList>__CN6FfOy3AMjvnZSjrW8|</targetList>
  <label><![CDATA[]]></label>
</activity>