Contract :
[
DataContractAttribute
, SysOperationGroupAttribute('Date', "Period", '1')
,SysOperationContractProcessingAttribute(classStr(ICDOCCollectorInformationUIBuilder))
]
public class ICDOCCollectorInformationContract //implements SysOperationValidatable
{
boolean ExecuteZero;
FromDate fromDate;
ToDate toDate;
Name dimension;
AgentCode agentCode;
Branch Branch;
}
[
DataMemberAttribute('FromDate'),
//SysOperationLabelAttribute(literalstr("@SYS68117")),
SysOperationGroupMemberAttribute('Date'),
//SysOperationGroupMemberAttribute('Bid Submission Date'),
SysOperationDisplayOrderAttribute('1')
]
public FromDate parmFromDate(FromDate _fromDate = fromDate)
{
fromDate = _fromDate;
return fromDate;
}
[
DataMemberAttribute('ToDate'),
//SysOperationLabelAttribute(literalstr("@SYS68118")),
SysOperationGroupMemberAttribute('Date'),
//SysOperationGroupMemberAttribute('Bid Submission Date'),
SysOperationDisplayOrderAttribute('2')
]
public ToDate parmToDate(ToDate _toDate = toDate)
{
toDate = _toDate;
return toDate;
}
public boolean validate()
{
boolean isValid = true;
if(!fromDate)
{
isValid = checkFailed("@SYS97591");
}
if(!toDate)
{
isValid = checkFailed("@SYS97592");
}
if(fromDate && toDate)
{
if(fromDate > toDate)
{
isValid = checkFailed("@SYS120590");
}
}
return isValid;
}
Note: if we extend the class with " implements SysOperationValidatable" then we have to write the validate method compursary
No comments:
Post a Comment