/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / /标题:工作指雷竞技app令-类型检查/ /作者:侥幸校准/ /日期:2016-03-01 / / / /这个数据检查验证/ /资产的类型是否记录是不活跃的,/ /和纠正类型不匹配/ /工作秩序和资产。/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / * SQL函数1:GetTypeInfo选择c。lClosed c。nTypeUID csTypeUID, a。nTypeUID aTypeUID, t。从dbo lActive。CallSheets c内连接dbo。资产在c。nAssetUID =。nAssetUID内连接dbo。类型t上。nTypeUID = t。nTypeUID c。nCallSheetUID = strUID * / / /抓住DataCheck类型信息。ExecuteSQL (GetTypeInfo,函数(结果){/ /如果工作订单关闭,如果结果([0]。lClosed ! = 0){通过();返回;}/ /如果有工作订单/资产类型不匹配,修复工作订单如果结果[0]。csTypeUID ! =结果[0]{DataCheck .aTypeUID)。Alert('Attention', 'A correction was made to fix a type ' + 'record mismatch between this work order and its ' + 'asset.', function() { DataCheck.SetValue('nTypeUID', result[0].aTypeUID); DataCheck.SetValue('nProcedureUID', undefined); DataCheck.SetValue('nTypeProcedureDefaultUID', undefined); if (result[0].lActive == 0) DataCheck.Alert('Attention', 'This work order cannot be saved ' + 'because its type is inactive.', function() {fail();}); else pass(); }); } else { // If the type is inactive, fail. if (result[0].lActive == 0) DataCheck.Alert('Attention', 'This work order cannot be saved ' + 'because its type is inactive.', function() {fail();}); else pass(); } });