码迷,mamicode.com
首页 > 其他好文 > 详细

Aras Innovator时间验证

时间:2014-12-26 14:31:52      阅读:280      评论:0      收藏:0      [点我收藏+]

标签:

//方法名:bcs_Nexteer_CheckTime
//功能描述:开始和结束日期对比
//原作者:joe
//创建时间:20141226
//版权所有(C)JOE.FAN
//debugger;
//--------------------------------------------------------
var startPropNm = "start_time";
var duePropNm = "end_time";
var curNm = this.name;
var dualNm = (curNm == duePropNm ? startPropNm : duePropNm);
var dualVal = top.aras.getItemProperty(document.item, dualNm);
var newDate = top.aras.getItemProperty(document.item, curNm);
var sign2Compare = (curNm == duePropNm ? -1 : 1);
var errMsg = (curNm == duePropNm ? "结束时间不能早于开始时间" : "开始时间不能晚于结束时间");
var prevValsHashKey = "prevValsHashKey_7984655F176B40388EBBC2F3A8D750D2";
var doBckpDts = true;
if (newDate)
{
if (dualVal)
{
if (sign2Compare * top.compareDates(newDate, dualVal) > 0)
{
top.aras.AlertError(errMsg);
var backupVal = (document[prevValsHashKey] ? document[prevValsHashKey][curNm] : "");
if (!backupVal) {backupVal = "";}
top.aras.setItemProperty(document.item, curNm, backupVal);
doBckpDts = false;
}
}
else
{
var newDualVal = (curNm == duePropNm ? top.decDateToFirstWorking(newDate) : top.incDateToFirstWorking(newDate));
top.aras.setItemProperty(document.item, dualNm, newDualVal);
}
}
if (doBckpDts)
{
if (!document[prevValsHashKey]) {document[prevValsHashKey] = new Object();}
document[prevValsHashKey][curNm] = newDate;
document[prevValsHashKey][dualNm] = dualVal;
}
var form = document.forms.MainDataForm;
if (!form) {return false;}
top.aras.uiPopulateFormWithItemEx(form, document.item, document.itemType, document.isEditMode);

Aras Innovator时间验证

标签:

原文地址:http://www.cnblogs.com/fanxingthink/p/4186537.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!