List of usage examples for org.apache.commons.lang3.mutable MutableDouble doubleValue
@Override public double doubleValue()
From source file:com.quinsoft.swauopencuas.mSARuleS_Object.java
public int omSARuleS_dGetColCalcAward(View mSARuleS, String InternalEntityStructure, String InternalAttribStructure, Integer GetOrSetFlag) { double dMinAward = 0.0; //:DECIMAL dAwardAmount double dAwardAmount = 0.0; //:DECIMAL dValue double dValue = 0.0; //:DECIMAL dNewValue double dNewValue = 0.0; //:STRING ( 64 ) szView String szView = null;//from www .jav a 2 s . co m //:STRING ( 64 ) szEntity String szEntity = null; //:STRING ( 64 ) szAttribute String szAttribute = null; //:STRING ( 64 ) szAttrType String szAttrType = null; //:STRING ( 2000 ) szValue String szValue = null; //:STRING ( 1 ) szUseMult String szUseMult = null; //:VIEW vAnyView zVIEW vAnyView = new zVIEW(); int lTempInteger_0 = 0; int lTempInteger_1 = 0; int lTempInteger_2 = 0; int lTempInteger_3 = 0; int lTempInteger_4 = 0; int lTempInteger_5 = 0; int RESULT = 0; //:szUseMult = "" { StringBuilder sb_szUseMult; if (szUseMult == null) sb_szUseMult = new StringBuilder(32); else sb_szUseMult = new StringBuilder(szUseMult); ZeidonStringCopy(sb_szUseMult, 1, 0, "", 1, 0, 2); szUseMult = sb_szUseMult.toString(); } //:dMinAward = 0 dMinAward = 0; //:CASE GetOrSetFlag switch (GetOrSetFlag) { //:OF zDERIVED_GET: case zDERIVED_GET: //:szUseMult = mSARuleS.SACalcLookupColumn.UseAmountAsMultiplier { MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0); StringBuilder sb_szUseMult; if (szUseMult == null) sb_szUseMult = new StringBuilder(32); else sb_szUseMult = new StringBuilder(szUseMult); GetVariableFromAttribute(sb_szUseMult, mi_lTempInteger_0, 'S', 2, mSARuleS, "SACalcLookupColumn", "UseAmountAsMultiplier", "", 0); lTempInteger_0 = mi_lTempInteger_0.intValue(); szUseMult = sb_szUseMult.toString(); } //:dMinAward = mSARuleS.SACalcLookupColumn.MinimumAwardAmount { MutableDouble md_dMinAward = new MutableDouble(dMinAward); GetDecimalFromAttribute(md_dMinAward, mSARuleS, "SACalcLookupColumn", "MinimumAwardAmount"); dMinAward = md_dMinAward.doubleValue(); } //:szAttrType = mSARuleS.SACalcLookupColumn.QualAttributeType { MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1); StringBuilder sb_szAttrType; if (szAttrType == null) sb_szAttrType = new StringBuilder(32); else sb_szAttrType = new StringBuilder(szAttrType); GetVariableFromAttribute(sb_szAttrType, mi_lTempInteger_1, 'S', 65, mSARuleS, "SACalcLookupColumn", "QualAttributeType", "", 0); lTempInteger_1 = mi_lTempInteger_1.intValue(); szAttrType = sb_szAttrType.toString(); } //:// see what type the attribute is. //:IF szAttrType = "S" if (ZeidonStringCompare(szAttrType, 1, 0, "S", 1, 0, 65) == 0) { //:szValue = mSARuleS.SACalcLookupRow.AwardAmount { MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2); StringBuilder sb_szValue; if (szValue == null) sb_szValue = new StringBuilder(32); else sb_szValue = new StringBuilder(szValue); GetVariableFromAttribute(sb_szValue, mi_lTempInteger_2, 'S', 2001, mSARuleS, "SACalcLookupRow", "AwardAmount", "", 0); lTempInteger_2 = mi_lTempInteger_2.intValue(); szValue = sb_szValue.toString(); } //:StoreStringInRecord( mSARuleS, InternalEntityStructure, //: InternalAttribStructure, szValue ) StoreStringInRecord(mSARuleS, InternalEntityStructure, InternalAttribStructure, szValue); //:ELSE } else { //:IF szUseMult != "Y" if (ZeidonStringCompare(szUseMult, 1, 0, "Y", 1, 0, 2) != 0) { //:dAwardAmount = mSARuleS.SACalcLookupColumn.AwardAmount { MutableDouble md_dAwardAmount = new MutableDouble(dAwardAmount); GetDecimalFromAttribute(md_dAwardAmount, mSARuleS, "SACalcLookupColumn", "AwardAmount"); dAwardAmount = md_dAwardAmount.doubleValue(); } //:StoreValueInRecord( mSARuleS, InternalEntityStructure, //: InternalAttribStructure, dAwardAmount, 0 ) StoreValueInRecord(mSARuleS, InternalEntityStructure, InternalAttribStructure, dAwardAmount, 0); //:ELSE } else { //:// get the values we are looking for //:szView = mSARuleS.SACalcLookupColumn.QualViewName { MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3); StringBuilder sb_szView; if (szView == null) sb_szView = new StringBuilder(32); else sb_szView = new StringBuilder(szView); GetVariableFromAttribute(sb_szView, mi_lTempInteger_3, 'S', 65, mSARuleS, "SACalcLookupColumn", "QualViewName", "", 0); lTempInteger_3 = mi_lTempInteger_3.intValue(); szView = sb_szView.toString(); } //:szEntity = mSARuleS.SACalcLookupColumn.QualEntityName { MutableInt mi_lTempInteger_4 = new MutableInt(lTempInteger_4); StringBuilder sb_szEntity; if (szEntity == null) sb_szEntity = new StringBuilder(32); else sb_szEntity = new StringBuilder(szEntity); GetVariableFromAttribute(sb_szEntity, mi_lTempInteger_4, 'S', 65, mSARuleS, "SACalcLookupColumn", "QualEntityName", "", 0); lTempInteger_4 = mi_lTempInteger_4.intValue(); szEntity = sb_szEntity.toString(); } //:szAttribute = mSARuleS.SACalcLookupColumn.QualAttributeName { MutableInt mi_lTempInteger_5 = new MutableInt(lTempInteger_5); StringBuilder sb_szAttribute; if (szAttribute == null) sb_szAttribute = new StringBuilder(32); else sb_szAttribute = new StringBuilder(szAttribute); GetVariableFromAttribute(sb_szAttribute, mi_lTempInteger_5, 'S', 65, mSARuleS, "SACalcLookupColumn", "QualAttributeName", "", 0); lTempInteger_5 = mi_lTempInteger_5.intValue(); szAttribute = sb_szAttribute.toString(); } //:GET VIEW vAnyView NAMED szView RESULT = GetViewByName(vAnyView, szView, mSARuleS, zLEVEL_TASK); //:GetDecimalFromAttribute( dValue, vAnyView, szEntity, szAttribute ) { MutableDouble md_dValue = new MutableDouble(dValue); GetDecimalFromAttribute(md_dValue, vAnyView, szEntity, szAttribute); dValue = md_dValue.doubleValue(); } //:dAwardAmount = mSARuleS.SACalcLookupColumn.AwardAmount { MutableDouble md_dAwardAmount = new MutableDouble(dAwardAmount); GetDecimalFromAttribute(md_dAwardAmount, mSARuleS, "SACalcLookupColumn", "AwardAmount"); dAwardAmount = md_dAwardAmount.doubleValue(); } //:dNewValue = dValue * dAwardAmount dNewValue = dValue * dAwardAmount; //:IF dNewValue < dMinAward if (dNewValue < dMinAward) { //:dNewValue = dMinAward dNewValue = dMinAward; } //:END //:StoreValueInRecord( mSARuleS, InternalEntityStructure, //: InternalAttribStructure, dNewValue, 0 ) StoreValueInRecord(mSARuleS, InternalEntityStructure, InternalAttribStructure, dNewValue, 0); } //:END } //:END break; //: /* end zDERIVED_GET */ //:OF zDERIVED_SET: case zDERIVED_SET: break; } //: /* end zDERIVED_SET */ //:END /* case */ return (0); // END }
From source file:com.quinsoft.swauopencuas.mSARuleS_Object.java
public int omSARuleS_ApplyRule(View mSARuleS, View mSAProf, View mPerson) { zVIEW vAnyView = new zVIEW(); //:VIEW vTestView zVIEW vTestView = new zVIEW(); //:VIEW vCompareView zVIEW vCompareView = new zVIEW(); //:STRING ( 1024 ) szStringToCompare String szStringToCompare = null; //:DECIMAL dValueToCompare double dValueToCompare = 0.0; //:STRING ( 64 ) szView String szView = null;//from ww w.j a va2 s. co m //:STRING ( 64 ) szEntity String szEntity = null; //:STRING ( 64 ) szAttribute String szAttribute = null; //:STRING ( 1 ) szAttrType String szAttrType = null; //:STRING ( 10 ) szOper String szOper = null; //:STRING ( 64 ) szViewValue String szViewValue = null; //:STRING ( 64 ) szRootEntity String szRootEntity = null; //:STRING ( 64 ) szEntityValue String szEntityValue = null; //:STRING ( 64 ) szAttributeValue String szAttributeValue = null; //:STRING ( 64 ) szMess String szMess = null; //:INTEGER nCompareResult int nCompareResult = 0; //:INTEGER nCompareResult2 int nCompareResult2 = 0; //:INTEGER nRC int nRC = 0; //:INTEGER nLoop int nLoop = 0; int lTempInteger_0 = 0; int lTempInteger_1 = 0; int lTempInteger_2 = 0; int lTempInteger_3 = 0; int lTempInteger_4 = 0; int lTempInteger_5 = 0; int lTempInteger_6 = 0; int lTempInteger_7 = 0; int RESULT = 0; //:/* //: NOTE: IsParentRule - (Y/N) is temporarily being used as a flag to determine if the rule we are attempting to //: apply is for the currently selected entity or can be for ANY twin entity. For example. If we wanted to see if //: any Class entity is being taken as an Audit, we would set IsParentRule = Y. That indicates to loop through the //: classes to see if any one matches. //:*/ //:// mSARuleS.StudentAccountRule.wQualTrue = "Y" //:// assume that the rule does NOT apply until we see otherwise. //:// get the values we are looking for //:szViewValue = mSARuleS.StudentAccountRule.QualViewValue { MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0); StringBuilder sb_szViewValue; if (szViewValue == null) sb_szViewValue = new StringBuilder(32); else sb_szViewValue = new StringBuilder(szViewValue); GetVariableFromAttribute(sb_szViewValue, mi_lTempInteger_0, 'S', 65, mSARuleS, "StudentAccountRule", "QualViewValue", "", 0); lTempInteger_0 = mi_lTempInteger_0.intValue(); szViewValue = sb_szViewValue.toString(); } //:szEntityValue = mSARuleS.StudentAccountRule.QualEntityValue { MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1); StringBuilder sb_szEntityValue; if (szEntityValue == null) sb_szEntityValue = new StringBuilder(32); else sb_szEntityValue = new StringBuilder(szEntityValue); GetVariableFromAttribute(sb_szEntityValue, mi_lTempInteger_1, 'S', 65, mSARuleS, "StudentAccountRule", "QualEntityValue", "", 0); lTempInteger_1 = mi_lTempInteger_1.intValue(); szEntityValue = sb_szEntityValue.toString(); } //:szAttributeValue = mSARuleS.StudentAccountRule.QualAttributeValue { MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2); StringBuilder sb_szAttributeValue; if (szAttributeValue == null) sb_szAttributeValue = new StringBuilder(32); else sb_szAttributeValue = new StringBuilder(szAttributeValue); GetVariableFromAttribute(sb_szAttributeValue, mi_lTempInteger_2, 'S', 65, mSARuleS, "StudentAccountRule", "QualAttributeValue", "", 0); lTempInteger_2 = mi_lTempInteger_2.intValue(); szAttributeValue = sb_szAttributeValue.toString(); } //:szView = mSARuleS.StudentAccountRule.QualViewName { MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3); StringBuilder sb_szView; if (szView == null) sb_szView = new StringBuilder(32); else sb_szView = new StringBuilder(szView); GetVariableFromAttribute(sb_szView, mi_lTempInteger_3, 'S', 65, mSARuleS, "StudentAccountRule", "QualViewName", "", 0); lTempInteger_3 = mi_lTempInteger_3.intValue(); szView = sb_szView.toString(); } //:szEntity = mSARuleS.StudentAccountRule.QualEntityName { MutableInt mi_lTempInteger_4 = new MutableInt(lTempInteger_4); StringBuilder sb_szEntity; if (szEntity == null) sb_szEntity = new StringBuilder(32); else sb_szEntity = new StringBuilder(szEntity); GetVariableFromAttribute(sb_szEntity, mi_lTempInteger_4, 'S', 65, mSARuleS, "StudentAccountRule", "QualEntityName", "", 0); lTempInteger_4 = mi_lTempInteger_4.intValue(); szEntity = sb_szEntity.toString(); } //:szAttribute = mSARuleS.StudentAccountRule.QualAttributeName { MutableInt mi_lTempInteger_5 = new MutableInt(lTempInteger_5); StringBuilder sb_szAttribute; if (szAttribute == null) sb_szAttribute = new StringBuilder(32); else sb_szAttribute = new StringBuilder(szAttribute); GetVariableFromAttribute(sb_szAttribute, mi_lTempInteger_5, 'S', 65, mSARuleS, "StudentAccountRule", "QualAttributeName", "", 0); lTempInteger_5 = mi_lTempInteger_5.intValue(); szAttribute = sb_szAttribute.toString(); } //:szAttrType = mSARuleS.StudentAccountRule.QualAttributeType { MutableInt mi_lTempInteger_6 = new MutableInt(lTempInteger_6); StringBuilder sb_szAttrType; if (szAttrType == null) sb_szAttrType = new StringBuilder(32); else sb_szAttrType = new StringBuilder(szAttrType); GetVariableFromAttribute(sb_szAttrType, mi_lTempInteger_6, 'S', 2, mSARuleS, "StudentAccountRule", "QualAttributeType", "", 0); lTempInteger_6 = mi_lTempInteger_6.intValue(); szAttrType = sb_szAttrType.toString(); } //:szOper = mSARuleS.StudentAccountRule.QualOperator { MutableInt mi_lTempInteger_7 = new MutableInt(lTempInteger_7); StringBuilder sb_szOper; if (szOper == null) sb_szOper = new StringBuilder(32); else sb_szOper = new StringBuilder(szOper); GetVariableFromAttribute(sb_szOper, mi_lTempInteger_7, 'S', 11, mSARuleS, "StudentAccountRule", "QualOperator", "", 0); lTempInteger_7 = mi_lTempInteger_7.intValue(); szOper = sb_szOper.toString(); } //:vAnyView = 0 vAnyView = null; //:IF szView = "mSAProf" if (ZeidonStringCompare(szView, 1, 0, "mSAProf", 1, 0, 65) == 0) { //:// CreateViewFromView( vAnyView, mSAProf ) //:vAnyView = mSAProf SetViewFromView(vAnyView, mSAProf); //:szRootEntity = "StudentAccountProfile" { StringBuilder sb_szRootEntity; if (szRootEntity == null) sb_szRootEntity = new StringBuilder(32); else sb_szRootEntity = new StringBuilder(szRootEntity); ZeidonStringCopy(sb_szRootEntity, 1, 0, "StudentAccountProfile", 1, 0, 65); szRootEntity = sb_szRootEntity.toString(); } //:ELSE } else { //:IF szView = "mPerson" if (ZeidonStringCompare(szView, 1, 0, "mPerson", 1, 0, 65) == 0) { //:// CreateViewFromView( vAnyView, mPerson ) //:vAnyView = mPerson SetViewFromView(vAnyView, mPerson); //:szRootEntity = "Person" { StringBuilder sb_szRootEntity; if (szRootEntity == null) sb_szRootEntity = new StringBuilder(32); else sb_szRootEntity = new StringBuilder(szRootEntity); ZeidonStringCopy(sb_szRootEntity, 1, 0, "Person", 1, 0, 65); szRootEntity = sb_szRootEntity.toString(); } //:ELSE } else { //:nRC = GetViewByName( vAnyView, szView, mSARuleS, zLEVEL_TASK ) nRC = GetViewByName(vAnyView, szView, mSARuleS, zLEVEL_TASK); //:IF nRC <= 0 if (nRC <= 0) { //:RETURN -1 if (8 == 8) return (-1); } //:END } //:END } //:END //:nRC = zLodContainsAttribute( vAnyView, szEntity, szAttribute ) nRC = zLodContainsAttribute(vAnyView, szEntity, szAttribute); //:IF nRC < 0 if (nRC < 0) { //:szMess = "Either " + szEntity + " or " + szAttribute + " does not exist " { StringBuilder sb_szMess; if (szMess == null) sb_szMess = new StringBuilder(32); else sb_szMess = new StringBuilder(szMess); ZeidonStringCopy(sb_szMess, 1, 0, "Either ", 1, 0, 65); szMess = sb_szMess.toString(); } { StringBuilder sb_szMess; if (szMess == null) sb_szMess = new StringBuilder(32); else sb_szMess = new StringBuilder(szMess); ZeidonStringConcat(sb_szMess, 1, 0, szEntity, 1, 0, 65); szMess = sb_szMess.toString(); } { StringBuilder sb_szMess; if (szMess == null) sb_szMess = new StringBuilder(32); else sb_szMess = new StringBuilder(szMess); ZeidonStringConcat(sb_szMess, 1, 0, " or ", 1, 0, 65); szMess = sb_szMess.toString(); } { StringBuilder sb_szMess; if (szMess == null) sb_szMess = new StringBuilder(32); else sb_szMess = new StringBuilder(szMess); ZeidonStringConcat(sb_szMess, 1, 0, szAttribute, 1, 0, 65); szMess = sb_szMess.toString(); } { StringBuilder sb_szMess; if (szMess == null) sb_szMess = new StringBuilder(32); else sb_szMess = new StringBuilder(szMess); ZeidonStringConcat(sb_szMess, 1, 0, " does not exist ", 1, 0, 65); szMess = sb_szMess.toString(); } //:mSARuleS.StudentAccountRule.wQualTrue = "N" SetAttributeFromString(mSARuleS, "StudentAccountRule", "wQualTrue", "N"); //:IssueError( mSARuleS, 0, 0, szMess ) IssueError(mSARuleS, 0, 0, szMess); //:RETURN -1 if (8 == 8) return (-1); } //:END //:CreateViewFromView( vTestView, vAnyView ) CreateViewFromView(vTestView, vAnyView); //:// see if we can find the entity //:nRC = SetCursorFirstEntity( vTestView, szEntity, "" ) nRC = SetCursorFirstEntity(vTestView, szEntity, ""); //:IF nRC < zCURSOR_SET if (nRC < zCURSOR_SET) { //:mSARuleS.StudentAccountRule.wQualTrue = "N" SetAttributeFromString(mSARuleS, "StudentAccountRule", "wQualTrue", "N"); //:DropView( vTestView ) DropView(vTestView); //:RETURN -1 if (8 == 8) return (-1); } //:END //:DropView( vTestView ) DropView(vTestView); //:IF mSARuleS.StudentAccountRule.ApplyToAny = "Y" // loop through for any if (CompareAttributeToString(mSARuleS, "StudentAccountRule", "ApplyToAny", "Y") == 0) { //:nLoop = SetCursorFirstEntity( vAnyView, szEntity, szRootEntity ) nLoop = SetCursorFirstEntity(vAnyView, szEntity, szRootEntity); //:LOOP WHILE ( nLoop >= zCURSOR_SET ) while (nLoop >= zCURSOR_SET) { //:IF szViewValue != "" if (ZeidonStringCompare(szViewValue, 1, 0, "", 1, 0, 65) != 0) { //:GET VIEW vCompareView NAMED szViewValue RESULT = GetViewByName(vCompareView, szViewValue, mSARuleS, zLEVEL_TASK); //:nCompareResult = //: CompareAttributeToAttribute( vCompareView, szEntityValue, szAttributeValue, //: vAnyView, szEntity, szAttribute ) nCompareResult = CompareAttributeToAttribute(vCompareView, szEntityValue, szAttributeValue, vAnyView, szEntity, szAttribute); //:ELSE } else { //:// see what type the attribute is. //:IF szAttrType = "S" if (ZeidonStringCompare(szAttrType, 1, 0, "S", 1, 0, 2) == 0) { //:GetStringFromAttribute( szStringToCompare, vAnyView, szEntity, szAttribute ) { StringBuilder sb_szStringToCompare; if (szStringToCompare == null) sb_szStringToCompare = new StringBuilder(32); else sb_szStringToCompare = new StringBuilder(szStringToCompare); GetStringFromAttribute(sb_szStringToCompare, vAnyView, szEntity, szAttribute); szStringToCompare = sb_szStringToCompare.toString(); } //:nCompareResult = //: CompareAttributeToString( mSARuleS, "StudentAccountRule", "QualStringValue", szStringToCompare ) nCompareResult = CompareAttributeToString(mSARuleS, "StudentAccountRule", "QualStringValue", szStringToCompare); //:ELSE } else { //:GetDecimalFromAttribute( dValueToCompare, vAnyView, szEntity, szAttribute ) { MutableDouble md_dValueToCompare = new MutableDouble(dValueToCompare); GetDecimalFromAttribute(md_dValueToCompare, vAnyView, szEntity, szAttribute); dValueToCompare = md_dValueToCompare.doubleValue(); } //:nCompareResult = //: CompareAttributeToDecimal( mSARuleS, "StudentAccountRule", "QualMinNumericValue", dValueToCompare ) nCompareResult = CompareAttributeToDecimal(mSARuleS, "StudentAccountRule", "QualMinNumericValue", dValueToCompare); //:nCompareResult2 = //: CompareAttributeToDecimal( mSARuleS, "StudentAccountRule", "QualMaxNumericValue", dValueToCompare ) nCompareResult2 = CompareAttributeToDecimal(mSARuleS, "StudentAccountRule", "QualMaxNumericValue", dValueToCompare); } //:END } //:END //:nRC = CompareResults( szOper, nCompareResult, nCompareResult2 ) nRC = omSARuleS_CompareResults(szOper, nCompareResult, nCompareResult2); //:IF nRC = 1 if (nRC == 1) { //://IF vAnyView != 0 //:// DropView( vAnyView ) //://END //:mSARuleS.StudentAccountRule.wQualTrue = "Y" SetAttributeFromString(mSARuleS, "StudentAccountRule", "wQualTrue", "Y"); //:RETURN 1 if (8 == 8) return (1); } //:END //:nLoop = SetCursorNextEntity( vAnyView, szEntity, szRootEntity ) nLoop = SetCursorNextEntity(vAnyView, szEntity, szRootEntity); } //:END //:IF nRC = -1 if (nRC == -1) { //://IF vAnyView != 0 //:// DropView( vAnyView ) //://END //:mSARuleS.StudentAccountRule.wQualTrue = "N" SetAttributeFromString(mSARuleS, "StudentAccountRule", "wQualTrue", "N"); //:RETURN -1 if (8 == 8) return (-1); } //:END //:ELSE } else { //:IF mSARuleS.StudentAccountRule.ApplyToAll = "Y" // loop through for any if (CompareAttributeToString(mSARuleS, "StudentAccountRule", "ApplyToAll", "Y") == 0) { //:nLoop = SetCursorFirstEntity( vAnyView, szEntity, szRootEntity ) nLoop = SetCursorFirstEntity(vAnyView, szEntity, szRootEntity); //:mSARuleS.StudentAccountRule.wQualTrue = "Y" SetAttributeFromString(mSARuleS, "StudentAccountRule", "wQualTrue", "Y"); //:IF ( nLoop != zCURSOR_SET ) if (nLoop != zCURSOR_SET) { //:mSARuleS.StudentAccountRule.wQualTrue = "N" SetAttributeFromString(mSARuleS, "StudentAccountRule", "wQualTrue", "N"); //:RETURN -1 if (8 == 8) return (-1); } //:END //:LOOP WHILE ( nLoop = zCURSOR_SET ) while (nLoop == zCURSOR_SET) { //:IF szViewValue != "" if (ZeidonStringCompare(szViewValue, 1, 0, "", 1, 0, 65) != 0) { //:GET VIEW vCompareView NAMED szViewValue RESULT = GetViewByName(vCompareView, szViewValue, mSARuleS, zLEVEL_TASK); //:nCompareResult = //: CompareAttributeToAttribute( vCompareView, szEntityValue, szAttributeValue, //: vAnyView, szEntity, szAttribute ) nCompareResult = CompareAttributeToAttribute(vCompareView, szEntityValue, szAttributeValue, vAnyView, szEntity, szAttribute); //:ELSE } else { //:// see what type the attribute is. //:IF szAttrType = "S" if (ZeidonStringCompare(szAttrType, 1, 0, "S", 1, 0, 2) == 0) { //:GetStringFromAttribute( szStringToCompare, vAnyView, szEntity, szAttribute ) { StringBuilder sb_szStringToCompare; if (szStringToCompare == null) sb_szStringToCompare = new StringBuilder(32); else sb_szStringToCompare = new StringBuilder(szStringToCompare); GetStringFromAttribute(sb_szStringToCompare, vAnyView, szEntity, szAttribute); szStringToCompare = sb_szStringToCompare.toString(); } //:nCompareResult = //: CompareAttributeToString( mSARuleS, "StudentAccountRule", "QualStringValue", szStringToCompare ) nCompareResult = CompareAttributeToString(mSARuleS, "StudentAccountRule", "QualStringValue", szStringToCompare); //:ELSE } else { //:GetDecimalFromAttribute( dValueToCompare, vAnyView, szEntity, szAttribute ) { MutableDouble md_dValueToCompare = new MutableDouble(dValueToCompare); GetDecimalFromAttribute(md_dValueToCompare, vAnyView, szEntity, szAttribute); dValueToCompare = md_dValueToCompare.doubleValue(); } //:nCompareResult = //: CompareAttributeToDecimal( mSARuleS, "StudentAccountRule", "QualMinNumericValue", dValueToCompare ) nCompareResult = CompareAttributeToDecimal(mSARuleS, "StudentAccountRule", "QualMinNumericValue", dValueToCompare); //:nCompareResult2 = //: CompareAttributeToDecimal( mSARuleS, "StudentAccountRule", "QualMaxNumericValue", dValueToCompare ) nCompareResult2 = CompareAttributeToDecimal(mSARuleS, "StudentAccountRule", "QualMaxNumericValue", dValueToCompare); } //:END } //:END //:nRC = CompareResults( szOper, nCompareResult, nCompareResult2 ) nRC = omSARuleS_CompareResults(szOper, nCompareResult, nCompareResult2); //:IF nRC != 1 if (nRC != 1) { //:mSARuleS.StudentAccountRule.wQualTrue = "N" SetAttributeFromString(mSARuleS, "StudentAccountRule", "wQualTrue", "N"); //:RETURN 1 if (8 == 8) return (1); } //:END //:nLoop = SetCursorNextEntity( vAnyView, szEntity, szRootEntity ) nLoop = SetCursorNextEntity(vAnyView, szEntity, szRootEntity); } //:END //:ELSE } else { //:IF szViewValue != "" if (ZeidonStringCompare(szViewValue, 1, 0, "", 1, 0, 65) != 0) { //:GET VIEW vCompareView NAMED szViewValue RESULT = GetViewByName(vCompareView, szViewValue, mSARuleS, zLEVEL_TASK); //:nCompareResult = //: CompareAttributeToAttribute( vCompareView, szEntityValue, szAttributeValue, //: vAnyView, szEntity, szAttribute ) nCompareResult = CompareAttributeToAttribute(vCompareView, szEntityValue, szAttributeValue, vAnyView, szEntity, szAttribute); //:ELSE } else { //:// see what type the attribute is. //:IF szAttrType = "S" if (ZeidonStringCompare(szAttrType, 1, 0, "S", 1, 0, 2) == 0) { //:GetStringFromAttribute( szStringToCompare, vAnyView, szEntity, szAttribute ) { StringBuilder sb_szStringToCompare; if (szStringToCompare == null) sb_szStringToCompare = new StringBuilder(32); else sb_szStringToCompare = new StringBuilder(szStringToCompare); GetStringFromAttribute(sb_szStringToCompare, vAnyView, szEntity, szAttribute); szStringToCompare = sb_szStringToCompare.toString(); } //:nCompareResult = //: CompareAttributeToString( mSARuleS, "StudentAccountRule", "QualStringValue", szStringToCompare ) nCompareResult = CompareAttributeToString(mSARuleS, "StudentAccountRule", "QualStringValue", szStringToCompare); //:ELSE } else { //:GetDecimalFromAttribute( dValueToCompare, vAnyView, szEntity, szAttribute ) { MutableDouble md_dValueToCompare = new MutableDouble(dValueToCompare); GetDecimalFromAttribute(md_dValueToCompare, vAnyView, szEntity, szAttribute); dValueToCompare = md_dValueToCompare.doubleValue(); } //:nCompareResult = //: CompareAttributeToDecimal( mSARuleS, "StudentAccountRule", "QualMinNumericValue", dValueToCompare ) nCompareResult = CompareAttributeToDecimal(mSARuleS, "StudentAccountRule", "QualMinNumericValue", dValueToCompare); //:nCompareResult2 = //: CompareAttributeToDecimal( mSARuleS, "StudentAccountRule", "QualMaxNumericValue", dValueToCompare ) nCompareResult2 = CompareAttributeToDecimal(mSARuleS, "StudentAccountRule", "QualMaxNumericValue", dValueToCompare); } //:END } //:END //://IF vAnyView != 0 //:// DropView( vAnyView ) //://END //:nRC = CompareResults( szOper, nCompareResult, nCompareResult2 ) nRC = omSARuleS_CompareResults(szOper, nCompareResult, nCompareResult2); //:IF nRC = 1 if (nRC == 1) { //:mSARuleS.StudentAccountRule.wQualTrue = "Y" SetAttributeFromString(mSARuleS, "StudentAccountRule", "wQualTrue", "Y"); //:RETURN 1 if (8 == 8) return (1); } //:END //:IF nRC = -1 if (nRC == -1) { //:mSARuleS.StudentAccountRule.wQualTrue = "N" SetAttributeFromString(mSARuleS, "StudentAccountRule", "wQualTrue", "N"); //:RETURN -1 if (8 == 8) return (-1); } //:END } //:END } //:END return (0); // END }
From source file:com.quinsoft.zencas.mStudent_Object.java
public int omStudent_dMajorGPA(View mStudentOrig, String InternalEntityStructure, String InternalAttribStructure, Integer GetOrSetFlag) { zVIEW mStudent = new zVIEW(); //:VIEW lDegTrkM BASED ON LOD lDegTrkM zVIEW lDegTrkM = new zVIEW(); //:VIEW mStudenC BASED ON LOD mStudenC zVIEW mStudenC = new zVIEW(); //:VIEW mStudenCO BASED ON LOD mStudenC zVIEW mStudenCO = new zVIEW(); //:DECIMAL MajorGPA double MajorGPA = 0.0; //:DECIMAL GPA_Divisor double GPA_Divisor = 0.0; //:DECIMAL GPA_Points double GPA_Points = 0.0; //:DECIMAL FinalGrade double FinalGrade = 0.0; //:DECIMAL CreditHours double CreditHours = 0.0; //:INTEGER CourseID int CourseID = 0; //:STRING ( 20 ) szDecimalString String szDecimalString = null; //:STRING ( 2 ) szFinalGrade String szFinalGrade = null;/*from ww w . j a v a 2 s.c o m*/ //:STRING ( 32 ) szEntityName String szEntityName = null; int RESULT = 0; int lTempInteger_0 = 0; int lTempInteger_1 = 0; int lTempInteger_2 = 0; int lTempInteger_3 = 0; zVIEW vTempViewVar_0 = new zVIEW(); int lTempInteger_4 = 0; int lTempInteger_5 = 0; int lTempInteger_6 = 0; //:CASE GetOrSetFlag switch (GetOrSetFlag) { //:OF zDERIVED_GET: case zDERIVED_GET: //:// This is a calculation of the major GPA based on the list of Degree Track major courses and //:// the Student's academic record. //:// We try to use the derived DegreeTrack path in mStudent. If it's not there, we will activate //:// lDegTrkM and include it. //:GetEntityNameFromStructure( InternalEntityStructure, szEntityName ) //:IF szEntityName = "StudentMajorDegreeTrack" if (ZeidonStringCompare(szEntityName, 1, 0, "StudentMajorDegreeTrack", 1, 0, 33) == 0) { //:// We're already positioned on the correct entity. //:mStudent = mStudentOrig SetViewFromView(mStudent, mStudentOrig); //:ELSE } else { //:// Position on the correct DegreeTrack entity. //:CreateViewFromView( mStudent, mStudentOrig ) CreateViewFromView(mStudent, mStudentOrig); //:IF szEntityName = "mStudent.DC_StudentMajorDegreeTrack" if (ZeidonStringCompare(szEntityName, 1, 0, "mStudent.DC_StudentMajorDegreeTrack", 1, 0, 33) == 0) { //:SET CURSOR FIRST mStudent.StudentMajorDegreeTrack WHERE mStudent.StudentMajorDegreeTrack.ID = mStudent.DC_StudentMajorDegreeTrack.ID { MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0); GetIntegerFromAttribute(mi_lTempInteger_0, mStudent, "DC_StudentMajorDegreeTrack", "ID"); lTempInteger_0 = mi_lTempInteger_0.intValue(); } RESULT = mStudent.cursor("StudentMajorDegreeTrack").setFirst("ID", lTempInteger_0).toInt(); //:ELSE } else { //:SET CURSOR FIRST mStudent.StudentMajorDegreeTrack WHERE mStudent.StudentMajorDegreeTrack.ID = mStudent.CDC_StudentMajorDegreeTrack.ID { MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1); GetIntegerFromAttribute(mi_lTempInteger_1, mStudent, "CDC_StudentMajorDegreeTrack", "ID"); lTempInteger_1 = mi_lTempInteger_1.intValue(); } RESULT = mStudent.cursor("StudentMajorDegreeTrack").setFirst("ID", lTempInteger_1).toInt(); } //:END } //:END //:SET CURSOR FIRST mStudent.MajorGPA_DegreeTrack //: WHERE mStudent.MajorGPA_DegreeTrack.ID = mStudent.MajorDegreeTrack.ID { MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2); GetIntegerFromAttribute(mi_lTempInteger_2, mStudent, "MajorDegreeTrack", "ID"); lTempInteger_2 = mi_lTempInteger_2.intValue(); } RESULT = mStudent.cursor("MajorGPA_DegreeTrack").setFirst("ID", lTempInteger_2).toInt(); //:IF RESULT < zCURSOR_SET if (RESULT < zCURSOR_SET) { //:ACTIVATE lDegTrkM WHERE lDegTrkM.DegreeTrack.ID = mStudent.MajorDegreeTrack.ID { MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3); GetIntegerFromAttribute(mi_lTempInteger_3, mStudent, "MajorDegreeTrack", "ID"); lTempInteger_3 = mi_lTempInteger_3.intValue(); } omStudent_fnLocalBuildQual_1(mStudentOrig, vTempViewVar_0, lTempInteger_3); RESULT = ActivateObjectInstance(lDegTrkM, "lDegTrkM", mStudentOrig, vTempViewVar_0, zSINGLE); DropView(vTempViewVar_0); //:INCLUDE mStudent.MajorGPA_DegreeTrack FROM lDegTrkM.DegreeTrack RESULT = IncludeSubobjectFromSubobject(mStudent, "MajorGPA_DegreeTrack", lDegTrkM, "DegreeTrack", zPOS_AFTER); //:DropObjectInstance( lDegTrkM ) DropObjectInstance(lDegTrkM); } //:END //:MajorGPA = 0 MajorGPA = 0; //:GET VIEW mStudenCO NAMED "mStudenC" RESULT = GetViewByName(mStudenCO, "mStudenC", mStudentOrig, zLEVEL_TASK); //:IF RESULT >= 0 if (RESULT >= 0) { //:CreateViewFromView( mStudenC, mStudenCO ) CreateViewFromView(mStudenC, mStudenCO); //:GPA_Divisor = 0 GPA_Divisor = 0; //:GPA_Points = 0 GPA_Points = 0; //:FOR EACH mStudenC.Registration WHERE ( mStudenC.Registration.Status = "C" // Completed //: OR mStudenC.Registration.Status = "F" // Transferred //: OR mStudenC.Registration.Status = "X" ) // L. Transferred //: AND mStudenC.Registration.wRepeatedClass != "R" RESULT = mStudenC.cursor("Registration").setFirst().toInt(); while (RESULT > zCURSOR_UNCHANGED) { if ((CompareAttributeToString(mStudenC, "Registration", "Status", "C") == 0 || CompareAttributeToString(mStudenC, "Registration", "Status", "F") == 0 || CompareAttributeToString(mStudenC, "Registration", "Status", "X") == 0) && CompareAttributeToString(mStudenC, "Registration", "wRepeatedClass", "R") != 0) { //:IF mStudenC.RegistrationCourse EXISTS lTempInteger_4 = CheckExistenceOfEntity(mStudenC, "RegistrationCourse"); if (lTempInteger_4 == 0) { //:CourseID = mStudenC.RegistrationCourse.ID { MutableInt mi_CourseID = new MutableInt(CourseID); GetIntegerFromAttribute(mi_CourseID, mStudenC, "RegistrationCourse", "ID"); CourseID = mi_CourseID.intValue(); } //:ELSE } else { //:IF mStudenC.EquivalentCourse EXISTS lTempInteger_5 = CheckExistenceOfEntity(mStudenC, "EquivalentCourse"); if (lTempInteger_5 == 0) { //:CourseID = mStudenC.EquivalentCourse.ID { MutableInt mi_CourseID = new MutableInt(CourseID); GetIntegerFromAttribute(mi_CourseID, mStudenC, "EquivalentCourse", "ID"); CourseID = mi_CourseID.intValue(); } //:ELSE } else { //:CourseID = 0 CourseID = 0; } //:END } //:END //:SET CURSOR FIRST mStudent.MajorGPA_Course WHERE mStudent.MajorGPA_Course.ID = CourseID RESULT = mStudent.cursor("MajorGPA_Course").setFirst("ID", CourseID).toInt(); //:IF RESULT >= zCURSOR_SET if (RESULT >= zCURSOR_SET) { //:szFinalGrade = mStudenC.Registration.FinalGrade { MutableInt mi_lTempInteger_6 = new MutableInt(lTempInteger_6); StringBuilder sb_szFinalGrade; if (szFinalGrade == null) sb_szFinalGrade = new StringBuilder(32); else sb_szFinalGrade = new StringBuilder(szFinalGrade); GetVariableFromAttribute(sb_szFinalGrade, mi_lTempInteger_6, 'S', 3, mStudenC, "Registration", "FinalGrade", "", 0); lTempInteger_6 = mi_lTempInteger_6.intValue(); szFinalGrade = sb_szFinalGrade.toString(); } //:GetStringFromAttributeByContext( szDecimalString, //: mStudenC, "Registration", "FinalGrade", "DegreeTrackGradePointValue", 20 ) { StringBuilder sb_szDecimalString; if (szDecimalString == null) sb_szDecimalString = new StringBuilder(32); else sb_szDecimalString = new StringBuilder(szDecimalString); GetStringFromAttributeByContext(sb_szDecimalString, mStudenC, "Registration", "FinalGrade", "DegreeTrackGradePointValue", 20); szDecimalString = sb_szDecimalString.toString(); } //:IF szFinalGrade = "F" if (ZeidonStringCompare(szFinalGrade, 1, 0, "F", 1, 0, 3) == 0) { //:// Failed Course //:CreditHours = mStudenC.Registration.CreditHours { MutableDouble md_CreditHours = new MutableDouble(CreditHours); GetDecimalFromAttribute(md_CreditHours, mStudenC, "Registration", "CreditHours"); CreditHours = md_CreditHours.doubleValue(); } //:GPA_Divisor = GPA_Divisor + CreditHours GPA_Divisor = GPA_Divisor + CreditHours; //:// GPA_Points are not impacted for this case. //:ELSE } else { //:FinalGrade = StrToDecimal( szDecimalString ) //:IF FinalGrade > 0 if (FinalGrade > 0) { //:// Passed Course //:// The only other entries considered are those with grades D through A, in which case FinalGrade is > 0. //:CreditHours = mStudenC.Registration.CreditHours { MutableDouble md_CreditHours = new MutableDouble(CreditHours); GetDecimalFromAttribute(md_CreditHours, mStudenC, "Registration", "CreditHours"); CreditHours = md_CreditHours.doubleValue(); } //:GPA_Divisor = GPA_Divisor + CreditHours GPA_Divisor = GPA_Divisor + CreditHours; //:GPA_Points = GPA_Points + (FinalGrade * CreditHours) GPA_Points = GPA_Points + (FinalGrade * CreditHours); } //:END } //:END } } RESULT = mStudenC.cursor("Registration").setNext().toInt(); //:END } //:END //:MajorGPA = GPA_Points / GPA_Divisor MajorGPA = GPA_Points / GPA_Divisor; //:DropView( mStudenC ) DropView(mStudenC); } //:END //:IF mStudent != mStudentOrig if (mStudent != mStudentOrig) { //:DropView( mStudent ) DropView(mStudent); } //:END //:StoreValueInRecord ( mStudentOrig, //: InternalEntityStructure, InternalAttribStructure, MajorGPA, 0 ) StoreValueInRecord(mStudentOrig, InternalEntityStructure, InternalAttribStructure, MajorGPA, 0); break; //: /* end zDERIVED_GET */ //:OF zDERIVED_SET: case zDERIVED_SET: break; } //: /* end zDERIVED_SET */ //:END /* case */ return (0); // END }
From source file:com.quinsoft.zencas.mEmploy_Object.java
public int omEmploy_dWorkStudyUnmedNeed(View mEmploy, String InternalEntityStructure, String InternalAttribStructure, Integer GetOrSetFlag) { double dDisplayUnmetNeed = 0.0; //:CASE GetOrSetFlag switch (GetOrSetFlag) { //:OF zDERIVED_GET: case zDERIVED_GET: //:// The Unmet Need value to be displayed for Work Study is $250.00 less than it actually is. //:// This was requested 8/5/08 by Aadit. //:dDisplayUnmetNeed = mEmploy.FinAidProfile.TotalUnmetNeed {/*from ww w. jav a 2 s. co m*/ MutableDouble md_dDisplayUnmetNeed = new MutableDouble(dDisplayUnmetNeed); GetDecimalFromAttribute(md_dDisplayUnmetNeed, mEmploy, "FinAidProfile", "TotalUnmetNeed"); dDisplayUnmetNeed = md_dDisplayUnmetNeed.doubleValue(); } //:dDisplayUnmetNeed = dDisplayUnmetNeed - 250 dDisplayUnmetNeed = dDisplayUnmetNeed - 250; //:IF dDisplayUnmetNeed < 0 if (dDisplayUnmetNeed < 0) { //:dDisplayUnmetNeed = 0 dDisplayUnmetNeed = 0; } //:END //:StoreValueInRecord ( mEmploy, //: InternalEntityStructure, InternalAttribStructure, dDisplayUnmetNeed, 0 ) StoreValueInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, dDisplayUnmetNeed, 0); break; //: /* end zDERIVED_GET */ //:OF zDERIVED_SET: case zDERIVED_SET: break; } //: /* end zDERIVED_SET */ //:END /* case */ return (0); // END }
From source file:com.quinsoft.zencas.mEmploy_Object.java
public int omEmploy_dTotalWorkStudy(View mEmploy, String InternalEntityStructure, String InternalAttribStructure, Integer GetOrSetFlag) { zVIEW mEmployT = new zVIEW(); //:DECIMAL dTotal double dTotal = 0.0; int RESULT = 0; double dTempDecimal_0 = 0.0; //:CASE GetOrSetFlag switch (GetOrSetFlag) { //:OF zDERIVED_GET: case zDERIVED_GET: //:CreateViewFromView( mEmployT, mEmploy ) CreateViewFromView(mEmployT, mEmploy); //:FOR EACH mEmployT.FA_WorkStudyAllocation RESULT = SetCursorFirstEntity(mEmployT, "FA_WorkStudyAllocation", ""); while (RESULT > zCURSOR_UNCHANGED) { //:dTotal = dTotal + mEmployT.FA_WorkStudyAllocation.Amount {// ww w. j a v a2s. c om MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0); GetDecimalFromAttribute(md_dTempDecimal_0, mEmployT, "FA_WorkStudyAllocation", "Amount"); dTempDecimal_0 = md_dTempDecimal_0.doubleValue(); } dTotal = dTotal + dTempDecimal_0; RESULT = SetCursorNextEntity(mEmployT, "FA_WorkStudyAllocation", ""); } //:END //:DropView( mEmployT ) DropView(mEmployT); //:StoreValueInRecord( mEmploy,InternalEntityStructure, //: InternalAttribStructure, dTotal, 0 ) StoreValueInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, dTotal, 0); break; //: /* end zDERIVED_GET */ //:OF zDERIVED_SET: case zDERIVED_SET: break; } //: /* end zDERIVED_SET */ //:END /* case */ return (0); // END }
From source file:com.quinsoft.zencas.mEmploy_Object.java
public int omEmploy_dTotalCostOfContract(View mEmploy, String InternalEntityStructure, String InternalAttribStructure, Integer GetOrSetFlag) { double TotalAmount = 0.0; //:STRING ( 32 ) szEntityName String szEntityName = null;/* ww w. ja v a 2 s . co m*/ int lTempInteger_0 = 0; double dTempDecimal_0 = 0.0; double dTempDecimal_1 = 0.0; double dTempDecimal_2 = 0.0; double dTempDecimal_3 = 0.0; //:CASE GetOrSetFlag switch (GetOrSetFlag) { //:OF zDERIVED_GET: case zDERIVED_GET: //:// If the attribute is on the root then the request is for Active Contract. Otherwise the request is for HistoricalContract. //:GetEntityNameFromStructure( InternalEntityStructure, szEntityName ) { ZGLOBAL1_Operation m_ZGLOBAL1_Operation = new ZGLOBAL1_Operation(mEmploy); { StringBuilder sb_szEntityName; if (szEntityName == null) sb_szEntityName = new StringBuilder(32); else sb_szEntityName = new StringBuilder(szEntityName); m_ZGLOBAL1_Operation.GetEntityNameFromStructure(InternalEntityStructure, sb_szEntityName); szEntityName = sb_szEntityName.toString(); } // m_ZGLOBAL1_Operation = null; // permit gc (unnecessary) } //:IF szEntityName = "Employee" if (ZeidonStringCompare(szEntityName, 1, 0, "Employee", 1, 0, 33) == 0) { //:IF mEmploy.YearlyContract EXISTS lTempInteger_0 = CheckExistenceOfEntity(mEmploy, "YearlyContract"); if (lTempInteger_0 == 0) { //:TotalAmount = mEmploy.YearlyContract.dTotalSalaryAmount + //: mEmploy.Employee.dTotalCollegeContributions { MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0); GetDecimalFromAttribute(md_dTempDecimal_0, mEmploy, "YearlyContract", "dTotalSalaryAmount"); dTempDecimal_0 = md_dTempDecimal_0.doubleValue(); } { MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1); GetDecimalFromAttribute(md_dTempDecimal_1, mEmploy, "Employee", "dTotalCollegeContributions"); dTempDecimal_1 = md_dTempDecimal_1.doubleValue(); } TotalAmount = dTempDecimal_0 + dTempDecimal_1; //:StoreValueInRecord( mEmploy,InternalEntityStructure, InternalAttribStructure, TotalAmount, 0 ) StoreValueInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, TotalAmount, 0); //:ELSE } else { //:StoreStringInRecord ( mEmploy, //: InternalEntityStructure, InternalAttribStructure, "" ) StoreStringInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, ""); } //:END //:ELSE } else { //:TotalAmount = mEmploy.HistoricalContract.dTotalSalaryAmount + //: mEmploy.HistoricalContract.dTotalCollegeContributions { MutableDouble md_dTempDecimal_2 = new MutableDouble(dTempDecimal_2); GetDecimalFromAttribute(md_dTempDecimal_2, mEmploy, "HistoricalContract", "dTotalSalaryAmount"); dTempDecimal_2 = md_dTempDecimal_2.doubleValue(); } { MutableDouble md_dTempDecimal_3 = new MutableDouble(dTempDecimal_3); GetDecimalFromAttribute(md_dTempDecimal_3, mEmploy, "HistoricalContract", "dTotalCollegeContributions"); dTempDecimal_3 = md_dTempDecimal_3.doubleValue(); } TotalAmount = dTempDecimal_2 + dTempDecimal_3; //:StoreValueInRecord( mEmploy,InternalEntityStructure, InternalAttribStructure, TotalAmount, 0 ) StoreValueInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, TotalAmount, 0); } //:END break; //: //: /* end zDERIVED_GET */ //:OF zDERIVED_SET: case zDERIVED_SET: break; } //: /* end zDERIVED_SET */ //:END /* case */ return (0); // END }
From source file:com.quinsoft.zencas.mEmploy_Object.java
public int omEmploy_dHourlyAnnualAmount(View mEmployOrig, String InternalEntityStructure, String InternalAttribStructure, Integer GetOrSetFlag) { zVIEW mEmploy = new zVIEW(); //:STRING ( 32 ) szEntityName String szEntityName = null;// w w w . j a v a 2 s .com //:DECIMAL dAnnualSalary double dAnnualSalary = 0.0; //:INTEGER lAnnualSalary int lAnnualSalary = 0; int RESULT = 0; int lTempInteger_0 = 0; double dTempDecimal_0 = 0.0; int lTempInteger_1 = 0; double dTempDecimal_1 = 0.0; //:CASE GetOrSetFlag switch (GetOrSetFlag) { //:OF zDERIVED_GET: case zDERIVED_GET: //:CreateViewFromView( mEmploy, mEmployOrig ) CreateViewFromView(mEmploy, mEmployOrig); //:GetEntityNameFromStructure( InternalEntityStructure, szEntityName ) { ZGLOBAL1_Operation m_ZGLOBAL1_Operation = new ZGLOBAL1_Operation(mEmployOrig); { StringBuilder sb_szEntityName; if (szEntityName == null) sb_szEntityName = new StringBuilder(32); else sb_szEntityName = new StringBuilder(szEntityName); m_ZGLOBAL1_Operation.GetEntityNameFromStructure(InternalEntityStructure, sb_szEntityName); szEntityName = sb_szEntityName.toString(); } // m_ZGLOBAL1_Operation = null; // permit gc (unnecessary) } //:IF szEntityName = "YearlyContract" if (ZeidonStringCompare(szEntityName, 1, 0, "YearlyContract", 1, 0, 33) == 0) { //:SET CURSOR FIRST mEmploy.HistoricalContract //: WHERE mEmploy.HistoricalContract.ID = mEmploy.YearlyContract.ID { MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0); GetIntegerFromAttribute(mi_lTempInteger_0, mEmploy, "YearlyContract", "ID"); lTempInteger_0 = mi_lTempInteger_0.intValue(); } RESULT = SetCursorFirstEntityByInteger(mEmploy, "HistoricalContract", "ID", lTempInteger_0, ""); } //:END //:// Hourly Wage //:IF mEmploy.HistoricalContract.EmployeeClassification = "H" // Hourly if (CompareAttributeToString(mEmploy, "HistoricalContract", "EmployeeClassification", "H") == 0) { //:// Hours per Week X Weeks per Year X Hourly Rate //:dAnnualSalary = ( mEmploy.HistoricalContract.HourlyHoursPerWeek * //: mEmploy.HistoricalContract.HourlyWeeksPerYear * //: mEmploy.HistoricalContract.HourlyRate ) { MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0); GetDecimalFromAttribute(md_dTempDecimal_0, mEmploy, "HistoricalContract", "HourlyHoursPerWeek"); dTempDecimal_0 = md_dTempDecimal_0.doubleValue(); } { MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1); GetIntegerFromAttribute(mi_lTempInteger_1, mEmploy, "HistoricalContract", "HourlyWeeksPerYear"); lTempInteger_1 = mi_lTempInteger_1.intValue(); } { MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1); GetDecimalFromAttribute(md_dTempDecimal_1, mEmploy, "HistoricalContract", "HourlyRate"); dTempDecimal_1 = md_dTempDecimal_1.doubleValue(); } dAnnualSalary = (dTempDecimal_0 * lTempInteger_1 * dTempDecimal_1); //:// Always round up. We'll do this by adding 99 cents and then removing the cents. //:dAnnualSalary = dAnnualSalary + .99 dAnnualSalary = dAnnualSalary + .99; //:lAnnualSalary = dAnnualSalary lAnnualSalary = (int) dAnnualSalary; //:dAnnualSalary = lAnnualSalary dAnnualSalary = lAnnualSalary; //:StoreValueInRecord ( mEmploy, //: InternalEntityStructure, InternalAttribStructure, dAnnualSalary, 0 ) StoreValueInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, dAnnualSalary, 0); //:ELSE } else { //:StoreStringInRecord ( mEmploy, //: InternalEntityStructure, InternalAttribStructure, "" ) StoreStringInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, ""); } //:END //:DropView( mEmploy ) DropView(mEmploy); break; //: /* end zDERIVED_GET */ //:OF zDERIVED_SET: case zDERIVED_SET: break; } //: /* end zDERIVED_SET */ //:END /* case */ return (0); // END }
From source file:com.quinsoft.zencas.mEmploy_Object.java
public int omEmploy_dFacultyAddMonthAmount(View mEmployOrig, String InternalEntityStructure, String InternalAttribStructure, Integer GetOrSetFlag) { zVIEW mEmploy = new zVIEW(); //:DECIMAL dAdditionMonthsAmount double dAdditionMonthsAmount = 0.0; //:DECIMAL dAnnualSalaryAmount double dAnnualSalaryAmount = 0.0; //:INTEGER lAdditionMonthsAmount int lAdditionMonthsAmount = 0; //:STRING ( 32 ) szEntityName String szEntityName = null;/*from w w w. ja va2 s .co m*/ int RESULT = 0; int lTempInteger_0 = 0; int lTempInteger_1 = 0; //:CASE GetOrSetFlag switch (GetOrSetFlag) { //:OF zDERIVED_GET: case zDERIVED_GET: //:CreateViewFromView( mEmploy, mEmployOrig ) CreateViewFromView(mEmploy, mEmployOrig); //:GetEntityNameFromStructure( InternalEntityStructure, szEntityName ) { ZGLOBAL1_Operation m_ZGLOBAL1_Operation = new ZGLOBAL1_Operation(mEmployOrig); { StringBuilder sb_szEntityName; if (szEntityName == null) sb_szEntityName = new StringBuilder(32); else sb_szEntityName = new StringBuilder(szEntityName); m_ZGLOBAL1_Operation.GetEntityNameFromStructure(InternalEntityStructure, sb_szEntityName); szEntityName = sb_szEntityName.toString(); } // m_ZGLOBAL1_Operation = null; // permit gc (unnecessary) } //:IF szEntityName = "YearlyContract" if (ZeidonStringCompare(szEntityName, 1, 0, "YearlyContract", 1, 0, 33) == 0) { //:SET CURSOR FIRST mEmploy.HistoricalContract WHERE mEmploy.HistoricalContract.ID = mEmploy.YearlyContract.ID { MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0); GetIntegerFromAttribute(mi_lTempInteger_0, mEmploy, "YearlyContract", "ID"); lTempInteger_0 = mi_lTempInteger_0.intValue(); } RESULT = SetCursorFirstEntityByInteger(mEmploy, "HistoricalContract", "ID", lTempInteger_0, ""); } //:END //:// On 3/4/2008, DonC changed the computation of dAdditionMonthsAmount to use the derived Faculty salary instead //:// of the actual salary at the request of Fran. //:dAnnualSalaryAmount = mEmploy.HistoricalContract.dFacultyComputedSalary { MutableDouble md_dAnnualSalaryAmount = new MutableDouble(dAnnualSalaryAmount); GetDecimalFromAttribute(md_dAnnualSalaryAmount, mEmploy, "HistoricalContract", "dFacultyComputedSalary"); dAnnualSalaryAmount = md_dAnnualSalaryAmount.doubleValue(); } //:dAdditionMonthsAmount = dAnnualSalaryAmount * mEmploy.HistoricalContract.FacultyAdditionalMonths / 9 { MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1); GetIntegerFromAttribute(mi_lTempInteger_1, mEmploy, "HistoricalContract", "FacultyAdditionalMonths"); lTempInteger_1 = mi_lTempInteger_1.intValue(); } dAdditionMonthsAmount = dAnnualSalaryAmount * lTempInteger_1 / 9; //:IF dAdditionMonthsAmount = 0 if (dAdditionMonthsAmount == 0) { //:StoreStringInRecord ( mEmploy, //: InternalEntityStructure, InternalAttribStructure, "" ) StoreStringInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, ""); //:ELSE } else { //:// Always round up. We'll do this by adding 99 cents and then removing the cents. //:dAdditionMonthsAmount = dAdditionMonthsAmount + .99 dAdditionMonthsAmount = dAdditionMonthsAmount + .99; //:lAdditionMonthsAmount = dAdditionMonthsAmount lAdditionMonthsAmount = (int) dAdditionMonthsAmount; //:dAdditionMonthsAmount = lAdditionMonthsAmount dAdditionMonthsAmount = lAdditionMonthsAmount; //:StoreValueInRecord ( mEmploy, //: InternalEntityStructure, InternalAttribStructure, dAdditionMonthsAmount, 0 ) StoreValueInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, dAdditionMonthsAmount, 0); } //:END //:DropView( mEmploy ) DropView(mEmploy); break; //: /* end zDERIVED_GET */ //:OF zDERIVED_SET: case zDERIVED_SET: break; } //: /* end zDERIVED_SET */ //:END /* case */ return (0); // END }
From source file:com.quinsoft.zencas.mEmploy_Object.java
public int omEmploy_dTotalCollegeContrib(View mEmploy, String InternalEntityStructure, String InternalAttribStructure, Integer GetOrSetFlag) { double TotalAmount = 0.0; //:STRING ( 32 ) szEntityName String szEntityName = null;/*from w w w . ja v a 2 s. com*/ double dTempDecimal_0 = 0.0; double dTempDecimal_1 = 0.0; double dTempDecimal_2 = 0.0; double dTempDecimal_3 = 0.0; double dTempDecimal_4 = 0.0; double dTempDecimal_5 = 0.0; double dTempDecimal_6 = 0.0; double dTempDecimal_7 = 0.0; double dTempDecimal_8 = 0.0; double dTempDecimal_9 = 0.0; double dTempDecimal_10 = 0.0; double dTempDecimal_11 = 0.0; //:CASE GetOrSetFlag switch (GetOrSetFlag) { //:OF zDERIVED_GET: case zDERIVED_GET: //:// If the attribute is on the root then the request is for Active Contract. Otherwise the request is for HistoricalContract. //:GetEntityNameFromStructure( InternalEntityStructure, szEntityName ) { ZGLOBAL1_Operation m_ZGLOBAL1_Operation = new ZGLOBAL1_Operation(mEmploy); { StringBuilder sb_szEntityName; if (szEntityName == null) sb_szEntityName = new StringBuilder(32); else sb_szEntityName = new StringBuilder(szEntityName); m_ZGLOBAL1_Operation.GetEntityNameFromStructure(InternalEntityStructure, sb_szEntityName); szEntityName = sb_szEntityName.toString(); } // m_ZGLOBAL1_Operation = null; // permit gc (unnecessary) } //:IF szEntityName = "Employee" if (ZeidonStringCompare(szEntityName, 1, 0, "Employee", 1, 0, 33) == 0) { //:TotalAmount = mEmploy.Employee.dFICA_OASDI_Benefit + //: mEmploy.Employee.dFICA_MedicareBenefit + //: mEmploy.Employee.dMedicalPlanCostBenefit + //: mEmploy.Employee.dLifeAndDisabilityBenefit + //: mEmploy.Employee.dTIAA_RetirementBenefit + //: mEmploy.Employee.dWorkersCompensationBenefit { MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0); GetDecimalFromAttribute(md_dTempDecimal_0, mEmploy, "Employee", "dFICA_OASDI_Benefit"); dTempDecimal_0 = md_dTempDecimal_0.doubleValue(); } { MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1); GetDecimalFromAttribute(md_dTempDecimal_1, mEmploy, "Employee", "dFICA_MedicareBenefit"); dTempDecimal_1 = md_dTempDecimal_1.doubleValue(); } { MutableDouble md_dTempDecimal_2 = new MutableDouble(dTempDecimal_2); GetDecimalFromAttribute(md_dTempDecimal_2, mEmploy, "Employee", "dMedicalPlanCostBenefit"); dTempDecimal_2 = md_dTempDecimal_2.doubleValue(); } { MutableDouble md_dTempDecimal_3 = new MutableDouble(dTempDecimal_3); GetDecimalFromAttribute(md_dTempDecimal_3, mEmploy, "Employee", "dLifeAndDisabilityBenefit"); dTempDecimal_3 = md_dTempDecimal_3.doubleValue(); } { MutableDouble md_dTempDecimal_4 = new MutableDouble(dTempDecimal_4); GetDecimalFromAttribute(md_dTempDecimal_4, mEmploy, "Employee", "dTIAA_RetirementBenefit"); dTempDecimal_4 = md_dTempDecimal_4.doubleValue(); } { MutableDouble md_dTempDecimal_5 = new MutableDouble(dTempDecimal_5); GetDecimalFromAttribute(md_dTempDecimal_5, mEmploy, "Employee", "dWorkersCompensationBenefit"); dTempDecimal_5 = md_dTempDecimal_5.doubleValue(); } TotalAmount = dTempDecimal_0 + dTempDecimal_1 + dTempDecimal_2 + dTempDecimal_3 + dTempDecimal_4 + dTempDecimal_5; //:ELSE } else { //:TotalAmount = mEmploy.HistoricalContract.dFICA_OASDI_Benefit + //: mEmploy.HistoricalContract.dFICA_MedicareBenefit + //: mEmploy.HistoricalContract.dMedicalPlanCostBenefit + //: mEmploy.HistoricalContract.dLifeAndDisabilityBenefit + //: mEmploy.HistoricalContract.dTIAA_RetirementBenefit + //: mEmploy.HistoricalContract.dWorkersCompensationBenefit { MutableDouble md_dTempDecimal_6 = new MutableDouble(dTempDecimal_6); GetDecimalFromAttribute(md_dTempDecimal_6, mEmploy, "HistoricalContract", "dFICA_OASDI_Benefit"); dTempDecimal_6 = md_dTempDecimal_6.doubleValue(); } { MutableDouble md_dTempDecimal_7 = new MutableDouble(dTempDecimal_7); GetDecimalFromAttribute(md_dTempDecimal_7, mEmploy, "HistoricalContract", "dFICA_MedicareBenefit"); dTempDecimal_7 = md_dTempDecimal_7.doubleValue(); } { MutableDouble md_dTempDecimal_8 = new MutableDouble(dTempDecimal_8); GetDecimalFromAttribute(md_dTempDecimal_8, mEmploy, "HistoricalContract", "dMedicalPlanCostBenefit"); dTempDecimal_8 = md_dTempDecimal_8.doubleValue(); } { MutableDouble md_dTempDecimal_9 = new MutableDouble(dTempDecimal_9); GetDecimalFromAttribute(md_dTempDecimal_9, mEmploy, "HistoricalContract", "dLifeAndDisabilityBenefit"); dTempDecimal_9 = md_dTempDecimal_9.doubleValue(); } { MutableDouble md_dTempDecimal_10 = new MutableDouble(dTempDecimal_10); GetDecimalFromAttribute(md_dTempDecimal_10, mEmploy, "HistoricalContract", "dTIAA_RetirementBenefit"); dTempDecimal_10 = md_dTempDecimal_10.doubleValue(); } { MutableDouble md_dTempDecimal_11 = new MutableDouble(dTempDecimal_11); GetDecimalFromAttribute(md_dTempDecimal_11, mEmploy, "HistoricalContract", "dWorkersCompensationBenefit"); dTempDecimal_11 = md_dTempDecimal_11.doubleValue(); } TotalAmount = dTempDecimal_6 + dTempDecimal_7 + dTempDecimal_8 + dTempDecimal_9 + dTempDecimal_10 + dTempDecimal_11; } //:END //:StoreValueInRecord( mEmploy,InternalEntityStructure, InternalAttribStructure, TotalAmount, 0 ) StoreValueInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, TotalAmount, 0); break; //: //: /* end zDERIVED_GET */ //:OF zDERIVED_SET: case zDERIVED_SET: break; } //: /* end zDERIVED_SET */ //:END /* case */ return (0); // END }
From source file:com.quinsoft.zencas.mEmploy_Object.java
public int omEmploy_dWorkersCompBenefit(View mEmployOrig, String InternalEntityStructure, String InternalAttribStructure, Integer GetOrSetFlag) { zVIEW mEmploy = new zVIEW(); //:VIEW mStdSalLST BASED ON LOD mStdSal zVIEW mStdSalLST = new zVIEW(); //:DECIMAL BenefitAmount double BenefitAmount = 0.0; //:DECIMAL SalaryAmount double SalaryAmount = 0.0; //:STRING ( 32 ) szEntityName String szEntityName = null;//from w w w . j a v a 2 s . c o m //:STRING ( 1 ) szSkipFlag String szSkipFlag = null; int RESULT = 0; int lTempInteger_0 = 0; double dTempDecimal_0 = 0.0; //:CASE GetOrSetFlag switch (GetOrSetFlag) { //:OF zDERIVED_GET: case zDERIVED_GET: //:GET VIEW mStdSalLST NAMED "mStdSalLST" RESULT = GetViewByName(mStdSalLST, "mStdSalLST", mEmployOrig, zLEVEL_TASK); //:IF RESULT < 0 if (RESULT < 0) { //:ACTIVATE mStdSalLST RootOnlyMultiple RESULT = ActivateObjectInstance(mStdSalLST, "mStdSal", mEmployOrig, 0, zACTIVATE_ROOTONLY_MULTIPLE); //:NAME VIEW mStdSalLST "mStdSalLST" SetNameForView(mStdSalLST, "mStdSalLST", null, zLEVEL_TASK); } //:END //:// If the attribute is on the root then the request is for Active Contract. Otherwise the request is for HistoricalContract. //:CreateViewFromView( mEmploy, mEmployOrig ) CreateViewFromView(mEmploy, mEmployOrig); //:GetEntityNameFromStructure( InternalEntityStructure, szEntityName ) { ZGLOBAL1_Operation m_ZGLOBAL1_Operation = new ZGLOBAL1_Operation(mEmployOrig); { StringBuilder sb_szEntityName; if (szEntityName == null) sb_szEntityName = new StringBuilder(32); else sb_szEntityName = new StringBuilder(szEntityName); m_ZGLOBAL1_Operation.GetEntityNameFromStructure(InternalEntityStructure, sb_szEntityName); szEntityName = sb_szEntityName.toString(); } // m_ZGLOBAL1_Operation = null; // permit gc (unnecessary) } //:IF szEntityName = "Employee" if (ZeidonStringCompare(szEntityName, 1, 0, "Employee", 1, 0, 33) == 0) { //:SET CURSOR FIRST mEmploy.HistoricalContract WHERE mEmploy.HistoricalContract.Status = "A" RESULT = SetCursorFirstEntityByString(mEmploy, "HistoricalContract", "Status", "A", ""); //:IF RESULT < zCURSOR_SET if (RESULT < zCURSOR_SET) { //:szSkipFlag = "Y" { StringBuilder sb_szSkipFlag; if (szSkipFlag == null) sb_szSkipFlag = new StringBuilder(32); else sb_szSkipFlag = new StringBuilder(szSkipFlag); ZeidonStringCopy(sb_szSkipFlag, 1, 0, "Y", 1, 0, 2); szSkipFlag = sb_szSkipFlag.toString(); } //:ELSE } else { //:// "Contracted Employee" contracts don't have any benefits. //:IF mEmploy.HistoricalContract.EmployeeClassification = "C" if (CompareAttributeToString(mEmploy, "HistoricalContract", "EmployeeClassification", "C") == 0) { //:szSkipFlag = "Y" { StringBuilder sb_szSkipFlag; if (szSkipFlag == null) sb_szSkipFlag = new StringBuilder(32); else sb_szSkipFlag = new StringBuilder(szSkipFlag); ZeidonStringCopy(sb_szSkipFlag, 1, 0, "Y", 1, 0, 2); szSkipFlag = sb_szSkipFlag.toString(); } } //:END } //:END } //:END //:IF szSkipFlag = "" if (ZeidonStringCompare(szSkipFlag, 1, 0, "", 1, 0, 2) == 0) { //:SET CURSOR FIRST mStdSalLST.StandardSalaryData WHERE mStdSalLST.StandardSalaryData.ID = mEmploy.HistContractStandardSalaryData.ID { MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0); GetIntegerFromAttribute(mi_lTempInteger_0, mEmploy, "HistContractStandardSalaryData", "ID"); lTempInteger_0 = mi_lTempInteger_0.intValue(); } RESULT = SetCursorFirstEntityByInteger(mStdSalLST, "StandardSalaryData", "ID", lTempInteger_0, ""); //:IF RESULT >= zCURSOR_SET if (RESULT >= zCURSOR_SET) { //:SalaryAmount = mEmploy.HistoricalContract.dTotalSalaryAmount { MutableDouble md_SalaryAmount = new MutableDouble(SalaryAmount); GetDecimalFromAttribute(md_SalaryAmount, mEmploy, "HistoricalContract", "dTotalSalaryAmount"); SalaryAmount = md_SalaryAmount.doubleValue(); } //:BenefitAmount = ( SalaryAmount * mStdSalLST.StandardSalaryData.WorkersCompensationRate ) / 100 { MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0); GetDecimalFromAttribute(md_dTempDecimal_0, mStdSalLST, "StandardSalaryData", "WorkersCompensationRate"); dTempDecimal_0 = md_dTempDecimal_0.doubleValue(); } BenefitAmount = (SalaryAmount * dTempDecimal_0) / 100; //:StoreValueInRecord( mEmploy,InternalEntityStructure, InternalAttribStructure, BenefitAmount, 0 ) StoreValueInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, BenefitAmount, 0); //:ELSE } else { //:StoreStringInRecord ( mEmploy, //: InternalEntityStructure, InternalAttribStructure, "" ) StoreStringInRecord(mEmploy, InternalEntityStructure, InternalAttribStructure, ""); } //:END } //:END //:DropView( mEmploy ) DropView(mEmploy); break; //: /* end zDERIVED_GET */ //:OF zDERIVED_SET: case zDERIVED_SET: break; } //: /* end zDERIVED_SET */ //:END /* case */ return (0); // END }