Example usage for org.apache.commons.lang3.mutable MutableDouble MutableDouble

List of usage examples for org.apache.commons.lang3.mutable MutableDouble MutableDouble

Introduction

In this page you can find the example usage for org.apache.commons.lang3.mutable MutableDouble MutableDouble.

Prototype

public MutableDouble(final String value) throws NumberFormatException 

Source Link

Document

Constructs a new MutableDouble parsing the given string.

Usage

From source file:com.quinsoft.swauopencuas.ZGLOBAL1_Operation.java

public Double SetDecimalPrecisionRounded(Double pdDecimalValue, int ulNumberOfDecimals) {
    StringBuilder sb = new StringBuilder(ulNumberOfDecimals > 0 ? ulNumberOfDecimals + 5 : 25);

    SysConvertDecimalToString(pdDecimalValue, sb, ulNumberOfDecimals);
    MutableDouble d = new MutableDouble(pdDecimalValue);
    SysConvertStringToDecimal(sb.toString(), d);
    return d.toDouble();

}

From source file:com.quinsoft.swauopencuas.mSAChrgT_Object.java

public int omSAChrgT_ProcessInternalRule(View mSAChrgT, View mSAProf, String szRefundFlag) {
    zVIEW mSAProf2 = new zVIEW();
    //:VIEW lSATermLST  REGISTERED AS lSATermLST
    zVIEW lSATermLST = new zVIEW();
    int RESULT = 0;
    //:VIEW lSATermLST2 BASED ON LOD  lTermLST
    zVIEW lSATermLST2 = new zVIEW();
    //:VIEW wXferO      REGISTERED AS wXferO
    zVIEW wXferO = new zVIEW();
    //:VIEW mCollegeLST BASED ON LOD  mCollege
    zVIEW mCollegeLST = new zVIEW();
    //:VIEW mSAChrgT2   BASED ON LOD  mSAChrgT
    zVIEW mSAChrgT2 = new zVIEW();
    //:STRING ( 1 )   szFoundRuleFlag
    String szFoundRuleFlag = null;
    //:STRING ( 1 )   szExemptionFlag
    String szExemptionFlag = null;
    //:STRING ( 300 ) szMsg
    String szMsg = null;//ww  w.jav a 2 s .  co  m
    //:STRING ( 100 ) szDesc
    String szDesc = null;
    //:STRING ( 100 ) szCourseList
    String szCourseList = null;
    //:STRING ( 20 )  szDisplayCredits
    String szDisplayCredits = null;
    //:STRING ( 20 )  szDisplayNumberOfClasses
    String szDisplayNumberOfClasses = null;
    //:STRING ( 50 )  szInternalRuleName
    String szInternalRuleName = null;
    //:STRING ( 1 )   szStudentHasVehicleRegCharge
    String szStudentHasVehicleRegCharge = null;
    //:STRING ( 4 )   szSelectedYear
    String szSelectedYear = null;
    //:STRING ( 8 )   szSelectedYearDate
    String szSelectedYearDate = null;
    //:STRING ( 8 )   szBeginYearDate
    String szBeginYearDate = null;
    //:STRING ( 8 )   szEndYearDate
    String szEndYearDate = null;
    //:STRING ( 8 )   szAddDropDeadlineDate
    String szAddDropDeadlineDate = null;
    //:STRING ( 8 )   szWorkDate
    String szWorkDate = null;
    //:STRING ( 8 )   szFirstClassDate
    String szFirstClassDate = null;
    //:STRING ( 8 )   szInsuranceBenefitDate
    String szInsuranceBenefitDate = null;
    //:STRING ( 8 )   szStartOfNextMonthDate
    String szStartOfNextMonthDate = null;
    //:STRING ( 2 )   szMonth
    String szMonth = null;
    //:STRING ( 1 )   szDroppedAllClassesFlag
    String szDroppedAllClassesFlag = null;
    //:STRING ( 1 )   szResidencyStatus
    String szResidencyStatus = null;
    //:STRING ( 10 )  szTransactionCode
    String szTransactionCode = null;
    //:STRING ( 10 )  szFallHealthInsuranceTranCode
    String szFallHealthInsuranceTranCode = null;
    //:STRING ( 10 )  szValidHealthInsuranceTranCode
    String szValidHealthInsuranceTranCode = null;
    //:STRING ( 20 )  szVariableName
    String szVariableName = null;
    //:INTEGER        DropCount
    int DropCount = 0;
    //:INTEGER        TotalClasses
    int TotalClasses = 0;
    //:INTEGER        Month
    int Month = 0;
    //:DECIMAL        dChargePerCreditHour
    double dChargePerCreditHour = 0.0;
    //:DECIMAL        dOverloadCredits
    double dOverloadCredits = 0.0;
    //:DECIMAL        dTotalCredits
    double dTotalCredits = 0.0;
    //:DECIMAL        dTotalAuditedCredits
    double dTotalAuditedCredits = 0.0;
    //:DECIMAL        dChargePerClass
    double dChargePerClass = 0.0;
    //:DECIMAL        dAmount
    double dAmount = 0.0;
    //:DECIMAL        dAmountAudit
    double dAmountAudit = 0.0;
    //:DECIMAL        dRefund
    double dRefund = 0.0;
    //:DECIMAL        dMaximumCredits
    double dMaximumCredits = 0.0;
    //:DECIMAL        dTotal
    double dTotal = 0.0;
    //:SHORT          nRC
    int nRC = 0;
    int lTempInteger_0 = 0;
    String szTempString_0 = null;
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;
    int lTempInteger_3 = 0;
    String szTempString_1 = null;
    int lTempInteger_4 = 0;
    int lTempInteger_5 = 0;
    int lTempInteger_6 = 0;
    double dTempDecimal_0 = 0.0;
    double dTempDecimal_1 = 0.0;
    int lTempInteger_7 = 0;
    int lTempInteger_8 = 0;
    double dTempDecimal_2 = 0.0;
    int lTempInteger_9 = 0;
    int lTempInteger_10 = 0;
    int lTempInteger_11 = 0;
    int lTempInteger_12 = 0;
    int lTempInteger_13 = 0;
    String szTempString_2 = null;
    int lTempInteger_14 = 0;
    String szTempString_3 = null;
    int lTempInteger_15 = 0;

    RESULT = GetViewByName(lSATermLST, "lSATermLST", mSAChrgT, zLEVEL_TASK);
    RESULT = GetViewByName(wXferO, "wXferO", mSAChrgT, zLEVEL_TASK);

    //:// Process the Internal Rule specified in mSAChrgT.SATransactionCode.InternalRuleName.

    //:// NOTE THAT THERE ARE THREE STEPS TO ADDING A NEW INTERNAL RULE.
    //:// 1. ADD THE RULE NAME IN BuildInternalRuleList ABOVE SO THAT THE RULE WILL APPEAR IN THE DROP DOWN LIST.
    //:// 2. ADD THE PROCESSING OF THE RULE IN THIS OPERATION.
    //:// 3. IF THE RULE HAS VARIABLES, ADD THE CREATION OF THOSE VARIABLES IN BuildInternalRuleVars BELOW.

    //:// The following Internal Rules are processed here. Note that they need to be added in operation, BuildInternalRuleList, above.
    //:// 1. Graduate Charge/Credit
    //:// 2. Undergrad Tuition Block Charge
    //:// 3. Health Insurance
    //:// 4. Summer Tuition
    //:// 5. DL Tuition
    //:// 6. Meal Plan
    //:// 7. Residency
    //:// 8. UNIV110 Fees
    //:// 9. Independent Study

    //:// Make sure list of colleges exists for determining grad/undergrad courses.
    //:GET VIEW mCollegeLST NAMED "mCollegeLST"
    RESULT = GetViewByName(mCollegeLST, "mCollegeLST", mSAChrgT, zLEVEL_TASK);
    //:IF RESULT < 0
    if (RESULT < 0) {
        //:ACTIVATE mCollegeLST RootOnlyMultiple
        RESULT = ActivateObjectInstance(mCollegeLST, "mCollege", mSAChrgT, 0, zACTIVATE_ROOTONLY_MULTIPLE);
        //:NAME VIEW mCollegeLST "mCollegeLST"
        SetNameForView(mCollegeLST, "mCollegeLST", null, zLEVEL_TASK);
    }

    //:END

    //:// If this Transaction is for a Term, make sure that the Minimum Credits attributes have been set for the Term. (Except for Jan.)
    //:IF mSAChrgT.CollegeTerm EXISTS 
    lTempInteger_0 = CheckExistenceOfEntity(mSAChrgT, "CollegeTerm");
    if (lTempInteger_0 == 0) {
        //:IF mSAChrgT.CollegeTerm.Semester = "01" OR mSAChrgT.CollegeTerm.Semester = "03" OR mSAChrgT.CollegeTerm.Semester = "04"
        if (CompareAttributeToString(mSAChrgT, "CollegeTerm", "Semester", "01") == 0
                || CompareAttributeToString(mSAChrgT, "CollegeTerm", "Semester", "03") == 0
                || CompareAttributeToString(mSAChrgT, "CollegeTerm", "Semester", "04") == 0) {
            //:IF mSAChrgT.CollegeTerm.FullTimeMinCredits = "" OR mSAChrgT.CollegeTerm.OverloadMinCredits = "" OR 
            //:   mSAChrgT.CollegeTerm.PartTimeMinCredits = "" OR mSAChrgT.CollegeTerm.HalfTimeMinCredits = ""
            if (CompareAttributeToString(mSAChrgT, "CollegeTerm", "FullTimeMinCredits", "") == 0
                    || CompareAttributeToString(mSAChrgT, "CollegeTerm", "OverloadMinCredits", "") == 0
                    || CompareAttributeToString(mSAChrgT, "CollegeTerm", "PartTimeMinCredits", "") == 0
                    || CompareAttributeToString(mSAChrgT, "CollegeTerm", "HalfTimeMinCredits", "") == 0) {

                //:szMsg = "Minimum Credits for Term ," + mSAChrgT.CollegeTerm.YearSemester + ", have not all been specified." + NEW_LINE + 
                //:        "The 'Generate Charges' process is being aborted."
                {
                    MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1);
                    StringBuilder sb_szTempString_0;
                    if (szTempString_0 == null)
                        sb_szTempString_0 = new StringBuilder(32);
                    else
                        sb_szTempString_0 = new StringBuilder(szTempString_0);
                    GetVariableFromAttribute(sb_szTempString_0, mi_lTempInteger_1, 'S', 21, mSAChrgT,
                            "CollegeTerm", "YearSemester", "", 0);
                    lTempInteger_1 = mi_lTempInteger_1.intValue();
                    szTempString_0 = sb_szTempString_0.toString();
                }
                {
                    StringBuilder sb_szMsg;
                    if (szMsg == null)
                        sb_szMsg = new StringBuilder(32);
                    else
                        sb_szMsg = new StringBuilder(szMsg);
                    ZeidonStringCopy(sb_szMsg, 1, 0, "Minimum Credits for Term ,", 1, 0, 301);
                    szMsg = sb_szMsg.toString();
                }
                {
                    StringBuilder sb_szMsg;
                    if (szMsg == null)
                        sb_szMsg = new StringBuilder(32);
                    else
                        sb_szMsg = new StringBuilder(szMsg);
                    ZeidonStringConcat(sb_szMsg, 1, 0, szTempString_0, 1, 0, 301);
                    szMsg = sb_szMsg.toString();
                }
                {
                    StringBuilder sb_szMsg;
                    if (szMsg == null)
                        sb_szMsg = new StringBuilder(32);
                    else
                        sb_szMsg = new StringBuilder(szMsg);
                    ZeidonStringConcat(sb_szMsg, 1, 0, ", have not all been specified.", 1, 0, 301);
                    szMsg = sb_szMsg.toString();
                }
                {
                    StringBuilder sb_szMsg;
                    if (szMsg == null)
                        sb_szMsg = new StringBuilder(32);
                    else
                        sb_szMsg = new StringBuilder(szMsg);
                    ZeidonStringConcat(sb_szMsg, 1, 0, NEW_LINE, 1, 0, 301);
                    szMsg = sb_szMsg.toString();
                }
                {
                    StringBuilder sb_szMsg;
                    if (szMsg == null)
                        sb_szMsg = new StringBuilder(32);
                    else
                        sb_szMsg = new StringBuilder(szMsg);
                    ZeidonStringConcat(sb_szMsg, 1, 0, "The 'Generate Charges' process is being aborted.", 1, 0,
                            301);
                    szMsg = sb_szMsg.toString();
                }
                //:MessageSend( mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, 0 )
                MessageSend(mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, 0);
                //:RETURN -1
                if (8 == 8)
                    return (-1);
            }

            //:END
        }

        //:END
    }

    //:END

    //:szInternalRuleName = mSAChrgT.SATransactionCode.InternalRuleName
    {
        MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2);
        StringBuilder sb_szInternalRuleName;
        if (szInternalRuleName == null)
            sb_szInternalRuleName = new StringBuilder(32);
        else
            sb_szInternalRuleName = new StringBuilder(szInternalRuleName);
        GetVariableFromAttribute(sb_szInternalRuleName, mi_lTempInteger_2, 'S', 51, mSAChrgT,
                "SATransactionCode", "InternalRuleName", "", 0);
        lTempInteger_2 = mi_lTempInteger_2.intValue();
        szInternalRuleName = sb_szInternalRuleName.toString();
    }
    //:szTransactionCode  = mSAChrgT.SATransactionCode.TransactionCode
    {
        MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3);
        StringBuilder sb_szTransactionCode;
        if (szTransactionCode == null)
            sb_szTransactionCode = new StringBuilder(32);
        else
            sb_szTransactionCode = new StringBuilder(szTransactionCode);
        GetVariableFromAttribute(sb_szTransactionCode, mi_lTempInteger_3, 'S', 11, mSAChrgT,
                "SATransactionCode", "TransactionCode", "", 0);
        lTempInteger_3 = mi_lTempInteger_3.intValue();
        szTransactionCode = sb_szTransactionCode.toString();
    }

    //:IF szInternalRuleName = ""
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "", 1, 0, 51) == 0) {
        //:szMsg = "The Internal Rule Name for Transaction '" + mSAChrgT.SATransactionCode.Description + "' is null."
        {
            MutableInt mi_lTempInteger_4 = new MutableInt(lTempInteger_4);
            StringBuilder sb_szTempString_1;
            if (szTempString_1 == null)
                sb_szTempString_1 = new StringBuilder(32);
            else
                sb_szTempString_1 = new StringBuilder(szTempString_1);
            GetVariableFromAttribute(sb_szTempString_1, mi_lTempInteger_4, 'S', 255, mSAChrgT,
                    "SATransactionCode", "Description", "", 0);
            lTempInteger_4 = mi_lTempInteger_4.intValue();
            szTempString_1 = sb_szTempString_1.toString();
        }
        {
            StringBuilder sb_szMsg;
            if (szMsg == null)
                sb_szMsg = new StringBuilder(32);
            else
                sb_szMsg = new StringBuilder(szMsg);
            ZeidonStringCopy(sb_szMsg, 1, 0, "The Internal Rule Name for Transaction '", 1, 0, 301);
            szMsg = sb_szMsg.toString();
        }
        {
            StringBuilder sb_szMsg;
            if (szMsg == null)
                sb_szMsg = new StringBuilder(32);
            else
                sb_szMsg = new StringBuilder(szMsg);
            ZeidonStringConcat(sb_szMsg, 1, 0, szTempString_1, 1, 0, 301);
            szMsg = sb_szMsg.toString();
        }
        {
            StringBuilder sb_szMsg;
            if (szMsg == null)
                sb_szMsg = new StringBuilder(32);
            else
                sb_szMsg = new StringBuilder(szMsg);
            ZeidonStringConcat(sb_szMsg, 1, 0, "' is null.", 1, 0, 301);
            szMsg = sb_szMsg.toString();
        }
        //:MessageSend( mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, 0 )
        MessageSend(mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, 0);
        //:RETURN -1
        if (8 == 8)
            return (-1);
    }

    //:END

    //:// Determine if all Classes have been dropped before the first day of class and set a flag if they have.
    //:// This is used below to give a full refund when a student drops classes.
    //:// We will initialize the flag as set and then reset it if any enrollment entry has status enrolled or completed or
    //:// is dropped with a dropped date after the first day of classes.
    //:szDroppedAllClassesFlag = "Y"
    {
        StringBuilder sb_szDroppedAllClassesFlag;
        if (szDroppedAllClassesFlag == null)
            sb_szDroppedAllClassesFlag = new StringBuilder(32);
        else
            sb_szDroppedAllClassesFlag = new StringBuilder(szDroppedAllClassesFlag);
        ZeidonStringCopy(sb_szDroppedAllClassesFlag, 1, 0, "Y", 1, 0, 2);
        szDroppedAllClassesFlag = sb_szDroppedAllClassesFlag.toString();
    }
    //:szFirstClassDate = mSAProf.PeriodCollegeTerm.CourseStartDate
    {
        MutableInt mi_lTempInteger_5 = new MutableInt(lTempInteger_5);
        StringBuilder sb_szFirstClassDate;
        if (szFirstClassDate == null)
            sb_szFirstClassDate = new StringBuilder(32);
        else
            sb_szFirstClassDate = new StringBuilder(szFirstClassDate);
        GetVariableFromAttribute(sb_szFirstClassDate, mi_lTempInteger_5, 'S', 9, mSAProf, "PeriodCollegeTerm",
                "CourseStartDate", "", 0);
        lTempInteger_5 = mi_lTempInteger_5.intValue();
        szFirstClassDate = sb_szFirstClassDate.toString();
    }
    //:FOR EACH mSAProf.TermEnrolled 
    RESULT = SetCursorFirstEntity(mSAProf, "TermEnrolled", "");
    while (RESULT > zCURSOR_UNCHANGED) {
        //:IF mSAProf.TermEnrolled.Status = "T" OR 
        //:   mSAProf.TermEnrolled.Status = "C" OR 
        //:   mSAProf.TermEnrolled.Status = "W" OR
        //:   ( mSAProf.TermEnrolled.Status = "D" AND mSAProf.TermEnrolled.DroppedDate > szFirstClassDate )
        if (CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "T") == 0
                || CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "C") == 0
                || CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "W") == 0
                || (CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "D") == 0
                        && CompareAttributeToString(mSAProf, "TermEnrolled", "DroppedDate",
                                szFirstClassDate) > 0)) {

            //:szDroppedAllClassesFlag = ""
            {
                StringBuilder sb_szDroppedAllClassesFlag;
                if (szDroppedAllClassesFlag == null)
                    sb_szDroppedAllClassesFlag = new StringBuilder(32);
                else
                    sb_szDroppedAllClassesFlag = new StringBuilder(szDroppedAllClassesFlag);
                ZeidonStringCopy(sb_szDroppedAllClassesFlag, 1, 0, "", 1, 0, 2);
                szDroppedAllClassesFlag = sb_szDroppedAllClassesFlag.toString();
            }
        }

        RESULT = SetCursorNextEntity(mSAProf, "TermEnrolled", "");
        //:END
    }

    //:END

    //:// GRADUATE CHARGE/CREDIT

    //:// The Student is simply charged an amount per credit hour.

    //:// Student is simply charged per credit regardless of Undergrad/Grad status.

    //:IF szInternalRuleName = "Graduate Charge/Credit"
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "Graduate Charge/Credit", 1, 0, 51) == 0) {

        //:// We skip if the student is Distance Learning, as charges there are computed separately.
        //://SET CURSOR FIRST  mSAProf.Category WHERE mSAProf.Category.Name = "Distance Learning" 
        //://IF RESULT >= zCURSOR_SET
        //:IF mSAProf.Student.AdultStudiesFlag = "Y"
        if (CompareAttributeToString(mSAProf, "Student", "AdultStudiesFlag", "Y") == 0) {
            //:RETURN -1
            if (8 == 8)
                return (-1);
        }

        //:END

        //:// Make sure they are not both medtech and grad
        //:SET CURSOR FIRST  mSAProf.Category WHERE mSAProf.Category.Name = "Clinical Lab Science" 
        RESULT = SetCursorFirstEntityByString(mSAProf, "Category", "Name", "Clinical Lab Science", "");
        //:IF RESULT >= zCURSOR_SET
        if (RESULT >= zCURSOR_SET) {
            //:RETURN -1
            if (8 == 8)
                return (-1);
        }

        //:END

        //:szFoundRuleFlag = "Y"
        {
            StringBuilder sb_szFoundRuleFlag;
            if (szFoundRuleFlag == null)
                sb_szFoundRuleFlag = new StringBuilder(32);
            else
                sb_szFoundRuleFlag = new StringBuilder(szFoundRuleFlag);
            ZeidonStringCopy(sb_szFoundRuleFlag, 1, 0, "Y", 1, 0, 2);
            szFoundRuleFlag = sb_szFoundRuleFlag.toString();
        }

        //:SET CURSOR FIRST mSAChrgT.SAInternalRuleVariable 
        //:           WHERE mSAChrgT.SAInternalRuleVariable.Name = "Charge/Credit"
        RESULT = SetCursorFirstEntityByString(mSAChrgT, "SAInternalRuleVariable", "Name", "Charge/Credit", "");
        //:IF RESULT < zCURSOR_SET
        if (RESULT < zCURSOR_SET) {
            //:szMsg = "Missing variable name, 'Charge/Credit', for Internal Rule," + szInternalRuleName + "'."
            {
                StringBuilder sb_szMsg;
                if (szMsg == null)
                    sb_szMsg = new StringBuilder(32);
                else
                    sb_szMsg = new StringBuilder(szMsg);
                ZeidonStringCopy(sb_szMsg, 1, 0, "Missing variable name, 'Charge/Credit', for Internal Rule,",
                        1, 0, 301);
                szMsg = sb_szMsg.toString();
            }
            {
                StringBuilder sb_szMsg;
                if (szMsg == null)
                    sb_szMsg = new StringBuilder(32);
                else
                    sb_szMsg = new StringBuilder(szMsg);
                ZeidonStringConcat(sb_szMsg, 1, 0, szInternalRuleName, 1, 0, 301);
                szMsg = sb_szMsg.toString();
            }
            {
                StringBuilder sb_szMsg;
                if (szMsg == null)
                    sb_szMsg = new StringBuilder(32);
                else
                    sb_szMsg = new StringBuilder(szMsg);
                ZeidonStringConcat(sb_szMsg, 1, 0, "'.", 1, 0, 301);
                szMsg = sb_szMsg.toString();
            }
            //:MessageSend( mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, 0 )
            MessageSend(mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, 0);
            //:RETURN -1
            if (8 == 8)
                return (-1);
        }

        //:END

        //:// Compute total Grad and Audit credits.
        //:dTotalCredits        = 0
        dTotalCredits = 0;
        //:dTotalAuditedCredits = 0
        dTotalAuditedCredits = 0;
        //:FOR EACH mSAProf.TermEnrolled 
        RESULT = SetCursorFirstEntity(mSAProf, "TermEnrolled", "");
        while (RESULT > zCURSOR_UNCHANGED) {

            //:// Only add up enrolled or completed classes that are not Adult Studies (which is Distance Learning).
            //:IF (mSAProf.TermEnrolled.Status ="T" OR mSAProf.TermEnrolled.Status ="C") AND mSAProf.TermClass.AdultStudiesFlag != "Y"
            if ((CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "T") == 0
                    || CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "C") == 0)
                    && CompareAttributeToString(mSAProf, "TermClass", "AdultStudiesFlag", "Y") != 0) {
                //:// Regular Grad Credits.
                //:SET CURSOR FIRST mCollegeLST.College WHERE mCollegeLST.College.ID = mSAProf.TermCourseCollege.ID 
                {
                    MutableInt mi_lTempInteger_6 = new MutableInt(lTempInteger_6);
                    GetIntegerFromAttribute(mi_lTempInteger_6, mSAProf, "TermCourseCollege", "ID");
                    lTempInteger_6 = mi_lTempInteger_6.intValue();
                }
                RESULT = SetCursorFirstEntityByInteger(mCollegeLST, "College", "ID", lTempInteger_6, "");
                //:IF mCollegeLST.College.Type = "G"
                if (CompareAttributeToString(mCollegeLST, "College", "Type", "G") == 0) {
                    //:dTotalCredits = dTotalCredits + mSAProf.TermEnrolled.CreditHours
                    {
                        MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                        GetDecimalFromAttribute(md_dTempDecimal_0, mSAProf, "TermEnrolled", "CreditHours");
                        dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                    }
                    dTotalCredits = dTotalCredits + dTempDecimal_0;
                }

                //:END

                //:// Audit Credits.
                //:IF mSAProf.TermEnrolled.TakingClassType = "A" AND mCollegeLST.College.Type = "G"
                if (CompareAttributeToString(mSAProf, "TermEnrolled", "TakingClassType", "A") == 0
                        && CompareAttributeToString(mCollegeLST, "College", "Type", "G") == 0) {
                    //://dTotalAuditedCredits = dTotalAuditedCredits + mSAProf.TermEnrolled.CreditHours
                    //:dTotalAuditedCredits = dTotalAuditedCredits + mSAProf.Class.CreditHours
                    {
                        MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1);
                        GetDecimalFromAttribute(md_dTempDecimal_1, mSAProf, "Class", "CreditHours");
                        dTempDecimal_1 = md_dTempDecimal_1.doubleValue();
                    }
                    dTotalAuditedCredits = dTotalAuditedCredits + dTempDecimal_1;
                }

                //:END
            }

            RESULT = SetCursorNextEntity(mSAProf, "TermEnrolled", "");
            //:END
        }

        //:   
        //:END

        //:IF szRefundFlag = ""
        if (ZeidonStringCompare(szRefundFlag, 1, 0, "", 1, 0, 2) == 0) {
            //:// Only process for Graduate Student that is taking credits.
            //:// dTotalCredits = mSAProf.PeriodCollegeTerm.dCreditsEnrolledCompleted

            //://IF mSAProf.Student.CurrentLevel = "6"  AND     // 6 is Graduate Student.
            //://   dTotalCredits > 0
            //:IF dTotalCredits > 0
            if (dTotalCredits > 0) {

                //:// Regular Charge, not a refund.
                //:dChargePerCreditHour = mSAChrgT.SAInternalRuleVariable.Value 
                {
                    MutableDouble md_dChargePerCreditHour = new MutableDouble(dChargePerCreditHour);
                    GetDecimalFromAttribute(md_dChargePerCreditHour, mSAChrgT, "SAInternalRuleVariable",
                            "Value");
                    dChargePerCreditHour = md_dChargePerCreditHour.doubleValue();
                }
                //:dAmount = dTotalCredits * dChargePerCreditHour
                dAmount = dTotalCredits * dChargePerCreditHour;
                //:dAmountAudit = dTotalAuditedCredits * ( dChargePerCreditHour / 2 )
                dAmountAudit = dTotalAuditedCredits * (dChargePerCreditHour / 2);
                //:dAmount = dAmount + dAmountAudit 
                dAmount = dAmount + dAmountAudit;

                //:// Generate the charge if it doesn't already exist, which is determined inside operation GenerateChargeEntry.
                //:nRC = GenerateChargeEntry( mSAChrgT, mSAProf, dAmount, "" )
                nRC = omSAChrgT_GenerateChargeEntry(mSAChrgT, mSAProf, dAmount, "");
                //:IF nRC >= 0
                if (nRC >= 0) {
                    //:// Add number of overload credits to description.
                    //:szDisplayCredits = dTotalCredits
                    {
                        StringBuilder sb_szDisplayCredits;
                        if (szDisplayCredits == null)
                            sb_szDisplayCredits = new StringBuilder(32);
                        else
                            sb_szDisplayCredits = new StringBuilder(szDisplayCredits);
                        ZeidonStringConvertFromNumber(sb_szDisplayCredits, 1, 0, 20, 0, dTotalCredits, "D");
                        szDisplayCredits = sb_szDisplayCredits.toString();
                    }
                    //:szDesc = mSAProf.StudentAccountTransApplied.Description + " - " + szDisplayCredits + " CR"
                    {
                        StringBuilder sb_szDesc;
                        if (szDesc == null)
                            sb_szDesc = new StringBuilder(32);
                        else
                            sb_szDesc = new StringBuilder(szDesc);
                        GetStringFromAttribute(sb_szDesc, mSAProf, "StudentAccountTransApplied", "Description");
                        szDesc = sb_szDesc.toString();
                    }
                    {
                        StringBuilder sb_szDesc;
                        if (szDesc == null)
                            sb_szDesc = new StringBuilder(32);
                        else
                            sb_szDesc = new StringBuilder(szDesc);
                        ZeidonStringConcat(sb_szDesc, 1, 0, " - ", 1, 0, 101);
                        szDesc = sb_szDesc.toString();
                    }
                    {
                        StringBuilder sb_szDesc;
                        if (szDesc == null)
                            sb_szDesc = new StringBuilder(32);
                        else
                            sb_szDesc = new StringBuilder(szDesc);
                        ZeidonStringConcat(sb_szDesc, 1, 0, szDisplayCredits, 1, 0, 101);
                        szDesc = sb_szDesc.toString();
                    }
                    {
                        StringBuilder sb_szDesc;
                        if (szDesc == null)
                            sb_szDesc = new StringBuilder(32);
                        else
                            sb_szDesc = new StringBuilder(szDesc);
                        ZeidonStringConcat(sb_szDesc, 1, 0, " CR", 1, 0, 101);
                        szDesc = sb_szDesc.toString();
                    }
                    //:mSAProf.StudentAccountTransApplied.Description = szDesc
                    SetAttributeFromString(mSAProf, "StudentAccountTransApplied", "Description", szDesc);
                    //:RETURN 0 
                    if (8 == 8)
                        return (0);
                }

                //:END
            }

            //:END
            //:ELSE
        } else {
            //:// Refund.
            //:// Note that we will process a Refund if the Amount has changed and the latest Dropped Date for a Class is not later
            //:// than the AddDropDeadlineDate for the Term. The new Amount will be added back in GenerateCharges.
            //:// Also note that we are currently positioned on the PeriodTransApplied entry to be reversed.
            //:dTotalCredits = mSAProf.PeriodCollegeTerm.dCreditsEnrolledCompleted
            {
                MutableDouble md_dTotalCredits = new MutableDouble(dTotalCredits);
                GetDecimalFromAttribute(md_dTotalCredits, mSAProf, "PeriodCollegeTerm",
                        "dCreditsEnrolledCompleted");
                dTotalCredits = md_dTotalCredits.doubleValue();
            }
            //:IF dTotalCredits < 0
            if (dTotalCredits < 0) {
                //:dTotalCredits = 0
                dTotalCredits = 0;
            }

            //:END
            //:dChargePerCreditHour = mSAChrgT.SAInternalRuleVariable.Value 
            {
                MutableDouble md_dChargePerCreditHour = new MutableDouble(dChargePerCreditHour);
                GetDecimalFromAttribute(md_dChargePerCreditHour, mSAChrgT, "SAInternalRuleVariable", "Value");
                dChargePerCreditHour = md_dChargePerCreditHour.doubleValue();
            }
            //:dAmount = dTotalCredits * dChargePerCreditHour
            dAmount = dTotalCredits * dChargePerCreditHour;
            //:IF dAmount != mSAProf.PeriodTransApplied.Amount
            if (CompareAttributeToDecimal(mSAProf, "PeriodTransApplied", "Amount", dAmount) != 0) {
                //:// Go to create refund or give User and error message, if any classes were dropped after Add/Drop deadline.
                //:CreateRefundByDropDate( mSAChrgT, mSAProf )
                omSAChrgT_CreateRefundByDropDate(mSAChrgT, mSAProf);
                //:RETURN 0 
                if (8 == 8)
                    return (0);
            }

            //:END
        }

        //:END
    }

    //:END

    //:// UNDERGRAD TUITION CHARGE CREDIT    
    //:IF szInternalRuleName = "Undergrad Tuition Block Charge"
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "Undergrad Tuition Block Charge", 1, 0, 51) == 0) {
        //:szFoundRuleFlag = "Y"
        {
            StringBuilder sb_szFoundRuleFlag;
            if (szFoundRuleFlag == null)
                sb_szFoundRuleFlag = new StringBuilder(32);
            else
                sb_szFoundRuleFlag = new StringBuilder(szFoundRuleFlag);
            ZeidonStringCopy(sb_szFoundRuleFlag, 1, 0, "Y", 1, 0, 2);
            szFoundRuleFlag = sb_szFoundRuleFlag.toString();
        }
        //:nRC = Rule_UnderGradTuition( mSAChrgT, mSAProf, szRefundFlag )
        nRC = omSAChrgT_Rule_UnderGradTuition(mSAChrgT, mSAProf, szRefundFlag);
        //:RETURN nRC 
        if (8 == 8)
            return (nRC);
    }

    //:END    

    //:// HEALTH INSURANCE

    //:// Student is charged once per school year according to rules below.

    //:IF szInternalRuleName = "Health Insurance"
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "Health Insurance", 1, 0, 51) == 0) {

        //:szFoundRuleFlag = "Y"
        {
            StringBuilder sb_szFoundRuleFlag;
            if (szFoundRuleFlag == null)
                sb_szFoundRuleFlag = new StringBuilder(32);
            else
                sb_szFoundRuleFlag = new StringBuilder(szFoundRuleFlag);
            ZeidonStringCopy(sb_szFoundRuleFlag, 1, 0, "Y", 1, 0, 2);
            szFoundRuleFlag = sb_szFoundRuleFlag.toString();
        }

        //:// This rule is ignored for Distance Learning Students.
        //://SET CURSOR FIRST mSAProf.Category WHERE mSAProf.Category.Name = "Distance Learning"
        //://                                     OR mSAProf.Category.Name = "ADP Student"
        //://IF RESULT >= zCURSOR_SET
        //:IF mSAProf.Student.AdultStudiesFlag = "Y"
        if (CompareAttributeToString(mSAProf, "Student", "AdultStudiesFlag", "Y") == 0) {
            //:RETURN 
            if (8 == 8)
                return (0);
        }

        //:END

        //:// A single Fee is charged per College Year. *** Overridden as explained below.
        //:// There is no charge if the student is taking less than 6 credits.
        //:// For Fall, it is always charged when student has 6 credits or more.
        //:// For Spring, it is charged only if it wasn't charged in the Fall of the same College Year.
        //:// If the student is international (VisaClassification is "F-1"), the "Foreign Student Insurance" transaction, "F1INSURA",
        //:// is used for generating the charge.
        //:// Otherwise, the student is domestic and the "Student Insurance" transaction, "INSURANC", is used (which is the transaction
        //:// triggering this rule).

        //:// On 6/27/2012, the above rule was changed so that the charge was made every Term, instead of once per year.

        //:// Because we may generate the charge to a different TransactionCode, we will create a new view to hold the charge TransactionCode.
        //:CreateViewFromView( mSAChrgT2, mSAChrgT )
        CreateViewFromView(mSAChrgT2, mSAChrgT);
        //:NAME VIEW mSAChrgT2 "mSAChrgT2"
        SetNameForView(mSAChrgT2, "mSAChrgT2", null, zLEVEL_TASK);

        //:// First determine the charge.
        //:dAmount = 0
        dAmount = 0;
        //:IF mSAProf.Student.Status = "N" OR szDroppedAllClassesFlag = "Y"
        if (CompareAttributeToString(mSAProf, "Student", "Status", "N") == 0
                || ZeidonStringCompare(szDroppedAllClassesFlag, 1, 0, "Y", 1, 0, 2) == 0) {
            //:// For NoShow Status or if all classes were dropped before start of classes, there is no charge.

            //:ELSE
        } else {

            //:// If the Student has Medical Exemption set, there also is no charge.
            //:szExemptionFlag = ""
            {
                StringBuilder sb_szExemptionFlag;
                if (szExemptionFlag == null)
                    sb_szExemptionFlag = new StringBuilder(32);
                else
                    sb_szExemptionFlag = new StringBuilder(szExemptionFlag);
                ZeidonStringCopy(sb_szExemptionFlag, 1, 0, "", 1, 0, 2);
                szExemptionFlag = sb_szExemptionFlag.toString();
            }
            //:IF mSAProf.StudentHealth EXISTS
            lTempInteger_7 = CheckExistenceOfEntity(mSAProf, "StudentHealth");
            if (lTempInteger_7 == 0) {
                //:// The following IF was changed on 8/20/2012 by DonC per email request from Chas on 8/18 at 5:33PM.
                //://IF mSAProf.StudentHealth.MedicalExemptionFlag = "Y"
                //:IF mSAProf.StudentHealth.RelgiousExemptionFlag = "Y"
                if (CompareAttributeToString(mSAProf, "StudentHealth", "RelgiousExemptionFlag", "Y") == 0) {
                    //:szExemptionFlag = "Y"
                    {
                        StringBuilder sb_szExemptionFlag;
                        if (szExemptionFlag == null)
                            sb_szExemptionFlag = new StringBuilder(32);
                        else
                            sb_szExemptionFlag = new StringBuilder(szExemptionFlag);
                        ZeidonStringCopy(sb_szExemptionFlag, 1, 0, "Y", 1, 0, 2);
                        szExemptionFlag = sb_szExemptionFlag.toString();
                    }
                }

                //:END
            }

            //:END
            //:IF szExemptionFlag = "Y"
            if (ZeidonStringCompare(szExemptionFlag, 1, 0, "Y", 1, 0, 2) == 0) {
                //:// Religious Exemption is set.

                //:ELSE
            } else {

                //:dTotalCredits = mSAProf.PeriodCollegeTerm.dCreditsEnrolledCompleted
                {
                    MutableDouble md_dTotalCredits = new MutableDouble(dTotalCredits);
                    GetDecimalFromAttribute(md_dTotalCredits, mSAProf, "PeriodCollegeTerm",
                            "dCreditsEnrolledCompleted");
                    dTotalCredits = md_dTotalCredits.doubleValue();
                }
                //:IF mSAProf.Demographics.VisaClassification = "F-1"
                if (CompareAttributeToString(mSAProf, "Demographics", "VisaClassification", "F-1") == 0) {
                    //:dMaximumCredits = 1
                    dMaximumCredits = 1;
                    //:ELSE
                } else {
                    //:dMaximumCredits = 6
                    dMaximumCredits = 6;
                }

                //:END

                //:IF dTotalCredits >= dMaximumCredits AND
                //:   mSAProf.StudentHealth.InternalInsuranceCompanyFlag = "Y" AND 
                //:   ( mSAProf.PeriodCollegeTerm.Semester = "01" OR mSAProf.PeriodCollegeTerm.Semester = "03" )
                if (dTotalCredits >= dMaximumCredits
                        && CompareAttributeToString(mSAProf, "StudentHealth", "InternalInsuranceCompanyFlag",
                                "Y") == 0
                        && (CompareAttributeToString(mSAProf, "PeriodCollegeTerm", "Semester", "01") == 0
                                || CompareAttributeToString(mSAProf, "PeriodCollegeTerm", "Semester",
                                        "03") == 0)) {

                    //:// If the Student is International, position on that SA Transaction. Otherwise position on the transaction
                    //:// triggering this rule.
                    //:IF mSAProf.Demographics.VisaClassification = "F-1"
                    if (CompareAttributeToString(mSAProf, "Demographics", "VisaClassification", "F-1") == 0) {
                        //:SET CURSOR FIRST mSAChrgT2.SATransactionCode WHERE mSAChrgT2.SATransactionCode.TransactionCode = "F1INSURA" 
                        RESULT = SetCursorFirstEntityByString(mSAChrgT2, "SATransactionCode", "TransactionCode",
                                "F1INSURA", "");
                        //:ELSE
                    } else {
                        //:SET CURSOR FIRST mSAChrgT2.SATransactionCode WHERE mSAChrgT2.SATransactionCode.ID = mSAChrgT.SATransactionCode.ID
                        {
                            MutableInt mi_lTempInteger_8 = new MutableInt(lTempInteger_8);
                            GetIntegerFromAttribute(mi_lTempInteger_8, mSAChrgT, "SATransactionCode", "ID");
                            lTempInteger_8 = mi_lTempInteger_8.intValue();
                        }
                        RESULT = SetCursorFirstEntityByInteger(mSAChrgT2, "SATransactionCode", "ID",
                                lTempInteger_8, "");
                    }

                    //:END

                    //:IF mSAProf.PeriodCollegeTerm.Semester = "01" OR 
                    //:   mSAProf.PeriodCollegeTerm.Semester = "03" 
                    if (CompareAttributeToString(mSAProf, "PeriodCollegeTerm", "Semester", "01") == 0
                            || CompareAttributeToString(mSAProf, "PeriodCollegeTerm", "Semester", "03") == 0) {

                        //:// Always charge fee for Fall and Spring.
                        //:dAmount = mSAChrgT2.SATransactionTerm.Amount
                        {
                            MutableDouble md_dAmount = new MutableDouble(dAmount);
                            GetDecimalFromAttribute(md_dAmount, mSAChrgT2, "SATransactionTerm", "Amount");
                            dAmount = md_dAmount.doubleValue();
                        }
                        //:ELSE
                    } else {

                        //:IF mSAProf.PeriodCollegeTerm.Semester = "04"
                        if (CompareAttributeToString(mSAProf, "PeriodCollegeTerm", "Semester", "04") == 0) {
                            //:// It's Summer, so see if we've already paid it in the Spring. To do that, we'll need to locate
                            //:// the Spring Term.
                            //:CreateViewFromView( lSATermLST2, lSATermLST )
                            CreateViewFromView(lSATermLST2, lSATermLST);
                            //:SET CURSOR FIRST lSATermLST2.CollegeTerm WHERE lSATermLST2.CollegeTerm.Semester = "03" AND 
                            //:                                               lSATermLST2.CollegeYear.ID       = mSAProf.PeriodCollegeYear.ID
                            RESULT = SetCursorFirstEntity(lSATermLST2, "CollegeTerm", "");
                            if (RESULT > zCURSOR_UNCHANGED) {
                                while (RESULT > zCURSOR_UNCHANGED && (CompareAttributeToString(lSATermLST2,
                                        "CollegeTerm", "Semester", "03") != 0
                                        || CompareAttributeToAttribute(lSATermLST2, "CollegeYear", "ID",
                                                mSAProf, "PeriodCollegeYear", "ID") != 0)) {
                                    RESULT = SetCursorNextEntity(lSATermLST2, "CollegeTerm", "");
                                }

                            }

                            //:IF RESULT < zCURSOR_SET
                            if (RESULT < zCURSOR_SET) {
                                //:IssueError( mSAProf,0,0, "Programming Error Fall Semester" )
                                IssueError(mSAProf, 0, 0, "Programming Error Fall Semester");
                            }

                            //:END
                            //:szFallHealthInsuranceTranCode = "INSURANC"
                            {
                                StringBuilder sb_szFallHealthInsuranceTranCode;
                                if (szFallHealthInsuranceTranCode == null)
                                    sb_szFallHealthInsuranceTranCode = new StringBuilder(32);
                                else
                                    sb_szFallHealthInsuranceTranCode = new StringBuilder(
                                            szFallHealthInsuranceTranCode);
                                ZeidonStringCopy(sb_szFallHealthInsuranceTranCode, 1, 0, "INSURANC", 1, 0, 11);
                                szFallHealthInsuranceTranCode = sb_szFallHealthInsuranceTranCode.toString();
                            }
                            //:// Since there could be a refund as well as a charge, we'll total up Spring Transactions of the Insurance type.
                            //:dTotal = 0
                            dTotal = 0;
                            //:FOR EACH mSAProf.StudentAccountTransApplied
                            RESULT = SetCursorFirstEntity(mSAProf, "StudentAccountTransApplied", "");
                            while (RESULT > zCURSOR_UNCHANGED) {
                                //:IF mSAProf.SATransactionCode.TransactionCode = szFallHealthInsuranceTranCode AND 
                                //:   mSAProf.AppliedBillingPeriodTerm.ID = lSATermLST2.CollegeTerm.ID 
                                if (CompareAttributeToString(mSAProf, "SATransactionCode", "TransactionCode",
                                        szFallHealthInsuranceTranCode) == 0
                                        && CompareAttributeToAttribute(mSAProf, "AppliedBillingPeriodTerm",
                                                "ID", lSATermLST2, "CollegeTerm", "ID") == 0) {

                                    //:dTotal = dTotal + mSAProf.StudentAccountTransApplied.Amount
                                    {
                                        MutableDouble md_dTempDecimal_2 = new MutableDouble(dTempDecimal_2);
                                        GetDecimalFromAttribute(md_dTempDecimal_2, mSAProf,
                                                "StudentAccountTransApplied", "Amount");
                                        dTempDecimal_2 = md_dTempDecimal_2.doubleValue();
                                    }
                                    dTotal = dTotal + dTempDecimal_2;
                                }

                                RESULT = SetCursorNextEntity(mSAProf, "StudentAccountTransApplied", "");
                                //:END
                            }

                            //:END
                            //:IF dTotal > 0 
                            if (dTotal > 0) {
                                //:// The Fee was paid in the Spring.
                                //:dAmount = 0
                                dAmount = 0;
                                //:ELSE
                            } else {
                                //:// The Fee was not paid and needs to be charged.
                                //:dAmount = mSAChrgT2.SATransactionTerm.Amount 
                                {
                                    MutableDouble md_dAmount = new MutableDouble(dAmount);
                                    GetDecimalFromAttribute(md_dAmount, mSAChrgT2, "SATransactionTerm",
                                            "Amount");
                                    dAmount = md_dAmount.doubleValue();
                                }
                            }

                            //:END
                            //:DropView( lSATermLST2 )
                            DropView(lSATermLST2);
                        }

                        //:END
                    }

                    //:END
                }

                //:END
            }

            //:END
        }

        //:END

        //:// Process resulting Charge or Refund.
        //:IF szRefundFlag = ""
        if (ZeidonStringCompare(szRefundFlag, 1, 0, "", 1, 0, 2) == 0) {
            //:// Regular Charge, not Refund. Generate entry if there is a positive amount.
            //:IF dAmount > 0
            if (dAmount > 0) {
                //:// Generate the charge if it isn't already there.
                //:GenerateChargeEntry( mSAChrgT2, mSAProf, dAmount, "" )
                omSAChrgT_GenerateChargeEntry(mSAChrgT2, mSAProf, dAmount, "");

                //:// For a Health Insurance charge, we need to set the Transaction Date based on the InsuranceBenefit date for
                //:// the term, either Domestic or International. If the current date is NOT greater than the end of the month of the
                //:// benefit date, then change the Transaction Date to the correct benefit date. Otherwise, we will keep today's date.
                //:IF mSAProf.Demographics.VisaClassification = "F-1"
                if (CompareAttributeToString(mSAProf, "Demographics", "VisaClassification", "F-1") == 0) {
                    //:// Use International benefit date.
                    //:szInsuranceBenefitDate = mSAProf.PeriodCollegeTerm.InsuranceBenefitDateInternat 
                    {
                        MutableInt mi_lTempInteger_9 = new MutableInt(lTempInteger_9);
                        StringBuilder sb_szInsuranceBenefitDate;
                        if (szInsuranceBenefitDate == null)
                            sb_szInsuranceBenefitDate = new StringBuilder(32);
                        else
                            sb_szInsuranceBenefitDate = new StringBuilder(szInsuranceBenefitDate);
                        GetVariableFromAttribute(sb_szInsuranceBenefitDate, mi_lTempInteger_9, 'S', 9, mSAProf,
                                "PeriodCollegeTerm", "InsuranceBenefitDateInternat", "", 0);
                        lTempInteger_9 = mi_lTempInteger_9.intValue();
                        szInsuranceBenefitDate = sb_szInsuranceBenefitDate.toString();
                    }
                    //:ELSE
                } else {
                    //:// Use Domestic benefit date.
                    //:szInsuranceBenefitDate = mSAProf.PeriodCollegeTerm.InsuranceBenefitDateDomestic 
                    {
                        MutableInt mi_lTempInteger_10 = new MutableInt(lTempInteger_10);
                        StringBuilder sb_szInsuranceBenefitDate;
                        if (szInsuranceBenefitDate == null)
                            sb_szInsuranceBenefitDate = new StringBuilder(32);
                        else
                            sb_szInsuranceBenefitDate = new StringBuilder(szInsuranceBenefitDate);
                        GetVariableFromAttribute(sb_szInsuranceBenefitDate, mi_lTempInteger_10, 'S', 9, mSAProf,
                                "PeriodCollegeTerm", "InsuranceBenefitDateDomestic", "", 0);
                        lTempInteger_10 = mi_lTempInteger_10.intValue();
                        szInsuranceBenefitDate = sb_szInsuranceBenefitDate.toString();
                    }
                }

                //:END
                //:// Get begining of next month after benefit date. (Note that the month is never 12 (Dec.))
                //:szMonth = szInsuranceBenefitDate[5:2]
                {
                    StringBuilder sb_szMonth;
                    if (szMonth == null)
                        sb_szMonth = new StringBuilder(32);
                    else
                        sb_szMonth = new StringBuilder(szMonth);
                    ZeidonStringCopy(sb_szMonth, 1, 0, szInsuranceBenefitDate, 5, 2, 3);
                    szMonth = sb_szMonth.toString();
                }
                //:Month   = zStringToInteger( szMonth )
                Month = zStringToInteger(szMonth);
                //:Month   = Month  + 1
                Month = Month + 1;
                //:szMonth = Month
                {
                    StringBuilder sb_szMonth;
                    if (szMonth == null)
                        sb_szMonth = new StringBuilder(32);
                    else
                        sb_szMonth = new StringBuilder(szMonth);
                    ZeidonStringConvertFromNumber(sb_szMonth, 1, 0, 2, Month, (double) 0.0, "I");
                    szMonth = sb_szMonth.toString();
                }
                //:szStartOfNextMonthDate = szInsuranceBenefitDate[1:4] + szMonth + "01"
                {
                    StringBuilder sb_szStartOfNextMonthDate;
                    if (szStartOfNextMonthDate == null)
                        sb_szStartOfNextMonthDate = new StringBuilder(32);
                    else
                        sb_szStartOfNextMonthDate = new StringBuilder(szStartOfNextMonthDate);
                    ZeidonStringCopy(sb_szStartOfNextMonthDate, 1, 0, szInsuranceBenefitDate, 1, 4, 9);
                    szStartOfNextMonthDate = sb_szStartOfNextMonthDate.toString();
                }
                {
                    StringBuilder sb_szStartOfNextMonthDate;
                    if (szStartOfNextMonthDate == null)
                        sb_szStartOfNextMonthDate = new StringBuilder(32);
                    else
                        sb_szStartOfNextMonthDate = new StringBuilder(szStartOfNextMonthDate);
                    ZeidonStringConcat(sb_szStartOfNextMonthDate, 1, 0, szMonth, 1, 0, 9);
                    szStartOfNextMonthDate = sb_szStartOfNextMonthDate.toString();
                }
                {
                    StringBuilder sb_szStartOfNextMonthDate;
                    if (szStartOfNextMonthDate == null)
                        sb_szStartOfNextMonthDate = new StringBuilder(32);
                    else
                        sb_szStartOfNextMonthDate = new StringBuilder(szStartOfNextMonthDate);
                    ZeidonStringConcat(sb_szStartOfNextMonthDate, 1, 0, "01", 1, 0, 9);
                    szStartOfNextMonthDate = sb_szStartOfNextMonthDate.toString();
                }
                //:szWorkDate = wXferO.Root.dCurrentDate 
                {
                    MutableInt mi_lTempInteger_11 = new MutableInt(lTempInteger_11);
                    StringBuilder sb_szWorkDate;
                    if (szWorkDate == null)
                        sb_szWorkDate = new StringBuilder(32);
                    else
                        sb_szWorkDate = new StringBuilder(szWorkDate);
                    GetVariableFromAttribute(sb_szWorkDate, mi_lTempInteger_11, 'S', 9, wXferO, "Root",
                            "dCurrentDate", "", 0);
                    lTempInteger_11 = mi_lTempInteger_11.intValue();
                    szWorkDate = sb_szWorkDate.toString();
                }
                //:IF szWorkDate < szStartOfNextMonthDate
                if (ZeidonStringCompare(szWorkDate, 1, 0, szStartOfNextMonthDate, 1, 0, 9) > 0) {
                    //:// Change Transaction Date to Benefit Date since today's date is NOT in the next month after benefit date.
                    //:mSAProf.StudentAccountTransApplied.TransactionDate = szInsuranceBenefitDate
                    SetAttributeFromString(mSAProf, "StudentAccountTransApplied", "TransactionDate",
                            szInsuranceBenefitDate);
                }

                //:END
            }

            //:END
            //:ELSE
        } else {
            //:// Refund.
            //:// We'll process a Refund if the Amount has changed.
            //:IF dAmount != mSAProf.PeriodTransApplied.Amount 
            if (CompareAttributeToDecimal(mSAProf, "PeriodTransApplied", "Amount", dAmount) != 0) {
                //:GenerateRefundEntry( mSAChrgT2, mSAProf )
                omSAChrgT_GenerateRefundEntry(mSAChrgT2, mSAProf);
            }

            //:END
        }

        //:END
        //:DropView( mSAChrgT2 )
        DropView(mSAChrgT2);
        //:RETURN 0 
        if (8 == 8)
            return (0);
    }

    //:END

    //:// UNIV110 FEES

    //:// If the Student is taking UNIV110, they will be charged the CKTCAMPS Fee always and the CKTCAMP Fee for Fall Term.

    //:IF szInternalRuleName = "UNIV110 Fees"
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "UNIV110 Fees", 1, 0, 51) == 0) {

        //:szFoundRuleFlag = "Y"
        {
            StringBuilder sb_szFoundRuleFlag;
            if (szFoundRuleFlag == null)
                sb_szFoundRuleFlag = new StringBuilder(32);
            else
                sb_szFoundRuleFlag = new StringBuilder(szFoundRuleFlag);
            ZeidonStringCopy(sb_szFoundRuleFlag, 1, 0, "Y", 1, 0, 2);
            szFoundRuleFlag = sb_szFoundRuleFlag.toString();
        }
        //:dAmount = 0
        dAmount = 0;

        //:// Determine if student is taking UNIV110.
        //:SET CURSOR FIRST mSAProf.TermEnrolled WHERE ( mSAProf.TermEnrolled.Status = "T" OR mSAProf.TermEnrolled.Status = "C" )
        //:                                        AND mSAProf.TermCourse.Number = "UNIV110"
        RESULT = SetCursorFirstEntity(mSAProf, "TermEnrolled", "");
        if (RESULT > zCURSOR_UNCHANGED) {
            while (RESULT > zCURSOR_UNCHANGED
                    && ((CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "T") != 0
                            && CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "C") != 0)
                            || CompareAttributeToString(mSAProf, "TermCourse", "Number", "UNIV110") != 0)) {
                RESULT = SetCursorNextEntity(mSAProf, "TermEnrolled", "");
            }

        }

        //:IF RESULT >= zCURSOR_SET
        if (RESULT >= zCURSOR_SET) {
            //:// Process either CKTCAMP or CKTCAMPS Transaction.
            //:IF mSAChrgT.SATransactionCode.TransactionCode = "CKTCAMPS"
            if (CompareAttributeToString(mSAChrgT, "SATransactionCode", "TransactionCode", "CKTCAMPS") == 0) {
                //:// CKTCAMPS is always charged.
                //:dAmount = mSAChrgT.SATransactionTerm.Amount
                {
                    MutableDouble md_dAmount = new MutableDouble(dAmount);
                    GetDecimalFromAttribute(md_dAmount, mSAChrgT, "SATransactionTerm", "Amount");
                    dAmount = md_dAmount.doubleValue();
                }
                //:ELSE
            } else {
                //:IF mSAChrgT.SATransactionCode.TransactionCode = "CKTCAMP"
                if (CompareAttributeToString(mSAChrgT, "SATransactionCode", "TransactionCode",
                        "CKTCAMP") == 0) {
                    //:// CKTCAMP is only charged in the Fall.
                    //:IF mSAProf.PeriodCollegeTerm.Semester = "01"
                    if (CompareAttributeToString(mSAProf, "PeriodCollegeTerm", "Semester", "01") == 0) {
                        //:dAmount = mSAChrgT.SATransactionTerm.Amount
                        {
                            MutableDouble md_dAmount = new MutableDouble(dAmount);
                            GetDecimalFromAttribute(md_dAmount, mSAChrgT, "SATransactionTerm", "Amount");
                            dAmount = md_dAmount.doubleValue();
                        }
                    }

                    //:END
                }

                //:END
            }

            //:END
        }

        //:END

        //:// Process resulting Charge or Refund.
        //:IF szRefundFlag = ""
        if (ZeidonStringCompare(szRefundFlag, 1, 0, "", 1, 0, 2) == 0) {
            //:// Regular Charge, not Refund. Generate entry if there is a positive amount.
            //:IF dAmount > 0
            if (dAmount > 0) {
                //:// Generate the charge if it isn't already there.
                //:GenerateChargeEntry( mSAChrgT, mSAProf, dAmount, "" )
                omSAChrgT_GenerateChargeEntry(mSAChrgT, mSAProf, dAmount, "");
            }

            //:END
            //:ELSE
        } else {
            //:// Refund.
            //:// We'll process a Refund if the Amount has changed.
            //:IF dAmount != mSAProf.PeriodTransApplied.Amount 
            if (CompareAttributeToDecimal(mSAProf, "PeriodTransApplied", "Amount", dAmount) != 0) {
                //:GenerateRefundEntry( mSAChrgT, mSAProf )
                omSAChrgT_GenerateRefundEntry(mSAChrgT, mSAProf);
            }

            //:END
        }

        //:END
        //:RETURN 0 
        if (8 == 8)
            return (0);
    }

    //:END

    //:// MEAL PLAN

    //:// Student is charged once per College Term.

    //:IF szInternalRuleName = "Meal Plan"
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "Meal Plan", 1, 0, 51) == 0) {

        //:// A single Fee is charged per College Term if the Student has a Meal Plan for the date range
        //:// of the current College Term. We will consider the Meal Plan to be in the date range if either the
        //:// Meal Plan BeginDate or EndDate is within the Term range.

        //:dAmount = 0
        dAmount = 0;

        //:// First find if there is a Meal Plan specified for the current Term.
        //:CreateViewFromView( mSAProf2, mSAProf )
        CreateViewFromView(mSAProf2, mSAProf);
        //:SET CURSOR FIRST mSAProf2.TermOfMealPlan WHERE ( mSAProf2.TermOfMealPlan.BeginDate >= mSAProf2.PeriodCollegeTerm.ResidencyStartDate AND 
        //:                                                 mSAProf2.TermOfMealPlan.BeginDate <= mSAProf2.PeriodCollegeTerm.ResidencyEndDate  )
        //:                                            OR ( mSAProf2.TermOfMealPlan.EndDate   >= mSAProf2.PeriodCollegeTerm.ResidencyStartDate AND 
        //:                                                 mSAProf2.TermOfMealPlan.EndDate   <= mSAProf2.PeriodCollegeTerm.ResidencyEndDate  )
        RESULT = SetCursorFirstEntity(mSAProf2, "TermOfMealPlan", "");
        if (RESULT > zCURSOR_UNCHANGED) {
            while (RESULT > zCURSOR_UNCHANGED && ((CompareAttributeToAttribute(mSAProf2, "TermOfMealPlan",
                    "BeginDate", mSAProf2, "PeriodCollegeTerm", "ResidencyStartDate") < 0
                    || CompareAttributeToAttribute(mSAProf2, "TermOfMealPlan", "BeginDate", mSAProf2,
                            "PeriodCollegeTerm", "ResidencyEndDate") > 0)
                    && (CompareAttributeToAttribute(mSAProf2, "TermOfMealPlan", "EndDate", mSAProf2,
                            "PeriodCollegeTerm", "ResidencyStartDate") < 0
                            || CompareAttributeToAttribute(mSAProf2, "TermOfMealPlan", "EndDate", mSAProf2,
                                    "PeriodCollegeTerm", "ResidencyEndDate") > 0))) {
                RESULT = SetCursorNextEntity(mSAProf2, "TermOfMealPlan", "");
            }

        }

        //:IF RESULT >= zCURSOR_SET 
        if (RESULT >= zCURSOR_SET) {

            //:// There is a Meal Plan for the current Term. See if it is for this Term.
            //:IF mSAProf2.MPSATransactionCode.TransactionCode = mSAChrgT.SATransactionCode.TransactionCode 
            if (CompareAttributeToAttribute(mSAProf2, "MPSATransactionCode", "TransactionCode", mSAChrgT,
                    "SATransactionCode", "TransactionCode") == 0) {
                //:IF RESULT >= zCURSOR_SET 
                if (RESULT >= zCURSOR_SET) {

                    //:// There is a Charge for this Transaction.
                    //:dAmount = mSAChrgT.SATransactionTerm.Amount
                    {
                        MutableDouble md_dAmount = new MutableDouble(dAmount);
                        GetDecimalFromAttribute(md_dAmount, mSAChrgT, "SATransactionTerm", "Amount");
                        dAmount = md_dAmount.doubleValue();
                    }
                }

                //:   
                //:END
            }

            //:END
        }

        //:END
        //:DropView( mSAProf2 )
        DropView(mSAProf2);

        //:// Process resulting Charge or Refund.
        //:IF szRefundFlag = ""
        if (ZeidonStringCompare(szRefundFlag, 1, 0, "", 1, 0, 2) == 0) {
            //:// Regular Charge, not Refund. Generate entry if there is a positive amount.
            //:IF dAmount > 0
            if (dAmount > 0) {
                //:// Generate the charge if it isn't already there.
                //:GenerateChargeEntry( mSAChrgT, mSAProf, dAmount, "" )
                omSAChrgT_GenerateChargeEntry(mSAChrgT, mSAProf, dAmount, "");
            }

            //:END
            //:ELSE
        } else {
            //:// Refund.
            //:// We'll process a Refund if the Amount has changed.
            //:IF dAmount != mSAProf.PeriodTransApplied.Amount 
            if (CompareAttributeToDecimal(mSAProf, "PeriodTransApplied", "Amount", dAmount) != 0) {
                //:GenerateRefundEntry( mSAChrgT, mSAProf )
                omSAChrgT_GenerateRefundEntry(mSAChrgT, mSAProf);
            }

            //:END
        }

        //:END

        //:RETURN 0
        if (8 == 8)
            return (0);
    }

    //:END

    //:// RESIDENCY

    //:// Student is charged once per College Term, based on Residency in Billing Period.

    //:IF szInternalRuleName = "Residency"
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "Residency", 1, 0, 51) == 0) {

        //:// A single Fee is charged per College Term if the Billing Period Residency is Residence Hall.
        //:// If the Billing Period Residency is null, we will use the Residency from the Student entity.

        //:dAmount = 0
        dAmount = 0;

        //:// First get Residency value from Billing Period, or Student, if Billing Period value is null.
        //:IF mSAProf.BillingPeriod.ResidencyStatusTerm = ""
        if (CompareAttributeToString(mSAProf, "BillingPeriod", "ResidencyStatusTerm", "") == 0) {
            //:szResidencyStatus = mSAProf.Student.ResidencyStatus 
            {
                MutableInt mi_lTempInteger_12 = new MutableInt(lTempInteger_12);
                StringBuilder sb_szResidencyStatus;
                if (szResidencyStatus == null)
                    sb_szResidencyStatus = new StringBuilder(32);
                else
                    sb_szResidencyStatus = new StringBuilder(szResidencyStatus);
                GetVariableFromAttribute(sb_szResidencyStatus, mi_lTempInteger_12, 'S', 2, mSAProf, "Student",
                        "ResidencyStatus", "", 0);
                lTempInteger_12 = mi_lTempInteger_12.intValue();
                szResidencyStatus = sb_szResidencyStatus.toString();
            }
            //:ELSE
        } else {
            //:szResidencyStatus = mSAProf.BillingPeriod.ResidencyStatusTerm
            {
                MutableInt mi_lTempInteger_13 = new MutableInt(lTempInteger_13);
                StringBuilder sb_szResidencyStatus;
                if (szResidencyStatus == null)
                    sb_szResidencyStatus = new StringBuilder(32);
                else
                    sb_szResidencyStatus = new StringBuilder(szResidencyStatus);
                GetVariableFromAttribute(sb_szResidencyStatus, mi_lTempInteger_13, 'S', 2, mSAProf,
                        "BillingPeriod", "ResidencyStatusTerm", "", 0);
                lTempInteger_13 = mi_lTempInteger_13.intValue();
                szResidencyStatus = sb_szResidencyStatus.toString();
            }
        }

        //:END

        //:// First find if the is a Resident or Off Campus..
        //:IF szResidencyStatus = "R"
        if (ZeidonStringCompare(szResidencyStatus, 1, 0, "R", 1, 0, 2) == 0) {

            //:// The Student is a Resident. Check if Transaction Code matches Gender.
            //:// RESMEN is Male.
            //:// RESWOMEN is Female.
            //:IF ( mSAChrgT.SATransactionCode.TransactionCode = "RESMEN"   AND mSAProf.Person.Gender = "M" ) OR
            //:   ( mSAChrgT.SATransactionCode.TransactionCode = "RESWOMEN" AND mSAProf.Person.Gender = "F" )
            if ((CompareAttributeToString(mSAChrgT, "SATransactionCode", "TransactionCode", "RESMEN") == 0
                    && CompareAttributeToString(mSAProf, "Person", "Gender", "M") == 0)
                    || (CompareAttributeToString(mSAChrgT, "SATransactionCode", "TransactionCode",
                            "RESWOMEN") == 0
                            && CompareAttributeToString(mSAProf, "Person", "Gender", "F") == 0)) {
                //:   
                //:   // There is a Charge for this Transaction.
                //:   dAmount = mSAChrgT.SATransactionTerm.Amount
                {
                    MutableDouble md_dAmount = new MutableDouble(dAmount);
                    GetDecimalFromAttribute(md_dAmount, mSAChrgT, "SATransactionTerm", "Amount");
                    dAmount = md_dAmount.doubleValue();
                }
            }

            //:      
            //:END
        }

        //:END

        //:// Process resulting Charge or Refund.
        //:IF szRefundFlag = ""
        if (ZeidonStringCompare(szRefundFlag, 1, 0, "", 1, 0, 2) == 0) {
            //:// Regular Charge, not Refund. Generate entry if there is a positive amount.
            //:IF dAmount > 0
            if (dAmount > 0) {
                //:// Generate the charge if it isn't already there.
                //:GenerateChargeEntry( mSAChrgT, mSAProf, dAmount, "" )
                omSAChrgT_GenerateChargeEntry(mSAChrgT, mSAProf, dAmount, "");
            }

            //:END
            //:ELSE
        } else {
            //:// Refund.
            //:// We'll process a Refund if the Amount has changed.
            //:IF dAmount != mSAProf.PeriodTransApplied.Amount 
            if (CompareAttributeToDecimal(mSAProf, "PeriodTransApplied", "Amount", dAmount) != 0) {
                //:GenerateRefundEntry( mSAChrgT, mSAProf )
                omSAChrgT_GenerateRefundEntry(mSAChrgT, mSAProf);
            }

            //:END
        }

        //:END

        //:RETURN 0
        if (8 == 8)
            return (0);
    }

    //:END

    //:// DL TUITION CHARGE

    //:// Tuition charge is driven by Class Section and Enrolled Credits.

    //:IF szInternalRuleName = "DL Tuition"
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "DL Tuition", 1, 0, 51) == 0) {

        //:szFoundRuleFlag = "Y"
        {
            StringBuilder sb_szFoundRuleFlag;
            if (szFoundRuleFlag == null)
                sb_szFoundRuleFlag = new StringBuilder(32);
            else
                sb_szFoundRuleFlag = new StringBuilder(szFoundRuleFlag);
            ZeidonStringCopy(sb_szFoundRuleFlag, 1, 0, "Y", 1, 0, 2);
            szFoundRuleFlag = sb_szFoundRuleFlag.toString();
        }
        //:Rule_DL_Tuition( mSAChrgT, mSAProf, szRefundFlag )
        omSAChrgT_Rule_DL_Tuition(mSAChrgT, mSAProf, szRefundFlag);

        //:RETURN 0 
        if (8 == 8)
            return (0);
    }

    //:END

    //:// SUMMER TUITION CHARGE

    //:// Tuition charge is driven by Class Section and Enrolled Credits.

    //:IF szInternalRuleName = "Summer Tuition"
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "Summer Tuition", 1, 0, 51) == 0) {

        //:szFoundRuleFlag = "Y"
        {
            StringBuilder sb_szFoundRuleFlag;
            if (szFoundRuleFlag == null)
                sb_szFoundRuleFlag = new StringBuilder(32);
            else
                sb_szFoundRuleFlag = new StringBuilder(szFoundRuleFlag);
            ZeidonStringCopy(sb_szFoundRuleFlag, 1, 0, "Y", 1, 0, 2);
            szFoundRuleFlag = sb_szFoundRuleFlag.toString();
        }
        //:Rule_SummerTuition( mSAChrgT, mSAProf, szRefundFlag )
        omSAChrgT_Rule_SummerTuition(mSAChrgT, mSAProf, szRefundFlag);

        //:RETURN 0 
        if (8 == 8)
            return (0);
    }

    //:END

    //:// INDEPENDENT STUDY 

    //:// For each Independent Study Class, the student is charged a fee per hour.

    //:IF szInternalRuleName = "Independent Study"
    if (ZeidonStringCompare(szInternalRuleName, 1, 0, "Independent Study", 1, 0, 51) == 0) {

        //:// Process per Independent Study Class
        //:FOR EACH mSAProf.TermEnrolled
        RESULT = SetCursorFirstEntity(mSAProf, "TermEnrolled", "");
        while (RESULT > zCURSOR_UNCHANGED) {

            //:dAmount = 0
            dAmount = 0;
            //:IF mSAProf.TermClass.IndependentStudyFlag = "Y"
            if (CompareAttributeToString(mSAProf, "TermClass", "IndependentStudyFlag", "Y") == 0) {
                //:SET CURSOR FIRST mSAChrgT.SAInternalRuleVariable 
                //:           WHERE mSAChrgT.SAInternalRuleVariable.Name = "Charge/Credit"
                RESULT = SetCursorFirstEntityByString(mSAChrgT, "SAInternalRuleVariable", "Name",
                        "Charge/Credit", "");
                //:IF RESULT < zCURSOR_SET
                if (RESULT < zCURSOR_SET) {
                    //:szMsg = "Missing variable name, 'Charge/Credit', for Internal Rule," + szInternalRuleName + "'."
                    {
                        StringBuilder sb_szMsg;
                        if (szMsg == null)
                            sb_szMsg = new StringBuilder(32);
                        else
                            sb_szMsg = new StringBuilder(szMsg);
                        ZeidonStringCopy(sb_szMsg, 1, 0,
                                "Missing variable name, 'Charge/Credit', for Internal Rule,", 1, 0, 301);
                        szMsg = sb_szMsg.toString();
                    }
                    {
                        StringBuilder sb_szMsg;
                        if (szMsg == null)
                            sb_szMsg = new StringBuilder(32);
                        else
                            sb_szMsg = new StringBuilder(szMsg);
                        ZeidonStringConcat(sb_szMsg, 1, 0, szInternalRuleName, 1, 0, 301);
                        szMsg = sb_szMsg.toString();
                    }
                    {
                        StringBuilder sb_szMsg;
                        if (szMsg == null)
                            sb_szMsg = new StringBuilder(32);
                        else
                            sb_szMsg = new StringBuilder(szMsg);
                        ZeidonStringConcat(sb_szMsg, 1, 0, "'.", 1, 0, 301);
                        szMsg = sb_szMsg.toString();
                    }
                    //:MessageSend( mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, 0 )
                    MessageSend(mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, 0);
                    //:RETURN -1
                    if (8 == 8)
                        return (-1);
                }

                //:END

                //:// Fee is Credits * Charge/Credit, for enrolled or completed classes.
                //:IF (mSAProf.TermEnrolled.Status ="T" OR mSAProf.TermEnrolled.Status ="C")
                if (CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "T") == 0
                        || CompareAttributeToString(mSAProf, "TermEnrolled", "Status", "C") == 0) {
                    //:dTotalCredits = mSAProf.TermEnrolled.CreditHours
                    {
                        MutableDouble md_dTotalCredits = new MutableDouble(dTotalCredits);
                        GetDecimalFromAttribute(md_dTotalCredits, mSAProf, "TermEnrolled", "CreditHours");
                        dTotalCredits = md_dTotalCredits.doubleValue();
                    }
                    //:dChargePerCreditHour = mSAChrgT.SAInternalRuleVariable.Value 
                    {
                        MutableDouble md_dChargePerCreditHour = new MutableDouble(dChargePerCreditHour);
                        GetDecimalFromAttribute(md_dChargePerCreditHour, mSAChrgT, "SAInternalRuleVariable",
                                "Value");
                        dChargePerCreditHour = md_dChargePerCreditHour.doubleValue();
                    }
                    //:dAmount = dTotalCredits * dChargePerCreditHour
                    dAmount = dTotalCredits * dChargePerCreditHour;
                }

                //:END

                //:// Process Amount at Charge or Refund.
                //:IF szRefundFlag = ""
                if (ZeidonStringCompare(szRefundFlag, 1, 0, "", 1, 0, 2) == 0) {
                    //:IF dAmount > 0
                    if (dAmount > 0) {
                        //:// Use Description in GenerateChargeEntry because we want the compare for duplicate by Description.
                        //:szDisplayCredits = dTotalCredits
                        {
                            StringBuilder sb_szDisplayCredits;
                            if (szDisplayCredits == null)
                                sb_szDisplayCredits = new StringBuilder(32);
                            else
                                sb_szDisplayCredits = new StringBuilder(szDisplayCredits);
                            ZeidonStringConvertFromNumber(sb_szDisplayCredits, 1, 0, 20, 0, dTotalCredits, "D");
                            szDisplayCredits = sb_szDisplayCredits.toString();
                        }
                        //:szDesc = "Indep Study Fee (" + mSAProf.TermCourse.Number + ") - " + szDisplayCredits + " CR"
                        {
                            MutableInt mi_lTempInteger_14 = new MutableInt(lTempInteger_14);
                            StringBuilder sb_szTempString_2;
                            if (szTempString_2 == null)
                                sb_szTempString_2 = new StringBuilder(32);
                            else
                                sb_szTempString_2 = new StringBuilder(szTempString_2);
                            GetVariableFromAttribute(sb_szTempString_2, mi_lTempInteger_14, 'S', 11, mSAProf,
                                    "TermCourse", "Number", "", 0);
                            lTempInteger_14 = mi_lTempInteger_14.intValue();
                            szTempString_2 = sb_szTempString_2.toString();
                        }
                        {
                            StringBuilder sb_szDesc;
                            if (szDesc == null)
                                sb_szDesc = new StringBuilder(32);
                            else
                                sb_szDesc = new StringBuilder(szDesc);
                            ZeidonStringCopy(sb_szDesc, 1, 0, "Indep Study Fee (", 1, 0, 101);
                            szDesc = sb_szDesc.toString();
                        }
                        {
                            StringBuilder sb_szDesc;
                            if (szDesc == null)
                                sb_szDesc = new StringBuilder(32);
                            else
                                sb_szDesc = new StringBuilder(szDesc);
                            ZeidonStringConcat(sb_szDesc, 1, 0, szTempString_2, 1, 0, 101);
                            szDesc = sb_szDesc.toString();
                        }
                        {
                            StringBuilder sb_szDesc;
                            if (szDesc == null)
                                sb_szDesc = new StringBuilder(32);
                            else
                                sb_szDesc = new StringBuilder(szDesc);
                            ZeidonStringConcat(sb_szDesc, 1, 0, ") - ", 1, 0, 101);
                            szDesc = sb_szDesc.toString();
                        }
                        {
                            StringBuilder sb_szDesc;
                            if (szDesc == null)
                                sb_szDesc = new StringBuilder(32);
                            else
                                sb_szDesc = new StringBuilder(szDesc);
                            ZeidonStringConcat(sb_szDesc, 1, 0, szDisplayCredits, 1, 0, 101);
                            szDesc = sb_szDesc.toString();
                        }
                        {
                            StringBuilder sb_szDesc;
                            if (szDesc == null)
                                sb_szDesc = new StringBuilder(32);
                            else
                                sb_szDesc = new StringBuilder(szDesc);
                            ZeidonStringConcat(sb_szDesc, 1, 0, " CR", 1, 0, 101);
                            szDesc = sb_szDesc.toString();
                        }
                        //:// Generate the charge if it doesn't already exist, which is determined inside operation GenerateChargeEntry.
                        //:nRC = GenerateChargeEntry( mSAChrgT, mSAProf, dAmount, szDesc )
                        nRC = omSAChrgT_GenerateChargeEntry(mSAChrgT, mSAProf, dAmount, szDesc);
                        //:IF nRC >= 0
                        if (nRC >= 0) {
                            //:// Modify Description.
                            //:mSAProf.StudentAccountTransApplied.Description = szDesc
                            SetAttributeFromString(mSAProf, "StudentAccountTransApplied", "Description",
                                    szDesc);
                        }

                        //:END
                    }

                    //:END
                    //:ELSE
                } else {
                    //:// Refund.
                    //:IF dAmount != mSAProf.PeriodTransApplied.Amount
                    if (CompareAttributeToDecimal(mSAProf, "PeriodTransApplied", "Amount", dAmount) != 0) {
                        //:// Go to create refund or give User and error message, if any classes were dropped after Add/Drop deadline.
                        //:CreateRefundByDropDate( mSAChrgT, mSAProf )
                        omSAChrgT_CreateRefundByDropDate(mSAChrgT, mSAProf);
                    }

                    //:END
                }

                //:END
            }

            RESULT = SetCursorNextEntity(mSAProf, "TermEnrolled", "");
            //:END
        }

        //:END

        //:RETURN 0 
        if (8 == 8)
            return (0);
    }

    //:END

    //:// Give error if the Rule was not found.
    //:IF szFoundRuleFlag = ""
    if (ZeidonStringCompare(szFoundRuleFlag, 1, 0, "", 1, 0, 2) == 0) {
        //:szMsg = "The Internal Rule Name, '" + szInternalRuleName + "', was not found for Transaction Code, " +
        //:        mSAChrgT.SATransactionCode.TransactionCode + "."
        {
            StringBuilder sb_szMsg;
            if (szMsg == null)
                sb_szMsg = new StringBuilder(32);
            else
                sb_szMsg = new StringBuilder(szMsg);
            ZeidonStringCopy(sb_szMsg, 1, 0, "The Internal Rule Name, '", 1, 0, 301);
            szMsg = sb_szMsg.toString();
        }
        {
            StringBuilder sb_szMsg;
            if (szMsg == null)
                sb_szMsg = new StringBuilder(32);
            else
                sb_szMsg = new StringBuilder(szMsg);
            ZeidonStringConcat(sb_szMsg, 1, 0, szInternalRuleName, 1, 0, 301);
            szMsg = sb_szMsg.toString();
        }
        {
            StringBuilder sb_szMsg;
            if (szMsg == null)
                sb_szMsg = new StringBuilder(32);
            else
                sb_szMsg = new StringBuilder(szMsg);
            ZeidonStringConcat(sb_szMsg, 1, 0, "', was not found for Transaction Code, ", 1, 0, 301);
            szMsg = sb_szMsg.toString();
        }
        {
            MutableInt mi_lTempInteger_15 = new MutableInt(lTempInteger_15);
            StringBuilder sb_szTempString_3;
            if (szTempString_3 == null)
                sb_szTempString_3 = new StringBuilder(32);
            else
                sb_szTempString_3 = new StringBuilder(szTempString_3);
            GetVariableFromAttribute(sb_szTempString_3, mi_lTempInteger_15, 'S', 21, mSAChrgT,
                    "SATransactionCode", "TransactionCode", "", 0);
            lTempInteger_15 = mi_lTempInteger_15.intValue();
            szTempString_3 = sb_szTempString_3.toString();
        }
        {
            StringBuilder sb_szMsg;
            if (szMsg == null)
                sb_szMsg = new StringBuilder(32);
            else
                sb_szMsg = new StringBuilder(szMsg);
            ZeidonStringConcat(sb_szMsg, 1, 0, szTempString_3, 1, 0, 301);
            szMsg = sb_szMsg.toString();
        }
        {
            StringBuilder sb_szMsg;
            if (szMsg == null)
                sb_szMsg = new StringBuilder(32);
            else
                sb_szMsg = new StringBuilder(szMsg);
            ZeidonStringConcat(sb_szMsg, 1, 0, ".", 1, 0, 301);
            szMsg = sb_szMsg.toString();
        }
        //:MessageSend( mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_WARNING, 0 )
        MessageSend(mSAChrgT, "", "Process Rule", szMsg, zMSGQ_OBJECT_CONSTRAINT_WARNING, 0);
        //:RETURN -1
        if (8 == 8)
            return (-1);
    }

    //:END

    //:RETURN 1
    return (1);
    // END
}

From source file:com.quinsoft.zencas.mStudenC_Object.java

public int omStudenC_dMidtermGradeGPA(View mStudenC, String InternalEntityStructure,
        String InternalAttribStructure, Integer GetOrSetFlag) {
    zVIEW wXferO = new zVIEW();
    int RESULT = 0;
    //:STRING ( 10 ) szMidtermGradePoints
    String szMidtermGradePoints = null;
    //:STRING ( 10 ) szMidtermGrade
    String szMidtermGrade = null;
    //:STRING ( 10 ) szMidtermGradeGPA
    String szMidtermGradeGPA = null;
    //:DECIMAL TotalDivisor
    double TotalDivisor = 0.0;
    //:DECIMAL ClassCredits
    double ClassCredits = 0.0;
    //:DECIMAL TotalPoints
    double TotalPoints = 0.0;
    //:DECIMAL MidtermGradePoints
    double MidtermGradePoints = 0.0;
    //:DECIMAL MidtermGPA
    double MidtermGPA = 0.0;
    //:INTEGER CollegeTermID
    int CollegeTermID = 0;
    int lTempInteger_0 = 0;
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;
    int lTempInteger_3 = 0;

    RESULT = GetViewByName(wXferO, "wXferO", mStudenC, zLEVEL_TASK);

    //:CASE GetOrSetFlag
    switch (GetOrSetFlag) {
    //:OF   zDERIVED_GET:
    case zDERIVED_GET:

    //:// Compute Midterm GPA for the College Term CurrentScheduleEntry.
    //:szMidtermGradeGPA = ""
    {//w ww  .  j a va2  s . c o  m
        StringBuilder sb_szMidtermGradeGPA;
        if (szMidtermGradeGPA == null)
            sb_szMidtermGradeGPA = new StringBuilder(32);
        else
            sb_szMidtermGradeGPA = new StringBuilder(szMidtermGradeGPA);
        ZeidonStringCopy(sb_szMidtermGradeGPA, 1, 0, "", 1, 0, 11);
        szMidtermGradeGPA = sb_szMidtermGradeGPA.toString();
    }
        //:IF mStudenC.CurrentClass EXISTS
        lTempInteger_0 = CheckExistenceOfEntity(mStudenC, "CurrentClass");
        if (lTempInteger_0 == 0) {
            //:IF mStudenC.CurrentClass.wStatus = ""
            if (CompareAttributeToString(mStudenC, "CurrentClass", "wStatus", "") == 0) {
                //:// This is entry for formatting total credits and thus Midterm GPA.
                //:CollegeTermID = mStudenC.CurrentScheduleEntry.wCollegeTermID 
                {
                    MutableInt mi_CollegeTermID = new MutableInt(CollegeTermID);
                    GetIntegerFromAttribute(mi_CollegeTermID, mStudenC, "CurrentScheduleEntry",
                            "wCollegeTermID");
                    CollegeTermID = mi_CollegeTermID.intValue();
                }
                //:FOR EACH mStudenC.RegistrationClassCollegeTerm WITHIN mStudenC.Student 
                //:WHERE mStudenC.RegistrationClassCollegeTerm.ID = CollegeTermID
                RESULT = SetCursorFirstEntityByInteger(mStudenC, "RegistrationClassCollegeTerm", "ID",
                        CollegeTermID, "Student");
                while (RESULT > zCURSOR_UNCHANGED) {

                    //:szMidtermGrade = mStudenC.Registration.MidtermGrade 
                    {
                        MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1);
                        StringBuilder sb_szMidtermGrade;
                        if (szMidtermGrade == null)
                            sb_szMidtermGrade = new StringBuilder(32);
                        else
                            sb_szMidtermGrade = new StringBuilder(szMidtermGrade);
                        GetVariableFromAttribute(sb_szMidtermGrade, mi_lTempInteger_1, 'S', 11, mStudenC,
                                "Registration", "MidtermGrade", "", 0);
                        lTempInteger_1 = mi_lTempInteger_1.intValue();
                        szMidtermGrade = sb_szMidtermGrade.toString();
                    }
                    //:GetStringFromAttributeByContext( szMidtermGradePoints,
                    //:                              mStudenC, "Registration", "MidtermGrade", "DegreeTrackGradePointValue", 20 )
                    {
                        StringBuilder sb_szMidtermGradePoints;
                        if (szMidtermGradePoints == null)
                            sb_szMidtermGradePoints = new StringBuilder(32);
                        else
                            sb_szMidtermGradePoints = new StringBuilder(szMidtermGradePoints);
                        GetStringFromAttributeByContext(sb_szMidtermGradePoints, mStudenC, "Registration",
                                "MidtermGrade", "DegreeTrackGradePointValue", 20);
                        szMidtermGradePoints = sb_szMidtermGradePoints.toString();
                    }
                    //:MidtermGradePoints = StrToDecimal( szMidtermGradePoints )
                    {
                        ZGLOBAL1_Operation m_ZGLOBAL1_Operation = new ZGLOBAL1_Operation(mStudenC);
                        MidtermGradePoints = m_ZGLOBAL1_Operation.StrToDecimal(szMidtermGradePoints);
                        // m_ZGLOBAL1_Operation = null;  // permit gc  (unnecessary)
                    }
                    //:// We'll consider the entry if the Midterm Grade was an F or it was a grade that was worth points. F is the
                    //:// only zero points grade we will consider.
                    //:IF szMidtermGrade = "F" OR MidtermGradePoints > 0
                    if (ZeidonStringCompare(szMidtermGrade, 1, 0, "F", 1, 0, 11) == 0
                            || MidtermGradePoints > 0) {
                        //:ClassCredits = mStudenC.Registration.CreditHours
                        {
                            MutableDouble md_ClassCredits = new MutableDouble(ClassCredits);
                            GetDecimalFromAttribute(md_ClassCredits, mStudenC, "Registration", "CreditHours");
                            ClassCredits = md_ClassCredits.doubleValue();
                        }
                        //:TotalDivisor = TotalDivisor + ClassCredits
                        TotalDivisor = TotalDivisor + ClassCredits;
                        //:TotalPoints  = TotalPoints  + (MidtermGradePoints * ClassCredits)
                        TotalPoints = TotalPoints + (MidtermGradePoints * ClassCredits);
                    }

                    RESULT = SetCursorNextEntityByInteger(mStudenC, "RegistrationClassCollegeTerm", "ID",
                            CollegeTermID, "Student");
                    //:END
                }

                //:END
                //:MidtermGPA = TotalPoints / TotalDivisor
                MidtermGPA = TotalPoints / TotalDivisor;
                //:mStudenC.CurrentScheduleEntry.wMidtermGPA = MidtermGPA
                SetAttributeFromDecimal(mStudenC, "CurrentScheduleEntry", "wMidtermGPA", MidtermGPA);
                //:szMidtermGradeGPA = mStudenC.CurrentScheduleEntry.wMidtermGPA 
                {
                    MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2);
                    StringBuilder sb_szMidtermGradeGPA;
                    if (szMidtermGradeGPA == null)
                        sb_szMidtermGradeGPA = new StringBuilder(32);
                    else
                        sb_szMidtermGradeGPA = new StringBuilder(szMidtermGradeGPA);
                    GetVariableFromAttribute(sb_szMidtermGradeGPA, mi_lTempInteger_2, 'S', 11, mStudenC,
                            "CurrentScheduleEntry", "wMidtermGPA", "", 0);
                    lTempInteger_2 = mi_lTempInteger_2.intValue();
                    szMidtermGradeGPA = sb_szMidtermGradeGPA.toString();
                }

                //:StoreValueInRecord ( mStudenC,
                //:                  InternalEntityStructure, InternalAttribStructure, szMidtermGradeGPA, 0 )
                StoreValueInRecord(mStudenC, InternalEntityStructure, InternalAttribStructure,
                        szMidtermGradeGPA, 0);
                //:ELSE
            } else {
                //:IF mStudenC.CurrentClass.wMidtermGrade != ""
                if (CompareAttributeToString(mStudenC, "CurrentClass", "wMidtermGrade", "") != 0) {
                    //:// This is Registration entry and needs Midterm Grade formatted.
                    //:szMidtermGradeGPA = mStudenC.CurrentClass.wMidtermGrade 
                    {
                        MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3);
                        StringBuilder sb_szMidtermGradeGPA;
                        if (szMidtermGradeGPA == null)
                            sb_szMidtermGradeGPA = new StringBuilder(32);
                        else
                            sb_szMidtermGradeGPA = new StringBuilder(szMidtermGradeGPA);
                        GetVariableFromAttribute(sb_szMidtermGradeGPA, mi_lTempInteger_3, 'S', 11, mStudenC,
                                "CurrentClass", "wMidtermGrade", "", 0);
                        lTempInteger_3 = mi_lTempInteger_3.intValue();
                        szMidtermGradeGPA = sb_szMidtermGradeGPA.toString();
                    }
                }

                //:END
            }

            //:END
        }

        //:END

        //:StoreStringInRecord ( mStudenC,
        //:                   InternalEntityStructure, InternalAttribStructure, szMidtermGradeGPA )
        StoreStringInRecord(mStudenC, InternalEntityStructure, InternalAttribStructure, szMidtermGradeGPA);
        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_ApplyRowRule(View mSARuleS) {
    zVIEW vAnyView = new zVIEW();
    //:STRING (  1024  ) szStringToCompare
    String szStringToCompare = null;
    //:DECIMAL dValueToCompare
    double dValueToCompare = 0.0;
    //:STRING (  64  ) szView
    String szView = null;//from w ww.j  a  v a  2 s.c o 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;
    //:INTEGER nCompareResult
    int nCompareResult = 0;
    //:INTEGER nCompareResult2
    int nCompareResult2 = 0;
    //:INTEGER nRC 
    int nRC = 0;
    int lTempInteger_0 = 0;
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;
    int lTempInteger_3 = 0;
    int lTempInteger_4 = 0;
    int RESULT = 0;

    //:// get the values we are looking for 
    //:szEntity    = mSARuleS.SACalcLookupRow.QualEntityName 
    {
        MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0);
        StringBuilder sb_szEntity;
        if (szEntity == null)
            sb_szEntity = new StringBuilder(32);
        else
            sb_szEntity = new StringBuilder(szEntity);
        GetVariableFromAttribute(sb_szEntity, mi_lTempInteger_0, 'S', 65, mSARuleS, "SACalcLookupRow",
                "QualEntityName", "", 0);
        lTempInteger_0 = mi_lTempInteger_0.intValue();
        szEntity = sb_szEntity.toString();
    }
    //:szAttribute = mSARuleS.SACalcLookupRow.QualAttributeName 
    {
        MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1);
        StringBuilder sb_szAttribute;
        if (szAttribute == null)
            sb_szAttribute = new StringBuilder(32);
        else
            sb_szAttribute = new StringBuilder(szAttribute);
        GetVariableFromAttribute(sb_szAttribute, mi_lTempInteger_1, 'S', 65, mSARuleS, "SACalcLookupRow",
                "QualAttributeName", "", 0);
        lTempInteger_1 = mi_lTempInteger_1.intValue();
        szAttribute = sb_szAttribute.toString();
    }
    //:szAttrType  = mSARuleS.SACalcLookupRow.QualAttributeType 
    {
        MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2);
        StringBuilder sb_szAttrType;
        if (szAttrType == null)
            sb_szAttrType = new StringBuilder(32);
        else
            sb_szAttrType = new StringBuilder(szAttrType);
        GetVariableFromAttribute(sb_szAttrType, mi_lTempInteger_2, 'S', 2, mSARuleS, "SACalcLookupRow",
                "QualAttributeType", "", 0);
        lTempInteger_2 = mi_lTempInteger_2.intValue();
        szAttrType = sb_szAttrType.toString();
    }
    //:szOper      = mSARuleS.SACalcLookupRow.QualOperator 
    {
        MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3);
        StringBuilder sb_szOper;
        if (szOper == null)
            sb_szOper = new StringBuilder(32);
        else
            sb_szOper = new StringBuilder(szOper);
        GetVariableFromAttribute(sb_szOper, mi_lTempInteger_3, 'S', 11, mSARuleS, "SACalcLookupRow",
                "QualOperator", "", 0);
        lTempInteger_3 = mi_lTempInteger_3.intValue();
        szOper = sb_szOper.toString();
    }
    //:szView      = mSARuleS.SACalcLookupRow.QualViewName 
    {
        MutableInt mi_lTempInteger_4 = new MutableInt(lTempInteger_4);
        StringBuilder sb_szView;
        if (szView == null)
            sb_szView = new StringBuilder(32);
        else
            sb_szView = new StringBuilder(szView);
        GetVariableFromAttribute(sb_szView, mi_lTempInteger_4, 'S', 65, mSARuleS, "SACalcLookupRow",
                "QualViewName", "", 0);
        lTempInteger_4 = mi_lTempInteger_4.intValue();
        szView = sb_szView.toString();
    }

    //:GET VIEW vAnyView NAMED szView
    RESULT = GetViewByName(vAnyView, szView, mSARuleS, zLEVEL_TASK);

    //:// 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, "SACalcLookupRow", "QualStringValue", szStringToCompare )
        nCompareResult = CompareAttributeToString(mSARuleS, "SACalcLookupRow", "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, "SACalcLookupRow", "MinAttributeForAward", dValueToCompare )
        nCompareResult = CompareAttributeToDecimal(mSARuleS, "SACalcLookupRow", "MinAttributeForAward",
                dValueToCompare);
        //:nCompareResult2 = 
        //:   CompareAttributeToDecimal( mSARuleS, "SACalcLookupRow", "MaxAttributeForAward", dValueToCompare )
        nCompareResult2 = CompareAttributeToDecimal(mSARuleS, "SACalcLookupRow", "MaxAttributeForAward",
                dValueToCompare);
    }

    //:END 

    //:// -1   attribute value is less than string value 
    //://  0   attribute value is equal to string value
    //://  1   attribute value is greater than string value 
    //:nRC = CompareResults( szOper, nCompareResult, nCompareResult2 )
    nRC = omSARuleS_CompareResults(szOper, nCompareResult, nCompareResult2);
    //:IF nRC = 1 
    if (nRC == 1) {
        //:mSARuleS.SACalcLookupRow.wQualTrue = "Y"
        SetAttributeFromString(mSARuleS, "SACalcLookupRow", "wQualTrue", "Y");
        //:RETURN 1
        if (8 == 8)
            return (1);
    }

    //:END 
    //:IF nRC = -1   
    if (nRC == -1) {
        //:mSARuleS.SACalcLookupRow.wQualTrue = "N"
        SetAttributeFromString(mSARuleS, "SACalcLookupRow", "wQualTrue", "N");
        //:RETURN -1
        if (8 == 8)
            return (-1);
    }

    //:END
    return (0);
    // END
}

From source file:com.quinsoft.zencas.mEmploy_Object.java

public int omEmploy_dFICA_MedicareBenefit(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 www  .j a  va  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();
                }
                //:IF SalaryAmount > mStdSalLST.StandardSalaryData.FICA_MEDICARE_MaxAmount 
                if (CompareAttributeToDecimal(mStdSalLST, "StandardSalaryData", "FICA_MEDICARE_MaxAmount",
                        SalaryAmount) < 0) {
                    //:SalaryAmount = mStdSalLST.StandardSalaryData.FICA_MEDICARE_MaxAmount
                    {
                        MutableDouble md_SalaryAmount = new MutableDouble(SalaryAmount);
                        GetDecimalFromAttribute(md_SalaryAmount, mStdSalLST, "StandardSalaryData",
                                "FICA_MEDICARE_MaxAmount");
                        SalaryAmount = md_SalaryAmount.doubleValue();
                    }
                }

                //:END
                //:BenefitAmount = SalaryAmount * mStdSalLST.StandardSalaryData.FICA_MEDICARE_Rate 
                {
                    MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                    GetDecimalFromAttribute(md_dTempDecimal_0, mStdSalLST, "StandardSalaryData",
                            "FICA_MEDICARE_Rate");
                    dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                }
                BenefitAmount = SalaryAmount * dTempDecimal_0;
                //: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
}

From source file:com.quinsoft.zencas.mFAProf_Object.java

public int omFAProf_ObjectConstraints(View mFAProfOrig, Integer Event, Integer State) {
    zVIEW mFAProf = new zVIEW();
    //:VIEW mFAProf2  BASED ON LOD mFAProf
    zVIEW mFAProf2 = new zVIEW();
    //:VIEW mAdmDiv   REGISTERED AS mAdmDiv
    zVIEW mAdmDiv = new zVIEW();
    int RESULT = 0;
    //:VIEW wXferO    REGISTERED AS wXferO
    zVIEW wXferO = new zVIEW();
    //:VIEW mFAISIRD  BASED ON LOD  mFAISIRD
    zVIEW mFAISIRD = new zVIEW();
    //:VIEW lFAAdmin  BASED ON LOD  mFAAdmin
    zVIEW lFAAdmin = new zVIEW();
    //:VIEW lFAAdminT BASED ON LOD  mFAAdmin
    zVIEW lFAAdminT = new zVIEW();
    //:STRING (  32  ) szDate
    String szDate = null;/* w  w w .j a v a 2 s. co m*/
    //:SHORT   nRC 
    int nRC = 0;
    //:STRING ( 500 )   szSourceString
    String szSourceString = null;
    //:STRING ( 120 )   szCode
    String szCode = null;
    //:STRING ( 32 )    szCommentsDomain
    String szCommentsDomain = null;
    //:STRING ( 10000 ) szCommentsString
    String szCommentsString = null;
    //:STRING ( 2 )     szSemester
    String szSemester = null;
    //:STRING ( 50 )    szName
    String szName = null;
    //:STRING ( 1 )     szTermError
    String szTermError = null;
    //:STRING ( 10 )    szRevisionType
    String szRevisionType = null;
    //:INTEGER nIndex
    int nIndex = 0;
    //:INTEGER nLen 
    int nLen = 0;
    //:INTEGER nCollegeYearID
    int nCollegeYearID = 0;
    //:INTEGER nCollegeTermID
    int nCollegeTermID = 0;
    //:INTEGER nProfileCollegeYearID
    int nProfileCollegeYearID = 0;
    //:DECIMAL dPeriod1Credits
    double dPeriod1Credits = 0.0;
    //:DECIMAL dPeriod2Credits
    double dPeriod2Credits = 0.0;
    //:DECIMAL dMinFallCredits
    double dMinFallCredits = 0.0;
    //:DECIMAL dMinSpringCredits
    double dMinSpringCredits = 0.0;
    int lTempInteger_0 = 0;
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;
    int lTempInteger_3 = 0;
    String szTempString_0 = null;
    int lTempInteger_4 = 0;
    int lTempInteger_5 = 0;
    int lTempInteger_6 = 0;
    int lTempInteger_7 = 0;
    int lTempInteger_8 = 0;
    int lTempInteger_9 = 0;
    int lTempInteger_10 = 0;
    int lTempInteger_11 = 0;
    int lTempInteger_12 = 0;
    int lTempInteger_13 = 0;
    int lTempInteger_14 = 0;
    int lTempInteger_15 = 0;
    int lTempInteger_16 = 0;
    int lTempInteger_17 = 0;
    int lTempInteger_18 = 0;
    int lTempInteger_19 = 0;
    int lTempInteger_20 = 0;
    String szTempString_1 = null;
    int lTempInteger_21 = 0;
    int lTempInteger_22 = 0;
    String szTempString_2 = null;
    String szTempString_3 = null;
    int lTempInteger_23 = 0;
    int lTempInteger_24 = 0;
    int lTempInteger_25 = 0;
    String szTempString_4 = null;
    String szTempString_5 = null;
    int lTempInteger_26 = 0;
    int lTempInteger_27 = 0;
    int lTempInteger_28 = 0;
    int lTempInteger_29 = 0;
    String szTempString_6 = null;
    int lTempInteger_30 = 0;
    int lTempInteger_31 = 0;
    int lTempInteger_32 = 0;

    RESULT = GetViewByName(mAdmDiv, "mAdmDiv", mFAProfOrig, zLEVEL_TASK);
    RESULT = GetViewByName(wXferO, "wXferO", mFAProfOrig, zLEVEL_TASK);

    //:CASE Event
    switch (Event) {
    //:OF zOCE_ACTIVATE:
    case zOCE_ACTIVATE:

        //:CreateViewFromView( mFAProf, mFAProfOrig )
        CreateViewFromView(mFAProf, mFAProfOrig);
        //:NAME VIEW mFAProf "FAProfConstraints"
        SetNameForView(mFAProf, "FAProfConstraints", null, zLEVEL_TASK);

        //:// Sort School entry FAISIRSchool in descending order for display of HousingCode.
        //:IF mFAProf.FAISIRSchool EXISTS
        lTempInteger_0 = CheckExistenceOfEntity(mFAProf, "FAISIRSchool");
        if (lTempInteger_0 == 0) {
            //:OrderEntityForView( mFAProf, "FAISIRSchool", "SchoolNumber D" )
            OrderEntityForView(mFAProf, "FAISIRSchool", "SchoolNumber D");
            //:SET CURSOR FIRST mFAProf.FAISIRSchool 
            RESULT = mFAProf.cursor("FAISIRSchool").setFirst().toInt();
        }

        //:END

        //:// Relink Disbursement entities.
        //:FOR EACH mFAProf.PerPeriodFinAidAwardDisbursement WITHIN mFAProf.FinAidProfile 
        RESULT = mFAProf.cursor("PerPeriodFinAidAwardDisbursement").setFirst("FinAidProfile").toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:SET CURSOR FIRST mFAProf.FinAidAwardDisbursement WITHIN mFAProf.FinAidProfile
            //:           WHERE mFAProf.FinAidAwardDisbursement.ID = mFAProf.PerPeriodFinAidAwardDisbursement.ID   
            {
                MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1);
                GetIntegerFromAttribute(mi_lTempInteger_1, mFAProf, "PerPeriodFinAidAwardDisbursement", "ID");
                lTempInteger_1 = mi_lTempInteger_1.intValue();
            }
            RESULT = mFAProf.cursor("FinAidAwardDisbursement").setFirst("ID", lTempInteger_1, "FinAidProfile")
                    .toInt();
            //:IF RESULT < zCURSOR_SET
            if (RESULT < zCURSOR_SET) {
                //:IssueError( mFAProf,0,0, "Programming Error on relink of FinAidAward" )
                IssueError(mFAProf, 0, 0, "Programming Error on relink of FinAidAward");
                //:ELSE
            } else {
                //:RelinkInstanceToInstance( mFAProf, "PerPeriodFinAidAwardDisbursement",
                //:                          mFAProf, "FinAidAwardDisbursement" )
                RelinkInstanceToInstance(mFAProf, "PerPeriodFinAidAwardDisbursement", mFAProf,
                        "FinAidAwardDisbursement");
                //:RelinkInstanceToInstance( mFAProf, "DisbFinAidAwardAssigned",
                //:                          mFAProf, "FinAidAward"  )
                RelinkInstanceToInstance(mFAProf, "DisbFinAidAwardAssigned", mFAProf, "FinAidAward");
            }

            RESULT = mFAProf.cursor("PerPeriodFinAidAwardDisbursement").setNextContinue().toInt();
            ;
            //:END
        }

        //:END
        //:FOR EACH mFAProf.FinAidAwardPeriod WITHIN mFAProf.FinAidProfile 
        RESULT = mFAProf.cursor("FinAidAwardPeriod").setFirst("FinAidProfile").toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:SET CURSOR FIRST mFAProf.PerProfileFinAidAwardPeriod 
            //:           WHERE mFAProf.PerProfileFinAidAwardPeriod.ID = mFAProf.FinAidAwardPeriod.ID  
            {
                MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2);
                GetIntegerFromAttribute(mi_lTempInteger_2, mFAProf, "FinAidAwardPeriod", "ID");
                lTempInteger_2 = mi_lTempInteger_2.intValue();
            }
            RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst("ID", lTempInteger_2).toInt();
            //:IF RESULT >= zCURSOR_SET
            if (RESULT >= zCURSOR_SET) {
                //:RelinkInstanceToInstance( mFAProf, "FinAidAwardPeriod",
                //:                          mFAProf, "PerProfileFinAidAwardPeriod" )
                RelinkInstanceToInstance(mFAProf, "FinAidAwardPeriod", mFAProf, "PerProfileFinAidAwardPeriod");
            }

            RESULT = mFAProf.cursor("FinAidAwardPeriod").setNextContinue().toInt();
            ;
            //:END
        }

        //:END

        //:// Order PerProfileFinAidAwardPeriod by Term (same as BeginDate).
        //:OrderEntityForView( mFAProf, "PerProfileFinAidAwardPeriod", "BeginDate A" )
        OrderEntityForView(mFAProf, "PerProfileFinAidAwardPeriod", "BeginDate A");

        //:// Eliminate any assigned COA Item entries if the COA item has been deleted.
        //:FOR EACH mFAProf.FinAidCOAItemAssigned 
        RESULT = mFAProf.cursor("FinAidCOAItemAssigned").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:IF mFAProf.FinAidCOAItem DOES NOT EXIST
            lTempInteger_3 = CheckExistenceOfEntity(mFAProf, "FinAidCOAItem");
            if (lTempInteger_3 != 0) {
                //:DELETE ENTITY mFAProf.FinAidCOAItemAssigned NONE
                RESULT = DeleteEntity(mFAProf, "FinAidCOAItemAssigned", zREPOS_NONE);
            }

            RESULT = mFAProf.cursor("FinAidCOAItemAssigned").setNextContinue().toInt();
            ;
            //:END
        }

        //:END 

        //:// The following sections of code are not executed if we are on the web for Students, which is identified by the existence of
        //:// the object, lFAAdmin.
        //:GET VIEW lFAAdmin NAMED "lFAAdmin" 
        RESULT = GetViewByName(lFAAdmin, "lFAAdmin", mFAProfOrig, zLEVEL_TASK);
        //:IF RESULT >= 0 
        if (RESULT >= 0) {

            //:// Set the Default Disbursement Date for each Period, if it is null.
            //:CreateViewFromView( lFAAdminT, lFAAdmin )
            CreateViewFromView(lFAAdminT, lFAAdmin);
            //:FOR EACH mFAProf.PerProfileFinAidAwardPeriod
            RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
            while (RESULT > zCURSOR_UNCHANGED) {
                //:IF mFAProf.PerProfileFinAidAwardPeriod.DefaultDisbursementDate = ""
                if (CompareAttributeToString(mFAProf, "PerProfileFinAidAwardPeriod", "DefaultDisbursementDate",
                        "") == 0) {
                    //:SET CURSOR FIRST lFAAdminT.FinAidAdmin WHERE lFAAdminT.CollegeYear.ID = mFAProf.CollegeYear.ID
                    RESULT = lFAAdminT.cursor("FinAidAdmin").setFirst().toInt();
                    if (RESULT > zCURSOR_UNCHANGED) {
                        while (RESULT > zCURSOR_UNCHANGED && (CompareAttributeToAttribute(lFAAdminT,
                                "CollegeYear", "ID", mFAProf, "CollegeYear", "ID") != 0)) {
                            RESULT = lFAAdminT.cursor("FinAidAdmin").setNextContinue().toInt();
                            ;
                        }

                    }

                    //:SET CURSOR FIRST lFAAdminT.FinAidAwardPeriod WHERE lFAAdminT.FinAidAwardPeriod.PeriodDesignator = mFAProf.PerProfileFinAidAwardPeriod.PeriodDesignator 
                    {
                        StringBuilder sb_szTempString_0;
                        if (szTempString_0 == null)
                            sb_szTempString_0 = new StringBuilder(32);
                        else
                            sb_szTempString_0 = new StringBuilder(szTempString_0);
                        GetStringFromAttribute(sb_szTempString_0, mFAProf, "PerProfileFinAidAwardPeriod",
                                "PeriodDesignator");
                        szTempString_0 = sb_szTempString_0.toString();
                    }
                    RESULT = lFAAdminT.cursor("FinAidAwardPeriod").setFirst("PeriodDesignator", szTempString_0)
                            .toInt();
                    //:mFAProf.PerProfileFinAidAwardPeriod.DefaultDisbursementDate = lFAAdminT.FinAidAwardPeriod.DefaultDisbursementDate 
                    SetAttributeFromAttribute(mFAProf, "PerProfileFinAidAwardPeriod", "DefaultDisbursementDate",
                            lFAAdminT, "FinAidAwardPeriod", "DefaultDisbursementDate");
                }

                RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setNextContinue().toInt();
                ;
                //:END
            }

            //:END

            //:// CHECK FOR VALID TERMS UNDER PERIODS
            //:// Make sure that CollegeT PeProfileFinAidAwardPeriod either exists or doesn't exist depending
            //:// on whether or not the Admin Div uses Cohorts.
            //:// If there's an error, prompt the User for possible correction.
            //:szTermError = ""
            {
                StringBuilder sb_szTermError;
                if (szTermError == null)
                    sb_szTermError = new StringBuilder(32);
                else
                    sb_szTermError = new StringBuilder(szTermError);
                ZeidonStringCopy(sb_szTermError, 1, 0, "", 1, 0, 2);
                szTermError = sb_szTermError.toString();
            }
            //:IF mFAProf.AdministrativeDivision.UsesCohortsFlag = "Y"
            if (CompareAttributeToString(mFAProf, "AdministrativeDivision", "UsesCohortsFlag", "Y") == 0) {
                //:FOR EACH mFAProf.PerProfileFinAidAwardPeriod 
                RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
                while (RESULT > zCURSOR_UNCHANGED) {
                    //:IF mFAProf.CollegeTerm EXISTS
                    lTempInteger_4 = CheckExistenceOfEntity(mFAProf, "CollegeTerm");
                    if (lTempInteger_4 == 0) {
                        //:szTermError = "Y"
                        {
                            StringBuilder sb_szTermError;
                            if (szTermError == null)
                                sb_szTermError = new StringBuilder(32);
                            else
                                sb_szTermError = new StringBuilder(szTermError);
                            ZeidonStringCopy(sb_szTermError, 1, 0, "Y", 1, 0, 2);
                            szTermError = sb_szTermError.toString();
                        }
                    }

                    RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setNextContinue().toInt();
                    ;
                    //:END
                }

                //:END
                //:IF szTermError = "Y"
                if (ZeidonStringCompare(szTermError, 1, 0, "Y", 1, 0, 2) == 0) {
                    //:nRC = MessagePrompt( mFAProf, "", "Loading FA Profile",
                    //:      "The current Financial Aid Profile is for a Cohort Admin Div, but the periods contain College Terms. Do you want them removed?",
                    //:      0, zBUTTONS_YESNO, zRESPONSE_NO, 0 )
                    nRC = MessagePrompt(mFAProf, "", "Loading FA Profile",
                            "The current Financial Aid Profile is for a Cohort Admin Div, but the periods contain College Terms. Do you want them removed?",
                            0, zBUTTONS_YESNO, zRESPONSE_NO, 0);
                    //:IF nRC = zRESPONSE_YES
                    if (nRC == zRESPONSE_YES) {
                        //:FOR EACH mFAProf.PerProfileFinAidAwardPeriod 
                        RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
                        while (RESULT > zCURSOR_UNCHANGED) {
                            //:IF mFAProf.CollegeTerm EXISTS 
                            lTempInteger_5 = CheckExistenceOfEntity(mFAProf, "CollegeTerm");
                            if (lTempInteger_5 == 0) {
                                //:EXCLUDE mFAProf.CollegeTerm 
                                RESULT = ExcludeEntity(mFAProf, "CollegeTerm", zREPOS_AFTER);
                            }

                            RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setNextContinue().toInt();
                            ;
                            //:END
                        }

                        //:END
                    }

                    //:END
                }

                //:END
                //:ELSE
            } else {
                //:FOR EACH mFAProf.PerProfileFinAidAwardPeriod 
                RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
                while (RESULT > zCURSOR_UNCHANGED) {
                    //:IF mFAProf.CollegeTerm DOES NOT EXIST
                    lTempInteger_6 = CheckExistenceOfEntity(mFAProf, "CollegeTerm");
                    if (lTempInteger_6 != 0) {
                        //:szTermError = "Y"
                        {
                            StringBuilder sb_szTermError;
                            if (szTermError == null)
                                sb_szTermError = new StringBuilder(32);
                            else
                                sb_szTermError = new StringBuilder(szTermError);
                            ZeidonStringCopy(sb_szTermError, 1, 0, "Y", 1, 0, 2);
                            szTermError = sb_szTermError.toString();
                        }
                    }

                    RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setNextContinue().toInt();
                    ;
                    //:END
                }

                //:END
                //:IF szTermError = "Y"
                if (ZeidonStringCompare(szTermError, 1, 0, "Y", 1, 0, 2) == 0) {
                    //:nRC = MessagePrompt( mFAProf, "", "Loading FA Profile",
                    //:      "The current Financial Aid Profile is for a traditional Admin Div, but the periods do not contain College Terms. Do you want them added?",
                    //:      0, zBUTTONS_YESNO, zRESPONSE_NO, 0 )
                    nRC = MessagePrompt(mFAProf, "", "Loading FA Profile",
                            "The current Financial Aid Profile is for a traditional Admin Div, but the periods do not contain College Terms. Do you want them added?",
                            0, zBUTTONS_YESNO, zRESPONSE_NO, 0);
                    //:IF nRC = zRESPONSE_YES
                    if (nRC == zRESPONSE_YES) {
                        //:SET CURSOR FIRST mFAProf.PerProfileFinAidAwardPeriod
                        RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
                        //:SET CURSOR FIRST lFAAdminT.FinAidAdmin WHERE lFAAdminT.CollegeYear.ID = mFAProf.CollegeYear.ID
                        RESULT = lFAAdminT.cursor("FinAidAdmin").setFirst().toInt();
                        if (RESULT > zCURSOR_UNCHANGED) {
                            while (RESULT > zCURSOR_UNCHANGED && (CompareAttributeToAttribute(lFAAdminT,
                                    "CollegeYear", "ID", mFAProf, "CollegeYear", "ID") != 0)) {
                                RESULT = lFAAdminT.cursor("FinAidAdmin").setNextContinue().toInt();
                                ;
                            }

                        }

                        //:// Check Period 1.
                        //:IF mFAProf.CollegeTerm DOES NOT EXIST
                        lTempInteger_7 = CheckExistenceOfEntity(mFAProf, "CollegeTerm");
                        if (lTempInteger_7 != 0) {
                            //:SET CURSOR FIRST lFAAdminT.FinAidAwardPeriod WHERE lFAAdminT.DisbCollegeTerm.Semester = "01"
                            RESULT = lFAAdminT.cursor("FinAidAwardPeriod").setFirst().toInt();
                            if (RESULT > zCURSOR_UNCHANGED) {
                                while (RESULT > zCURSOR_UNCHANGED && (CompareAttributeToString(lFAAdminT,
                                        "DisbCollegeTerm", "Semester", "01") != 0)) {
                                    RESULT = lFAAdminT.cursor("FinAidAwardPeriod").setNextContinue().toInt();
                                    ;
                                }

                            }

                            //:INCLUDE mFAProf.CollegeTerm FROM lFAAdminT.DisbCollegeTerm
                            RESULT = IncludeSubobjectFromSubobject(mFAProf, "CollegeTerm", lFAAdminT,
                                    "DisbCollegeTerm", zPOS_AFTER);
                            //:mFAProf.PerProfileFinAidAwardPeriod.BeginDate = lFAAdminT.FinAidAwardPeriod.BeginDate 
                            SetAttributeFromAttribute(mFAProf, "PerProfileFinAidAwardPeriod", "BeginDate",
                                    lFAAdminT, "FinAidAwardPeriod", "BeginDate");
                            //:mFAProf.PerProfileFinAidAwardPeriod.EndDate   = lFAAdminT.FinAidAwardPeriod.EndDate 
                            SetAttributeFromAttribute(mFAProf, "PerProfileFinAidAwardPeriod", "EndDate",
                                    lFAAdminT, "FinAidAwardPeriod", "EndDate");
                        }

                        //:END

                        //:// Check Period 2.
                        //:SET CURSOR NEXT mFAProf.PerProfileFinAidAwardPeriod
                        RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setNextContinue().toInt();
                        ;
                        //:IF mFAProf.CollegeTerm DOES NOT EXIST
                        lTempInteger_8 = CheckExistenceOfEntity(mFAProf, "CollegeTerm");
                        if (lTempInteger_8 != 0) {
                            //:SET CURSOR FIRST lFAAdminT.FinAidAwardPeriod  WHERE lFAAdminT.DisbCollegeTerm.Semester = "03"
                            RESULT = lFAAdminT.cursor("FinAidAwardPeriod").setFirst().toInt();
                            if (RESULT > zCURSOR_UNCHANGED) {
                                while (RESULT > zCURSOR_UNCHANGED && (CompareAttributeToString(lFAAdminT,
                                        "DisbCollegeTerm", "Semester", "03") != 0)) {
                                    RESULT = lFAAdminT.cursor("FinAidAwardPeriod").setNextContinue().toInt();
                                    ;
                                }

                            }

                            //:INCLUDE mFAProf.CollegeTerm FROM lFAAdminT.DisbCollegeTerm
                            RESULT = IncludeSubobjectFromSubobject(mFAProf, "CollegeTerm", lFAAdminT,
                                    "DisbCollegeTerm", zPOS_AFTER);
                            //:mFAProf.PerProfileFinAidAwardPeriod.BeginDate = lFAAdminT.FinAidAwardPeriod.BeginDate 
                            SetAttributeFromAttribute(mFAProf, "PerProfileFinAidAwardPeriod", "BeginDate",
                                    lFAAdminT, "FinAidAwardPeriod", "BeginDate");
                            //:mFAProf.PerProfileFinAidAwardPeriod.EndDate   = lFAAdminT.FinAidAwardPeriod.EndDate
                            SetAttributeFromAttribute(mFAProf, "PerProfileFinAidAwardPeriod", "EndDate",
                                    lFAAdminT, "FinAidAwardPeriod", "EndDate");
                        }

                        //:END
                    }

                    //:END
                }

                //:END
            }

            //:END
            //:SET CURSOR FIRST mFAProf.PerProfileFinAidAwardPeriod 
            RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
            //:DropView( lFAAdminT )
            DropView(lFAAdminT);

            //:// Build the list of Enrolled entries under the Period, which depends on whether the Admin div is traditional or adult studies model.
            //:// If this is the Adult Studies model (uses Cohorts), then the displayed enrollments are those designated at the interface.
            //:// If this is the traditional model, then the following rules apply:
            //:// ENC Rule Begin
            //:// 1. All Fall classes are added to first period and all Spring and Summer classes are added to second period.
            //:// 2. The January Term classes are added to Fall unless:
            //://    a. The Student took no classes in Fall.
            //://    b. The Student is full-time in Fall and part-time in Spring
            //:// ENC Rule End
            //:// Regular OpenCUAS rule is that the Class appears under its College Term.
            //:IF mFAProf.PerProfileFinAidAwardPeriod EXISTS
            lTempInteger_9 = CheckExistenceOfEntity(mFAProf, "PerProfileFinAidAwardPeriod");
            if (lTempInteger_9 == 0) {
                //:IF mFAProf.AdministrativeDivision.UsesCohortsFlag = "Y"
                if (CompareAttributeToString(mFAProf, "AdministrativeDivision", "UsesCohortsFlag", "Y") == 0) {
                    //:// ADULT STUDIES MODEL
                    //:FOR EACH mFAProf.PeriodEnrolled WITHIN mFAProf.FinAidProfile 
                    RESULT = mFAProf.cursor("PeriodEnrolled").setFirst("FinAidProfile").toInt();
                    while (RESULT > zCURSOR_UNCHANGED) {
                        //:INCLUDE mFAProf.DisplayEnrolled FROM mFAProf.PeriodEnrolled 
                        RESULT = IncludeSubobjectFromSubobject(mFAProf, "DisplayEnrolled", mFAProf,
                                "PeriodEnrolled", zPOS_AFTER);
                        RESULT = mFAProf.cursor("PeriodEnrolled").setNextContinue().toInt();
                        ;
                    }

                    //:END
                    //:ELSE
                } else {
                    //:// TRADITIONAL TERM MODEL
                    //:// ENC Rule Start.
                    //:// First add Fall classes to first period and Spring and Summer classes to 2nd period.
                    //:nProfileCollegeYearID = mFAProf.CollegeYear.ID
                    {
                        MutableInt mi_nProfileCollegeYearID = new MutableInt(nProfileCollegeYearID);
                        GetIntegerFromAttribute(mi_nProfileCollegeYearID, mFAProf, "CollegeYear", "ID");
                        nProfileCollegeYearID = mi_nProfileCollegeYearID.intValue();
                    }
                    //:FOR EACH mFAProf.Enrolled
                    RESULT = mFAProf.cursor("Enrolled").setFirst().toInt();
                    while (RESULT > zCURSOR_UNCHANGED) {
                        //:nCollegeYearID = 0
                        nCollegeYearID = 0;
                        //:IF mFAProf.EnrolledClassCollegeYear EXISTS
                        lTempInteger_10 = CheckExistenceOfEntity(mFAProf, "EnrolledClassCollegeYear");
                        if (lTempInteger_10 == 0) {
                            //:nCollegeYearID = mFAProf.EnrolledClassCollegeYear.ID 
                            {
                                MutableInt mi_nCollegeYearID = new MutableInt(nCollegeYearID);
                                GetIntegerFromAttribute(mi_nCollegeYearID, mFAProf, "EnrolledClassCollegeYear",
                                        "ID");
                                nCollegeYearID = mi_nCollegeYearID.intValue();
                            }
                            //:szSemester     = mFAProf.EnrolledClassCollegeTerm.Semester 
                            {
                                MutableInt mi_lTempInteger_11 = new MutableInt(lTempInteger_11);
                                StringBuilder sb_szSemester;
                                if (szSemester == null)
                                    sb_szSemester = new StringBuilder(32);
                                else
                                    sb_szSemester = new StringBuilder(szSemester);
                                GetVariableFromAttribute(sb_szSemester, mi_lTempInteger_11, 'S', 3, mFAProf,
                                        "EnrolledClassCollegeTerm", "Semester", "", 0);
                                lTempInteger_11 = mi_lTempInteger_11.intValue();
                                szSemester = sb_szSemester.toString();
                            }
                            //:ELSE
                        } else {
                            //:IF mFAProf.EnrolledOverrideCollegeYear EXISTS
                            lTempInteger_12 = CheckExistenceOfEntity(mFAProf, "EnrolledOverrideCollegeYear");
                            if (lTempInteger_12 == 0) {
                                //:nCollegeYearID = mFAProf.EnrolledOverrideCollegeYear.ID 
                                {
                                    MutableInt mi_nCollegeYearID = new MutableInt(nCollegeYearID);
                                    GetIntegerFromAttribute(mi_nCollegeYearID, mFAProf,
                                            "EnrolledOverrideCollegeYear", "ID");
                                    nCollegeYearID = mi_nCollegeYearID.intValue();
                                }
                                //:szSemester     = mFAProf.EnrolledOverrideCollegeTerm.Semester 
                                {
                                    MutableInt mi_lTempInteger_13 = new MutableInt(lTempInteger_13);
                                    StringBuilder sb_szSemester;
                                    if (szSemester == null)
                                        sb_szSemester = new StringBuilder(32);
                                    else
                                        sb_szSemester = new StringBuilder(szSemester);
                                    GetVariableFromAttribute(sb_szSemester, mi_lTempInteger_13, 'S', 3, mFAProf,
                                            "EnrolledOverrideCollegeTerm", "Semester", "", 0);
                                    lTempInteger_13 = mi_lTempInteger_13.intValue();
                                    szSemester = sb_szSemester.toString();
                                }
                            }

                            //:END
                        }

                        //:END
                        //:IF nCollegeYearID = nProfileCollegeYearID AND 
                        //:   (szSemester = "01" OR szSemester = "03" OR szSemester = "04")
                        if (nCollegeYearID == nProfileCollegeYearID
                                && (ZeidonStringCompare(szSemester, 1, 0, "01", 1, 0, 3) == 0
                                        || ZeidonStringCompare(szSemester, 1, 0, "03", 1, 0, 3) == 0
                                        || ZeidonStringCompare(szSemester, 1, 0, "04", 1, 0, 3) == 0)) {
                            //:// The Enrollment entry is for the same College Year, so include Fall entries in first period and Spring
                            //:// and Summer entries in 2nd period.
                            //:SET CURSOR FIRST mFAProf.PerProfileFinAidAwardPeriod 
                            RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
                            //:IF szSemester = "03" OR szSemester = "04"
                            if (ZeidonStringCompare(szSemester, 1, 0, "03", 1, 0, 3) == 0
                                    || ZeidonStringCompare(szSemester, 1, 0, "04", 1, 0, 3) == 0) {
                                //:SET CURSOR NEXT mFAProf.PerProfileFinAidAwardPeriod  
                                RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setNextContinue()
                                        .toInt();
                                ;
                            }

                            //:END 
                            //:INCLUDE mFAProf.DisplayEnrolled FROM mFAProf.Enrolled 
                            RESULT = IncludeSubobjectFromSubobject(mFAProf, "DisplayEnrolled", mFAProf,
                                    "Enrolled", zPOS_AFTER);
                        }

                        RESULT = mFAProf.cursor("Enrolled").setNextContinue().toInt();
                        ;
                        //:END
                    }

                    //:END // End ENC Rule

                    //:// Compute Credits per period.
                    //:SET CURSOR FIRST mFAProf.PerProfileFinAidAwardPeriod 
                    RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
                    //:dPeriod1Credits = mFAProf.PerProfileFinAidAwardPeriod.dCreditsPerDisb   // This is now just Fall credits.
                    {
                        MutableDouble md_dPeriod1Credits = new MutableDouble(dPeriod1Credits);
                        GetDecimalFromAttribute(md_dPeriod1Credits, mFAProf, "PerProfileFinAidAwardPeriod",
                                "dCreditsPerDisb");
                        dPeriod1Credits = md_dPeriod1Credits.doubleValue();
                    }
                    //:SET CURSOR NEXT mFAProf.PerProfileFinAidAwardPeriod
                    RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setNextContinue().toInt();
                    ;
                    //:dPeriod2Credits = mFAProf.PerProfileFinAidAwardPeriod.dCreditsPerDisb   // This is now Spring and Summer credits.
                    {
                        MutableDouble md_dPeriod2Credits = new MutableDouble(dPeriod2Credits);
                        GetDecimalFromAttribute(md_dPeriod2Credits, mFAProf, "PerProfileFinAidAwardPeriod",
                                "dCreditsPerDisb");
                        dPeriod2Credits = md_dPeriod2Credits.doubleValue();
                    }

                    //:// Use rules above to determine if January course should be included under first or 2nd period.
                    //:CreateViewFromView( lFAAdminT, lFAAdmin )
                    CreateViewFromView(lFAAdminT, lFAAdmin);
                    //:SET CURSOR FIRST lFAAdminT.FinAidAdmin WHERE lFAAdminT.CollegeYear.ID = nProfileCollegeYearID
                    RESULT = lFAAdminT.cursor("FinAidAdmin").setFirst().toInt();
                    if (RESULT > zCURSOR_UNCHANGED) {
                        while (RESULT > zCURSOR_UNCHANGED && (CompareAttributeToInteger(lFAAdminT,
                                "CollegeYear", "ID", nProfileCollegeYearID) != 0)) {
                            RESULT = lFAAdminT.cursor("FinAidAdmin").setNextContinue().toInt();
                            ;
                        }

                    }

                    //:SET CURSOR FIRST lFAAdminT.CollegeTerm WHERE lFAAdminT.CollegeTerm.Semester = "01"
                    RESULT = lFAAdminT.cursor("CollegeTerm").setFirst("Semester", "01").toInt();
                    //:dMinFallCredits = lFAAdminT.CollegeTerm.FullTimeMinCredits 
                    {
                        MutableDouble md_dMinFallCredits = new MutableDouble(dMinFallCredits);
                        GetDecimalFromAttribute(md_dMinFallCredits, lFAAdminT, "CollegeTerm",
                                "FullTimeMinCredits");
                        dMinFallCredits = md_dMinFallCredits.doubleValue();
                    }
                    //:SET CURSOR FIRST lFAAdminT.CollegeTerm WHERE lFAAdminT.CollegeTerm.Semester = "03"
                    RESULT = lFAAdminT.cursor("CollegeTerm").setFirst("Semester", "03").toInt();
                    //:dMinSpringCredits = lFAAdminT.CollegeTerm.FullTimeMinCredits 
                    {
                        MutableDouble md_dMinSpringCredits = new MutableDouble(dMinSpringCredits);
                        GetDecimalFromAttribute(md_dMinSpringCredits, lFAAdminT, "CollegeTerm",
                                "FullTimeMinCredits");
                        dMinSpringCredits = md_dMinSpringCredits.doubleValue();
                    }
                    //:DropView( lFAAdminT )
                    DropView(lFAAdminT);
                    //:IF dPeriod1Credits = 0 OR 
                    //:   (dPeriod2Credits > 0 AND dPeriod2Credits < dMinSpringCredits AND dPeriod1Credits >= dMinFallCredits)
                    if (dPeriod1Credits == 0 || (dPeriod2Credits > 0 && dPeriod2Credits < dMinSpringCredits
                            && dPeriod1Credits >= dMinFallCredits)) {

                        //:// January classes are added to Spring Term.
                        //:SET CURSOR FIRST mFAProf.PerProfileFinAidAwardPeriod 
                        RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
                        //:SET CURSOR NEXT mFAProf.PerProfileFinAidAwardPeriod
                        RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setNextContinue().toInt();
                        ;
                        //:ELSE
                    } else {
                        //:// January classes are added to Fall Term
                        //:SET CURSOR FIRST mFAProf.PerProfileFinAidAwardPeriod 
                        RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
                    }

                    //:END
                    //:// Include January classes to correct period.
                    //:FOR EACH mFAProf.Enrolled
                    RESULT = mFAProf.cursor("Enrolled").setFirst().toInt();
                    while (RESULT > zCURSOR_UNCHANGED) {
                        //:nCollegeYearID = 0
                        nCollegeYearID = 0;
                        //:IF mFAProf.EnrolledClassCollegeYear EXISTS
                        lTempInteger_14 = CheckExistenceOfEntity(mFAProf, "EnrolledClassCollegeYear");
                        if (lTempInteger_14 == 0) {
                            //:nCollegeYearID = mFAProf.EnrolledClassCollegeYear.ID 
                            {
                                MutableInt mi_nCollegeYearID = new MutableInt(nCollegeYearID);
                                GetIntegerFromAttribute(mi_nCollegeYearID, mFAProf, "EnrolledClassCollegeYear",
                                        "ID");
                                nCollegeYearID = mi_nCollegeYearID.intValue();
                            }
                            //:szSemester     = mFAProf.EnrolledClassCollegeTerm.Semester 
                            {
                                MutableInt mi_lTempInteger_15 = new MutableInt(lTempInteger_15);
                                StringBuilder sb_szSemester;
                                if (szSemester == null)
                                    sb_szSemester = new StringBuilder(32);
                                else
                                    sb_szSemester = new StringBuilder(szSemester);
                                GetVariableFromAttribute(sb_szSemester, mi_lTempInteger_15, 'S', 3, mFAProf,
                                        "EnrolledClassCollegeTerm", "Semester", "", 0);
                                lTempInteger_15 = mi_lTempInteger_15.intValue();
                                szSemester = sb_szSemester.toString();
                            }
                            //:ELSE
                        } else {
                            //:IF mFAProf.EnrolledOverrideCollegeYear EXISTS
                            lTempInteger_16 = CheckExistenceOfEntity(mFAProf, "EnrolledOverrideCollegeYear");
                            if (lTempInteger_16 == 0) {
                                //:nCollegeYearID = mFAProf.EnrolledOverrideCollegeYear.ID 
                                {
                                    MutableInt mi_nCollegeYearID = new MutableInt(nCollegeYearID);
                                    GetIntegerFromAttribute(mi_nCollegeYearID, mFAProf,
                                            "EnrolledOverrideCollegeYear", "ID");
                                    nCollegeYearID = mi_nCollegeYearID.intValue();
                                }
                                //:szSemester     = mFAProf.EnrolledOverrideCollegeTerm.Semester 
                                {
                                    MutableInt mi_lTempInteger_17 = new MutableInt(lTempInteger_17);
                                    StringBuilder sb_szSemester;
                                    if (szSemester == null)
                                        sb_szSemester = new StringBuilder(32);
                                    else
                                        sb_szSemester = new StringBuilder(szSemester);
                                    GetVariableFromAttribute(sb_szSemester, mi_lTempInteger_17, 'S', 3, mFAProf,
                                            "EnrolledOverrideCollegeTerm", "Semester", "", 0);
                                    lTempInteger_17 = mi_lTempInteger_17.intValue();
                                    szSemester = sb_szSemester.toString();
                                }
                            }

                            //:END
                        }

                        //:END
                        //:IF nCollegeYearID = nProfileCollegeYearID AND szSemester = "02"
                        if (nCollegeYearID == nProfileCollegeYearID
                                && ZeidonStringCompare(szSemester, 1, 0, "02", 1, 0, 3) == 0) {
                            //:INCLUDE mFAProf.DisplayEnrolled FROM mFAProf.Enrolled 
                            RESULT = IncludeSubobjectFromSubobject(mFAProf, "DisplayEnrolled", mFAProf,
                                    "Enrolled", zPOS_AFTER);
                        }

                        RESULT = mFAProf.cursor("Enrolled").setNextContinue().toInt();
                        ;
                        //:END
                    }

                    //:END
                }

                //:   
                //:END
            }

            //:END
        }

        //:END

        //:// Make sure award disbursements are sorted by period.
        //:FOR EACH mFAProf.FinAidAward
        RESULT = mFAProf.cursor("FinAidAward").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:OrderEntityForView( mFAProf, "FinAidAwardDisbursement", "FinAidAwardPeriod.BeginDate A" )
            OrderEntityForView(mFAProf, "FinAidAwardDisbursement", "FinAidAwardPeriod.BeginDate A");
            RESULT = mFAProf.cursor("FinAidAward").setNextContinue().toInt();
            ;
        }

        //:END

        //:// Build the expanded list of Comment Codes.
        //:IF mFAProf.FAISIREligibility EXISTS 
        lTempInteger_18 = CheckExistenceOfEntity(mFAProf, "FAISIREligibility");
        if (lTempInteger_18 == 0) {
            //:// Get access to the Comment Codes conversion object.
            //:// We will first access an attribute with domain that uses the X_FAISIR_Tables to get the table loaded.
            //:GetStringFromAttributeByContext( szSourceString, mFAProf, "FAISIREligibility", "SAACitizenshipFlag", "", 500 )  // Used just to load proper Domain object.
            {
                StringBuilder sb_szSourceString;
                if (szSourceString == null)
                    sb_szSourceString = new StringBuilder(32);
                else
                    sb_szSourceString = new StringBuilder(szSourceString);
                GetStringFromAttributeByContext(sb_szSourceString, mFAProf, "FAISIREligibility",
                        "SAACitizenshipFlag", "", 500);
                szSourceString = sb_szSourceString.toString();
            }
            //:szCommentsDomain = "X_FAISIR_Tables" + mFAProf.FAISIR.YearIndicator 
            {
                MutableInt mi_lTempInteger_19 = new MutableInt(lTempInteger_19);
                StringBuilder sb_szTempString_0;
                if (szTempString_0 == null)
                    sb_szTempString_0 = new StringBuilder(32);
                else
                    sb_szTempString_0 = new StringBuilder(szTempString_0);
                GetVariableFromAttribute(sb_szTempString_0, mi_lTempInteger_19, 'S', 255, mFAProf, "FAISIR",
                        "YearIndicator", "", 0);
                lTempInteger_19 = mi_lTempInteger_19.intValue();
                szTempString_0 = sb_szTempString_0.toString();
            }
            {
                StringBuilder sb_szCommentsDomain;
                if (szCommentsDomain == null)
                    sb_szCommentsDomain = new StringBuilder(32);
                else
                    sb_szCommentsDomain = new StringBuilder(szCommentsDomain);
                ZeidonStringCopy(sb_szCommentsDomain, 1, 0, "X_FAISIR_Tables", 1, 0, 33);
                szCommentsDomain = sb_szCommentsDomain.toString();
            }
            {
                StringBuilder sb_szCommentsDomain;
                if (szCommentsDomain == null)
                    sb_szCommentsDomain = new StringBuilder(32);
                else
                    sb_szCommentsDomain = new StringBuilder(szCommentsDomain);
                ZeidonStringConcat(sb_szCommentsDomain, 1, 0, szTempString_0, 1, 0, 33);
                szCommentsDomain = sb_szCommentsDomain.toString();
            }
            //:GET VIEW mFAISIRD NAMED szCommentsDomain
            RESULT = GetViewByName(mFAISIRD, szCommentsDomain, mFAProfOrig, zLEVEL_TASK);
            //:IF RESULT >= 0
            if (RESULT >= 0) {
                //:SET CURSOR FIRST mFAISIRD.FAISIRDomain WHERE mFAISIRD.FAISIRDomain.Name = "CommentCodes" 
                RESULT = mFAISIRD.cursor("FAISIRDomain").setFirst("Name", "CommentCodes").toInt();
                //:szSourceString = mFAProf.FAISIREligibility.CommentCodes 
                {
                    MutableInt mi_lTempInteger_20 = new MutableInt(lTempInteger_20);
                    StringBuilder sb_szSourceString;
                    if (szSourceString == null)
                        sb_szSourceString = new StringBuilder(32);
                    else
                        sb_szSourceString = new StringBuilder(szSourceString);
                    GetVariableFromAttribute(sb_szSourceString, mi_lTempInteger_20, 'S', 501, mFAProf,
                            "FAISIREligibility", "CommentCodes", "", 0);
                    lTempInteger_20 = mi_lTempInteger_20.intValue();
                    szSourceString = sb_szSourceString.toString();
                }
                //:nLen = zGetStringLen( szSourceString )
                nLen = zGetStringLen(szSourceString);
                //:nLen = nLen - 3
                nLen = nLen - 3;
                //:nIndex = 1
                nIndex = 1;
                //:LOOP WHILE nIndex <= nLen
                while (nIndex <= nLen) {
                    //:szCode = szSourceString [ nIndex : 3 ]
                    {
                        StringBuilder sb_szCode;
                        if (szCode == null)
                            sb_szCode = new StringBuilder(32);
                        else
                            sb_szCode = new StringBuilder(szCode);
                        ZeidonStringCopy(sb_szCode, 1, 0, szSourceString, nIndex, 3, 121);
                        szCode = sb_szCode.toString();
                    }
                    //:SET CURSOR FIRST mFAISIRD.FAISIRDomainValue WHERE mFAISIRD.FAISIRDomainValue.InternalStringValue = szCode
                    RESULT = mFAISIRD.cursor("FAISIRDomainValue").setFirst("InternalStringValue", szCode)
                            .toInt();
                    //:IF RESULT >= zCURSOR_SET
                    if (RESULT >= zCURSOR_SET) {
                        //:szCommentsString = szCommentsString + szCode + NEW_LINE + "  " + mFAISIRD.FAISIRDomainValue.ExternalDescription + NEW_LINE + NEW_LINE
                        {
                            StringBuilder sb_szCommentsString;
                            if (szCommentsString == null)
                                sb_szCommentsString = new StringBuilder(32);
                            else
                                sb_szCommentsString = new StringBuilder(szCommentsString);
                            ZeidonStringConcat(sb_szCommentsString, 1, 0, szCode, 1, 0, 10001);
                            szCommentsString = sb_szCommentsString.toString();
                        }
                        {
                            StringBuilder sb_szCommentsString;
                            if (szCommentsString == null)
                                sb_szCommentsString = new StringBuilder(32);
                            else
                                sb_szCommentsString = new StringBuilder(szCommentsString);
                            ZeidonStringConcat(sb_szCommentsString, 1, 0, NEW_LINE, 1, 0, 10001);
                            szCommentsString = sb_szCommentsString.toString();
                        }
                        {
                            StringBuilder sb_szCommentsString;
                            if (szCommentsString == null)
                                sb_szCommentsString = new StringBuilder(32);
                            else
                                sb_szCommentsString = new StringBuilder(szCommentsString);
                            ZeidonStringConcat(sb_szCommentsString, 1, 0, "  ", 1, 0, 10001);
                            szCommentsString = sb_szCommentsString.toString();
                        }
                        {
                            MutableInt mi_lTempInteger_21 = new MutableInt(lTempInteger_21);
                            StringBuilder sb_szTempString_1;
                            if (szTempString_1 == null)
                                sb_szTempString_1 = new StringBuilder(32);
                            else
                                sb_szTempString_1 = new StringBuilder(szTempString_1);
                            GetVariableFromAttribute(sb_szTempString_1, mi_lTempInteger_21, 'S', 4001, mFAISIRD,
                                    "FAISIRDomainValue", "ExternalDescription", "", 0);
                            lTempInteger_21 = mi_lTempInteger_21.intValue();
                            szTempString_1 = sb_szTempString_1.toString();
                        }
                        {
                            StringBuilder sb_szCommentsString;
                            if (szCommentsString == null)
                                sb_szCommentsString = new StringBuilder(32);
                            else
                                sb_szCommentsString = new StringBuilder(szCommentsString);
                            ZeidonStringConcat(sb_szCommentsString, 1, 0, szTempString_1, 1, 0, 10001);
                            szCommentsString = sb_szCommentsString.toString();
                        }
                        {
                            StringBuilder sb_szCommentsString;
                            if (szCommentsString == null)
                                sb_szCommentsString = new StringBuilder(32);
                            else
                                sb_szCommentsString = new StringBuilder(szCommentsString);
                            ZeidonStringConcat(sb_szCommentsString, 1, 0, NEW_LINE, 1, 0, 10001);
                            szCommentsString = sb_szCommentsString.toString();
                        }
                        {
                            StringBuilder sb_szCommentsString;
                            if (szCommentsString == null)
                                sb_szCommentsString = new StringBuilder(32);
                            else
                                sb_szCommentsString = new StringBuilder(szCommentsString);
                            ZeidonStringConcat(sb_szCommentsString, 1, 0, NEW_LINE, 1, 0, 10001);
                            szCommentsString = sb_szCommentsString.toString();
                        }
                    }

                    //:END
                    //:nIndex = nIndex + 3
                    nIndex = nIndex + 3;
                }

                //:END
                //:mFAProf.FAISIREligibility.wCommentsList = szCommentsString
                SetAttributeFromString(mFAProf, "FAISIREligibility", "wCommentsList", szCommentsString);
            }

            //:END
        }

        //:END

        //:// Build Revision/Swapped data for display.
        //:FOR EACH mFAProf.FinAidAwardDisbursement WITHIN mFAProf.FinAidProfile
        RESULT = mFAProf.cursor("FinAidAwardDisbursement").setFirst("FinAidProfile").toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:IF mFAProf.SwappedToDisbursement EXISTS
            lTempInteger_5 = CheckExistenceOfEntity(mFAProf, "SwappedToDisbursement");
            if (lTempInteger_5 == 0) {
                //:mFAProf.FinAidAwardDisbursement.wDisplayRevisionSwappedData = "Swapped To"
                SetAttributeFromString(mFAProf, "FinAidAwardDisbursement", "wDisplayRevisionSwappedData",
                        "Swapped To");
                //:FOR EACH mFAProf.SwappedToDisbursement
                RESULT = mFAProf.cursor("SwappedToDisbursement").setFirst().toInt();
                while (RESULT > zCURSOR_UNCHANGED) {
                    //:CREATE ENTITY mFAProf.DisplaySwappedEntries 
                    RESULT = CreateEntity(mFAProf, "DisplaySwappedEntries", zPOS_AFTER);
                    //:CreateViewFromView( mFAProf2, mFAProf )
                    CreateViewFromView(mFAProf2, mFAProf);
                    //:SET CURSOR FIRST mFAProf2.FinAidAwardDisbursement WITHIN mFAProf2.FinAidProfile
                    //:           WHERE mFAProf2.FinAidAwardDisbursement.ID = mFAProf2.SwappedToDisbursement.ID 
                    {
                        MutableInt mi_lTempInteger_22 = new MutableInt(lTempInteger_22);
                        GetIntegerFromAttribute(mi_lTempInteger_22, mFAProf2, "SwappedToDisbursement", "ID");
                        lTempInteger_22 = mi_lTempInteger_22.intValue();
                    }
                    RESULT = mFAProf2.cursor("FinAidAwardDisbursement")
                            .setFirst("ID", lTempInteger_22, "FinAidProfile").toInt();
                    //:IF RESULT < zCURSOR_SET
                    if (RESULT < zCURSOR_SET) {
                        //:IssueError( mFAProf,0,0, "Programming Error" )
                        IssueError(mFAProf, 0, 0, "Programming Error");
                    }

                    //:END
                    //:mFAProf.DisplaySwappedEntries.DisbursementDate = mFAProf2.FinAidAwardDisbursement.DisbursementDate 
                    SetAttributeFromAttribute(mFAProf, "DisplaySwappedEntries", "DisbursementDate", mFAProf2,
                            "FinAidAwardDisbursement", "DisbursementDate");
                    //:mFAProf.DisplaySwappedEntries.AmountExpected   = mFAProf2.FinAidAwardDisbursement.AmountExpected 
                    SetAttributeFromAttribute(mFAProf, "DisplaySwappedEntries", "AmountExpected", mFAProf2,
                            "FinAidAwardDisbursement", "AmountExpected");
                    //:mFAProf.DisplaySwappedEntries.Amount           = mFAProf2.FinAidAwardDisbursement.Amount 
                    SetAttributeFromAttribute(mFAProf, "DisplaySwappedEntries", "Amount", mFAProf2,
                            "FinAidAwardDisbursement", "Amount");
                    //:mFAProf.DisplaySwappedEntries.PeriodDesignator = mFAProf2.FinAidAwardPeriod.PeriodDesignator 
                    SetAttributeFromAttribute(mFAProf, "DisplaySwappedEntries", "PeriodDesignator", mFAProf2,
                            "FinAidAwardPeriod", "PeriodDesignator");
                    //:mFAProf.DisplaySwappedEntries.SwappedSourceDescription = "Swapped To " + mFAProf2.FinAidSource.Name 
                    {
                        MutableInt mi_lTempInteger_23 = new MutableInt(lTempInteger_23);
                        StringBuilder sb_szTempString_3;
                        if (szTempString_3 == null)
                            sb_szTempString_3 = new StringBuilder(32);
                        else
                            sb_szTempString_3 = new StringBuilder(szTempString_3);
                        GetVariableFromAttribute(sb_szTempString_3, mi_lTempInteger_23, 'S', 51, mFAProf2,
                                "FinAidSource", "Name", "", 0);
                        lTempInteger_23 = mi_lTempInteger_23.intValue();
                        szTempString_3 = sb_szTempString_3.toString();
                    }
                    {
                        StringBuilder sb_szTempString_2;
                        if (szTempString_2 == null)
                            sb_szTempString_2 = new StringBuilder(32);
                        else
                            sb_szTempString_2 = new StringBuilder(szTempString_2);
                        ZeidonStringCopy(sb_szTempString_2, 1, 0, "Swapped To ", 1, 0, 255);
                        szTempString_2 = sb_szTempString_2.toString();
                    }
                    {
                        StringBuilder sb_szTempString_2;
                        if (szTempString_2 == null)
                            sb_szTempString_2 = new StringBuilder(32);
                        else
                            sb_szTempString_2 = new StringBuilder(szTempString_2);
                        ZeidonStringConcat(sb_szTempString_2, 1, 0, szTempString_3, 1, 0, 255);
                        szTempString_2 = sb_szTempString_2.toString();
                    }
                    SetAttributeFromString(mFAProf, "DisplaySwappedEntries", "SwappedSourceDescription",
                            szTempString_2);
                    //:DropView( mFAProf2 )
                    DropView(mFAProf2);
                    RESULT = mFAProf.cursor("SwappedToDisbursement").setNextContinue().toInt();
                    ;
                }

                //:END
                //:ELSE
            } else {
                //:IF mFAProf.SwappedFromDisbursement EXISTS
                lTempInteger_24 = CheckExistenceOfEntity(mFAProf, "SwappedFromDisbursement");
                if (lTempInteger_24 == 0) {
                    //:mFAProf.FinAidAwardDisbursement.wDisplayRevisionSwappedData = "Swapped From"
                    SetAttributeFromString(mFAProf, "FinAidAwardDisbursement", "wDisplayRevisionSwappedData",
                            "Swapped From");
                    //:CREATE ENTITY mFAProf.DisplaySwappedEntries 
                    RESULT = CreateEntity(mFAProf, "DisplaySwappedEntries", zPOS_AFTER);
                    //:CreateViewFromView( mFAProf2, mFAProf )
                    CreateViewFromView(mFAProf2, mFAProf);
                    //:SET CURSOR FIRST mFAProf2.FinAidAwardDisbursement WITHIN mFAProf2.FinAidProfile
                    //:           WHERE mFAProf2.FinAidAwardDisbursement.ID = mFAProf2.SwappedFromDisbursement.ID 
                    {
                        MutableInt mi_lTempInteger_25 = new MutableInt(lTempInteger_25);
                        GetIntegerFromAttribute(mi_lTempInteger_25, mFAProf2, "SwappedFromDisbursement", "ID");
                        lTempInteger_25 = mi_lTempInteger_25.intValue();
                    }
                    RESULT = mFAProf2.cursor("FinAidAwardDisbursement")
                            .setFirst("ID", lTempInteger_25, "FinAidProfile").toInt();
                    //:IF RESULT < zCURSOR_SET
                    if (RESULT < zCURSOR_SET) {
                        //:IssueError( mFAProf,0,0, "Programming Error" )
                        IssueError(mFAProf, 0, 0, "Programming Error");
                    }

                    //:END
                    //:mFAProf.DisplaySwappedEntries.DisbursementDate = mFAProf2.FinAidAwardDisbursement.DisbursementDate 
                    SetAttributeFromAttribute(mFAProf, "DisplaySwappedEntries", "DisbursementDate", mFAProf2,
                            "FinAidAwardDisbursement", "DisbursementDate");
                    //:mFAProf.DisplaySwappedEntries.AmountExpected   = mFAProf2.FinAidAwardDisbursement.AmountExpected 
                    SetAttributeFromAttribute(mFAProf, "DisplaySwappedEntries", "AmountExpected", mFAProf2,
                            "FinAidAwardDisbursement", "AmountExpected");
                    //:mFAProf.DisplaySwappedEntries.Amount           = mFAProf2.FinAidAwardDisbursement.Amount 
                    SetAttributeFromAttribute(mFAProf, "DisplaySwappedEntries", "Amount", mFAProf2,
                            "FinAidAwardDisbursement", "Amount");
                    //:mFAProf.DisplaySwappedEntries.PeriodDesignator = mFAProf2.FinAidAwardPeriod.PeriodDesignator 
                    SetAttributeFromAttribute(mFAProf, "DisplaySwappedEntries", "PeriodDesignator", mFAProf2,
                            "FinAidAwardPeriod", "PeriodDesignator");
                    //:mFAProf.DisplaySwappedEntries.SwappedSourceDescription = "Swapped From " + mFAProf2.FinAidSource.Name 
                    {
                        MutableInt mi_lTempInteger_26 = new MutableInt(lTempInteger_26);
                        StringBuilder sb_szTempString_5;
                        if (szTempString_5 == null)
                            sb_szTempString_5 = new StringBuilder(32);
                        else
                            sb_szTempString_5 = new StringBuilder(szTempString_5);
                        GetVariableFromAttribute(sb_szTempString_5, mi_lTempInteger_26, 'S', 51, mFAProf2,
                                "FinAidSource", "Name", "", 0);
                        lTempInteger_26 = mi_lTempInteger_26.intValue();
                        szTempString_5 = sb_szTempString_5.toString();
                    }
                    {
                        StringBuilder sb_szTempString_4;
                        if (szTempString_4 == null)
                            sb_szTempString_4 = new StringBuilder(32);
                        else
                            sb_szTempString_4 = new StringBuilder(szTempString_4);
                        ZeidonStringCopy(sb_szTempString_4, 1, 0, "Swapped From ", 1, 0, 255);
                        szTempString_4 = sb_szTempString_4.toString();
                    }
                    {
                        StringBuilder sb_szTempString_4;
                        if (szTempString_4 == null)
                            sb_szTempString_4 = new StringBuilder(32);
                        else
                            sb_szTempString_4 = new StringBuilder(szTempString_4);
                        ZeidonStringConcat(sb_szTempString_4, 1, 0, szTempString_5, 1, 0, 255);
                        szTempString_4 = sb_szTempString_4.toString();
                    }
                    SetAttributeFromString(mFAProf, "DisplaySwappedEntries", "SwappedSourceDescription",
                            szTempString_4);
                    //:DropView( mFAProf2 )
                    DropView(mFAProf2);
                    //:ELSE
                } else {
                    //:IF mFAProf.FinAidAwardDisbursement.RevisionType != ""
                    if (CompareAttributeToString(mFAProf, "FinAidAwardDisbursement", "RevisionType", "") != 0) {
                        //:GetStringFromAttributeByContext( szRevisionType, mFAProf, "FinAidAwardDisbursement", "RevisionType", "", 10 )
                        {
                            StringBuilder sb_szRevisionType;
                            if (szRevisionType == null)
                                sb_szRevisionType = new StringBuilder(32);
                            else
                                sb_szRevisionType = new StringBuilder(szRevisionType);
                            GetStringFromAttributeByContext(sb_szRevisionType, mFAProf,
                                    "FinAidAwardDisbursement", "RevisionType", "", 10);
                            szRevisionType = sb_szRevisionType.toString();
                        }
                        //:mFAProf.FinAidAwardDisbursement.wDisplayRevisionSwappedData = szRevisionType
                        SetAttributeFromString(mFAProf, "FinAidAwardDisbursement",
                                "wDisplayRevisionSwappedData", szRevisionType);
                    }

                    //:END
                }

                //:END
            }

            RESULT = mFAProf.cursor("FinAidAwardDisbursement").setNextContinue().toInt();
            ;
            //:END
        }

        //:END

        //:// Initialize list of awards to not show inactive or declined entries.
        //:ShowHidePeriodAwards( mFAProf )
        omFAProf_ShowHidePeriodAwards(mFAProf);
        //:SET CURSOR FIRST mFAProf.FinAidProfile     // Reposition all subobjects on first entry. 
        RESULT = mFAProf.cursor("FinAidProfile").setFirst().toInt();

        //:DropView( mFAProf )
        DropView(mFAProf);
        break;

    //:/* end zOCE_ACTIVATE */
    //:OF   zOCE_ACTIVATE_EMPTY:
    case zOCE_ACTIVATE_EMPTY:
        break;

    //:/* end zOCE_ACTIVATE_EMPTY */

    //:OF   zOCE_COMMIT:
    case zOCE_COMMIT:

        //:CreateViewFromView( mFAProf, mFAProfOrig )
        CreateViewFromView(mFAProf, mFAProfOrig);
        //:FOR EACH mFAProf.FinAidProfile
        RESULT = mFAProf.cursor("FinAidProfile").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:IF  mFAProf.Person DOES not EXIST 
            lTempInteger_27 = CheckExistenceOfEntity(mFAProf, "Person");
            if (lTempInteger_27 != 0) {
                //:nRC = MessagePrompt( mFAProf, "", "mFAProf No Person",
                //:      "This Financial Aid Profile has no Person attached. Are you SURE you want to save it?",
                //:      0, zBUTTONS_YESNO, zRESPONSE_NO, 0 )
                nRC = MessagePrompt(mFAProf, "", "mFAProf No Person",
                        "This Financial Aid Profile has no Person attached. Are you SURE you want to save it?",
                        0, zBUTTONS_YESNO, zRESPONSE_NO, 0);
                //:IF nRC = zRESPONSE_NO
                if (nRC == zRESPONSE_NO) {
                    //:RETURN -1 
                    if (8 == 8)
                        return (-1);
                }

                //:END
            }

            //:END
            //:IF  mFAProf.FinAidProfile DOES not EXIST 
            lTempInteger_28 = CheckExistenceOfEntity(mFAProf, "FinAidProfile");
            if (lTempInteger_28 != 0) {
                //:nRC = MessagePrompt( mFAProf, "", "mFAProf No Profile ",
                //:      "This Financial Aid Profile has no Root. Are you SURE you want to save it?",
                //:      0, zBUTTONS_YESNO, zRESPONSE_NO, 0 )
                nRC = MessagePrompt(mFAProf, "", "mFAProf No Profile ",
                        "This Financial Aid Profile has no Root. Are you SURE you want to save it?", 0,
                        zBUTTONS_YESNO, zRESPONSE_NO, 0);
                //:IF nRC = zRESPONSE_NO
                if (nRC == zRESPONSE_NO) {
                    //:RETURN -1 
                    if (8 == 8)
                        return (-1);
                }

                //:END
            }

            //:END
            //:IF mFAProf.CurrentPerson EXISTS 
            lTempInteger_29 = CheckExistenceOfEntity(mFAProf, "CurrentPerson");
            if (lTempInteger_29 == 0) {
                //:EXCLUDE  mFAProf.CurrentPerson 
                RESULT = ExcludeEntity(mFAProf, "CurrentPerson", zREPOS_AFTER);
            }

            //:END
            //:INCLUDE  mFAProf.CurrentPerson  FROM mFAProf.Person 
            RESULT = IncludeSubobjectFromSubobject(mFAProf, "CurrentPerson", mFAProf, "Person", zPOS_AFTER);
            //:szName = mFAProf.Person.LastName + ", " + mFAProf.Person.FirstName 
            {
                StringBuilder sb_szName;
                if (szName == null)
                    sb_szName = new StringBuilder(32);
                else
                    sb_szName = new StringBuilder(szName);
                GetStringFromAttribute(sb_szName, mFAProf, "Person", "LastName");
                szName = sb_szName.toString();
            }
            {
                StringBuilder sb_szName;
                if (szName == null)
                    sb_szName = new StringBuilder(32);
                else
                    sb_szName = new StringBuilder(szName);
                ZeidonStringConcat(sb_szName, 1, 0, ", ", 1, 0, 51);
                szName = sb_szName.toString();
            }
            {
                MutableInt mi_lTempInteger_30 = new MutableInt(lTempInteger_30);
                StringBuilder sb_szTempString_6;
                if (szTempString_6 == null)
                    sb_szTempString_6 = new StringBuilder(32);
                else
                    sb_szTempString_6 = new StringBuilder(szTempString_6);
                GetVariableFromAttribute(sb_szTempString_6, mi_lTempInteger_30, 'S', 51, mFAProf, "Person",
                        "FirstName", "", 0);
                lTempInteger_30 = mi_lTempInteger_30.intValue();
                szTempString_6 = sb_szTempString_6.toString();
            }
            {
                StringBuilder sb_szName;
                if (szName == null)
                    sb_szName = new StringBuilder(32);
                else
                    sb_szName = new StringBuilder(szName);
                ZeidonStringConcat(sb_szName, 1, 0, szTempString_6, 1, 0, 51);
                szName = sb_szName.toString();
            }
            //:TraceLineS("mFAProf Commiting: ", szName )
            TraceLineS("mFAProf Commiting: ", szName);
            //:szDate = wXferO.Root.dCurrentDate 
            {
                MutableInt mi_lTempInteger_31 = new MutableInt(lTempInteger_31);
                StringBuilder sb_szDate;
                if (szDate == null)
                    sb_szDate = new StringBuilder(32);
                else
                    sb_szDate = new StringBuilder(szDate);
                GetVariableFromAttribute(sb_szDate, mi_lTempInteger_31, 'S', 33, wXferO, "Root", "dCurrentDate",
                        "", 0);
                lTempInteger_31 = mi_lTempInteger_31.intValue();
                szDate = sb_szDate.toString();
            }
            //:SET CURSOR FIRST mFAProf.PerProfileFinAidAwardPeriod 
            //:   WHERE mFAProf.PerProfileFinAidAwardPeriod.BeginDate <= szDate 
            //:     AND mFAProf.PerProfileFinAidAwardPeriod.EndDate >= szDate 
            RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
            if (RESULT > zCURSOR_UNCHANGED) {
                while (RESULT > zCURSOR_UNCHANGED && (CompareAttributeToString(mFAProf,
                        "PerProfileFinAidAwardPeriod", "BeginDate", szDate) > 0
                        || CompareAttributeToString(mFAProf, "PerProfileFinAidAwardPeriod", "EndDate",
                                szDate) < 0)) {
                    RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setNextContinue().toInt();
                    ;
                }

            }

            //:IF RESULT >= zCURSOR_SET 
            if (RESULT >= zCURSOR_SET) {
                //:IF mFAProf.FinAidProfile.FullPartTime != mFAProf.PerProfileFinAidAwardPeriod.dFullPartTime 
                if (CompareAttributeToAttribute(mFAProf, "FinAidProfile", "FullPartTime", mFAProf,
                        "PerProfileFinAidAwardPeriod", "dFullPartTime") != 0) {
                    //:mFAProf.FinAidProfile.FullPartTime = mFAProf.PerProfileFinAidAwardPeriod.dFullPartTime 
                    SetAttributeFromAttribute(mFAProf, "FinAidProfile", "FullPartTime", mFAProf,
                            "PerProfileFinAidAwardPeriod", "dFullPartTime");
                }

                //:END 
            }

            //:END

            //:// Set ProfileYearBegin and ProfileYearEnd.
            //:// For Term Students, we determine the dates from the CollegeYear.
            //:// For Cohort Students, we determine the dates from the FinancialAidPeriods.
            //:// On 6/21/2006 Don C changed code below so that both Term Students and Cohort
            //:// students get the Begin/End Dates from the Periods.
            //:OrderEntityForView( mFAProf, "PerProfileFinAidAwardPeriod", "BeginDate A" )
            OrderEntityForView(mFAProf, "PerProfileFinAidAwardPeriod", "BeginDate A");
            //:SET CURSOR FIRST mFAProf.PerProfileFinAidAwardPeriod
            RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setFirst().toInt();
            //:IF RESULT >= zCURSOR_SET 
            if (RESULT >= zCURSOR_SET) {
                //:IF mFAProf.FinAidProfile.ProfileYearBegin != mFAProf.PerProfileFinAidAwardPeriod.BeginDate
                if (CompareAttributeToAttribute(mFAProf, "FinAidProfile", "ProfileYearBegin", mFAProf,
                        "PerProfileFinAidAwardPeriod", "BeginDate") != 0) {
                    //:mFAProf.FinAidProfile.ProfileYearBegin = mFAProf.PerProfileFinAidAwardPeriod.BeginDate
                    SetAttributeFromAttribute(mFAProf, "FinAidProfile", "ProfileYearBegin", mFAProf,
                            "PerProfileFinAidAwardPeriod", "BeginDate");
                }

                //:END
                //:SET CURSOR LAST mFAProf.PerProfileFinAidAwardPeriod
                RESULT = mFAProf.cursor("PerProfileFinAidAwardPeriod").setLast().toInt();
                ;
                //:IF mFAProf.FinAidProfile.ProfileYearEnd != mFAProf.PerProfileFinAidAwardPeriod.EndDate 
                if (CompareAttributeToAttribute(mFAProf, "FinAidProfile", "ProfileYearEnd", mFAProf,
                        "PerProfileFinAidAwardPeriod", "EndDate") != 0) {
                    //:mFAProf.FinAidProfile.ProfileYearEnd = mFAProf.PerProfileFinAidAwardPeriod.EndDate 
                    SetAttributeFromAttribute(mFAProf, "FinAidProfile", "ProfileYearEnd", mFAProf,
                            "PerProfileFinAidAwardPeriod", "EndDate");
                }

                //:END
            }

            //:END

            //:// Set the Original Award and Disbursement Amounts, if no Disburesements are swapped.
            //:FOR EACH mFAProf.FinAidAward 
            RESULT = mFAProf.cursor("FinAidAward").setFirst().toInt();
            while (RESULT > zCURSOR_UNCHANGED) {
                //:// Changed by DonC on 8/3/2010.
                //:SET CURSOR FIRST mFAProf.SwappedToDisbursement WITHIN mFAProf.FinAidAward 
                RESULT = mFAProf.cursor("SwappedToDisbursement").setFirst("FinAidAward").toInt();
                //:IF RESULT < zCURSOR_SET 
                if (RESULT < zCURSOR_SET) {
                    //:mFAProf.FinAidAward.OriginalAmountOffered = mFAProf.FinAidAward.Amount
                    SetAttributeFromAttribute(mFAProf, "FinAidAward", "OriginalAmountOffered", mFAProf,
                            "FinAidAward", "Amount");
                    //:FOR EACH mFAProf.FinAidAwardDisbursement 
                    RESULT = mFAProf.cursor("FinAidAwardDisbursement").setFirst().toInt();
                    while (RESULT > zCURSOR_UNCHANGED) {
                        //:mFAProf.FinAidAwardDisbursement.OriginalAmountExpected = mFAProf.FinAidAwardDisbursement.AmountExpected
                        SetAttributeFromAttribute(mFAProf, "FinAidAwardDisbursement", "OriginalAmountExpected",
                                mFAProf, "FinAidAwardDisbursement", "AmountExpected");
                        RESULT = mFAProf.cursor("FinAidAwardDisbursement").setNextContinue().toInt();
                        ;
                    }

                    //:END
                }

                RESULT = mFAProf.cursor("FinAidAward").setNextContinue().toInt();
                ;
                //:END
            }

            //:END

            //:// Create the Change Log entry.
            //:IF mFAProf.Student EXISTS
            lTempInteger_32 = CheckExistenceOfEntity(mFAProf, "Student");
            if (lTempInteger_32 == 0) {
                //:GenerateTransactionEntryWDesc( mFAProf, "Fin Aid Profile" )
                {
                    ZGLOBAL2_Operation m_ZGLOBAL2_Operation = new ZGLOBAL2_Operation(mFAProf);
                    m_ZGLOBAL2_Operation.GenerateTransactionEntryWDesc(mFAProf, "Fin Aid Profile");
                    // m_ZGLOBAL2_Operation = null;  // permit gc  (unnecessary)
                }
            }

            //:END

            //:// Generate the persistent TotalUnmetNeed value.
            //:mFAProf.FinAidProfile.TotalUnmetNeed = mFAProf.FinAidProfile.dTotalUnmetNeed
            SetAttributeFromAttribute(mFAProf, "FinAidProfile", "TotalUnmetNeed", mFAProf, "FinAidProfile",
                    "dTotalUnmetNeed");

            RESULT = mFAProf.cursor("FinAidProfile").setNextContinue().toInt();
            ;
        }

        //:END
        //:DropView( mFAProf )
        DropView(mFAProf);
        break;
    //:   
    //:/* end zOCE_COMMIT */
    //:OF   zOCE_DROPOI:
    case zOCE_DROPOI:
        break;
    }

    //:     /* end zOCE_DROPOI */
    //:END  /* case */
    return (0);
    // END 
}

From source file:com.quinsoft.zencas.ZGLOBAL2_Operation.java

public int CalculateTotalCostOfLivingCOA(View mFAProf, MutableDouble ReturnedCOA) {
    zVIEW mFAProf2 = new zVIEW();
    //:DECIMAL dAmount 
    double dAmount = 0.0;
    int RESULT = 0;
    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;

    //:// Costs of Liveing (Room and Board) are the same as COA costs, except that we only add up COA Items
    //:// that are flagged as Institutional Costs and Cost of Living.
    //:// Thus, the basic structure of the rule is the same as for CalculateTotalCOA.
    //:CreateViewFromView( mFAProf2, mFAProf )
    CreateViewFromView(mFAProf2, mFAProf);
    //:dAmount = 0 
    dAmount = 0;//w  w w . ja v a  2  s  .  c om

    //:IF mFAProf.FinAidProfile.COA_OptionWholeYearFlag = "Y"
    if (CompareAttributeToString(mFAProf, "FinAidProfile", "COA_OptionWholeYearFlag", "Y") == 0) {
        //:// This is Whole Year only.
        //:FOR EACH mFAProf2.FinAidCOAItemAssigned
        RESULT = SetCursorFirstEntity(mFAProf2, "FinAidCOAItemAssigned", "");
        while (RESULT > zCURSOR_UNCHANGED) {
            //:IF mFAProf2.FinAidCOAItem.InstitutionalCostFlag = "Y" AND 
            //:   mFAProf2.FinAidCOAItem.COAItemType = "COL"
            if (CompareAttributeToString(mFAProf2, "FinAidCOAItem", "InstitutionalCostFlag", "Y") == 0
                    && CompareAttributeToString(mFAProf2, "FinAidCOAItem", "COAItemType", "COL") == 0) {

                //:IF mFAProf2.FinAidCOAItemAssigned.RevenueAmount != ""
                if (CompareAttributeToString(mFAProf2, "FinAidCOAItemAssigned", "RevenueAmount", "") != 0) {
                    //:dAmount = dAmount + mFAProf2.FinAidCOAItemAssigned.RevenueAmount
                    {
                        MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                        GetDecimalFromAttribute(md_dTempDecimal_0, mFAProf2, "FinAidCOAItemAssigned",
                                "RevenueAmount");
                        dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                    }
                    dAmount = dAmount + dTempDecimal_0;
                    //:ELSE
                } else {
                    //:dAmount = dAmount + mFAProf2.FinAidCOAItemAssigned.FirstTermRevenueAmount +
                    //:                    mFAProf2.FinAidCOAItemAssigned.SecondTermRevenueAmount 
                    {
                        MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1);
                        GetDecimalFromAttribute(md_dTempDecimal_1, mFAProf2, "FinAidCOAItemAssigned",
                                "FirstTermRevenueAmount");
                        dTempDecimal_1 = md_dTempDecimal_1.doubleValue();
                    }
                    {
                        MutableDouble md_dTempDecimal_2 = new MutableDouble(dTempDecimal_2);
                        GetDecimalFromAttribute(md_dTempDecimal_2, mFAProf2, "FinAidCOAItemAssigned",
                                "SecondTermRevenueAmount");
                        dTempDecimal_2 = md_dTempDecimal_2.doubleValue();
                    }
                    dAmount = dAmount + dTempDecimal_1 + dTempDecimal_2;
                }

                //:END
            }

            RESULT = SetCursorNextEntity(mFAProf2, "FinAidCOAItemAssigned", "");
            //:END
        }

        //:END
        //:ELSE
    } else {
        //:// Add other values together.
        //:FOR EACH mFAProf2.FinAidCOAItemAssigned
        RESULT = SetCursorFirstEntity(mFAProf2, "FinAidCOAItemAssigned", "");
        while (RESULT > zCURSOR_UNCHANGED) {
            //:IF mFAProf2.FinAidCOAItem.InstitutionalCostFlag = "Y" AND 
            //:   mFAProf2.FinAidCOAItem.COAItemType = "COL"
            if (CompareAttributeToString(mFAProf2, "FinAidCOAItem", "InstitutionalCostFlag", "Y") == 0
                    && CompareAttributeToString(mFAProf2, "FinAidCOAItem", "COAItemType", "COL") == 0) {

                //:// 1st Term
                //:IF mFAProf.FinAidProfile.COA_OptionFirstTermFlag = "Y"
                if (CompareAttributeToString(mFAProf, "FinAidProfile", "COA_OptionFirstTermFlag", "Y") == 0) {
                    //:IF mFAProf2.FinAidCOAItemAssigned.FirstTermRevenueAmount != ""
                    if (CompareAttributeToString(mFAProf2, "FinAidCOAItemAssigned", "FirstTermRevenueAmount",
                            "") != 0) {
                        //:// Add FirstTermRevenueAmount 
                        //:dAmount = dAmount + mFAProf2.FinAidCOAItemAssigned.FirstTermRevenueAmount 
                        {
                            MutableDouble md_dTempDecimal_3 = new MutableDouble(dTempDecimal_3);
                            GetDecimalFromAttribute(md_dTempDecimal_3, mFAProf2, "FinAidCOAItemAssigned",
                                    "FirstTermRevenueAmount");
                            dTempDecimal_3 = md_dTempDecimal_3.doubleValue();
                        }
                        dAmount = dAmount + dTempDecimal_3;
                        //:ELSE
                    } else {
                        //:// Add 50% of RevenueAmount
                        //:dAmount = dAmount + (mFAProf2.FinAidCOAItemAssigned.RevenueAmount / 2)
                        {
                            MutableDouble md_dTempDecimal_4 = new MutableDouble(dTempDecimal_4);
                            GetDecimalFromAttribute(md_dTempDecimal_4, mFAProf2, "FinAidCOAItemAssigned",
                                    "RevenueAmount");
                            dTempDecimal_4 = md_dTempDecimal_4.doubleValue();
                        }
                        dAmount = dAmount + (dTempDecimal_4 / 2);
                    }

                    //:END
                }

                //:END

                //:// 2nd Term
                //:IF mFAProf.FinAidProfile.COA_OptionSecondTermFlag = "Y"
                if (CompareAttributeToString(mFAProf, "FinAidProfile", "COA_OptionSecondTermFlag", "Y") == 0) {
                    //:IF mFAProf2.FinAidCOAItemAssigned.SecondTermRevenueAmount != ""
                    if (CompareAttributeToString(mFAProf2, "FinAidCOAItemAssigned", "SecondTermRevenueAmount",
                            "") != 0) {
                        //:// Add SecondTermRevenueAmount 
                        //:dAmount = dAmount + mFAProf2.FinAidCOAItemAssigned.SecondTermRevenueAmount 
                        {
                            MutableDouble md_dTempDecimal_5 = new MutableDouble(dTempDecimal_5);
                            GetDecimalFromAttribute(md_dTempDecimal_5, mFAProf2, "FinAidCOAItemAssigned",
                                    "SecondTermRevenueAmount");
                            dTempDecimal_5 = md_dTempDecimal_5.doubleValue();
                        }
                        dAmount = dAmount + dTempDecimal_5;
                        //:ELSE
                    } else {
                        //:// Add 50% of RevenueAmount
                        //:dAmount = dAmount + (mFAProf2.FinAidCOAItemAssigned.RevenueAmount / 2)
                        {
                            MutableDouble md_dTempDecimal_6 = new MutableDouble(dTempDecimal_6);
                            GetDecimalFromAttribute(md_dTempDecimal_6, mFAProf2, "FinAidCOAItemAssigned",
                                    "RevenueAmount");
                            dTempDecimal_6 = md_dTempDecimal_6.doubleValue();
                        }
                        dAmount = dAmount + (dTempDecimal_6 / 2);
                    }

                    //:END
                }

                //:END

                //:// 3rd Term
                //:IF mFAProf.FinAidProfile.COA_OptionThirdTermFlag = "Y"
                if (CompareAttributeToString(mFAProf, "FinAidProfile", "COA_OptionThirdTermFlag", "Y") == 0) {
                    //:// Always add ThirdTermRevenueAmount 
                    //:dAmount = dAmount + mFAProf2.FinAidCOAItemAssigned.ThirdTermRevenueAmount 
                    {
                        MutableDouble md_dTempDecimal_7 = new MutableDouble(dTempDecimal_7);
                        GetDecimalFromAttribute(md_dTempDecimal_7, mFAProf2, "FinAidCOAItemAssigned",
                                "ThirdTermRevenueAmount");
                        dTempDecimal_7 = md_dTempDecimal_7.doubleValue();
                    }
                    dAmount = dAmount + dTempDecimal_7;
                }

                //:END
            }

            RESULT = SetCursorNextEntity(mFAProf2, "FinAidCOAItemAssigned", "");
            //:END
        }

        //:   
        //:END
    }

    //:END

    //:ReturnedCOA = dAmount
    ReturnedCOA.setValue(dAmount);

    //:DropView( mFAProf2 )
    DropView(mFAProf2);
    return (0);
    // END
}

From source file:com.quinsoft.zencas.lTrnscpt_Object.java

public int olTrnscpt_ObjectConstraints(View lTrnscpt, Integer Event, Integer State) {
    zVIEW lTrnscptT = new zVIEW();
    //:VIEW lTermLST    BASED ON LOD mTerm
    zVIEW lTermLST = new zVIEW();
    //:VIEW mCollegeLST BASED ON LOD mCollege
    zVIEW mCollegeLST = new zVIEW();
    //:DECIMAL EarlierGrade
    double EarlierGrade = 0.0;
    //:DECIMAL LaterGrade
    double LaterGrade = 0.0;
    //:STRING ( 20 ) szDecimalString
    String szDecimalString = null;
    //:STRING ( 4 )  szYear
    String szYear = null;/*  ww  w  . ja va 2 s  .  co  m*/
    //:INTEGER CourseID
    int CourseID = 0;
    int RESULT = 0;
    int lTempInteger_0 = 0;
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;
    int lTempInteger_3 = 0;
    int lTempInteger_4 = 0;
    String szTempString_0 = null;
    String szTempString_1 = null;
    int lTempInteger_5 = 0;
    int lTempInteger_6 = 0;
    int lTempInteger_7 = 0;
    int lTempInteger_8 = 0;
    int lTempInteger_9 = 0;
    int lTempInteger_10 = 0;
    int lTempInteger_11 = 0;
    double dTempDecimal_0 = 0.0;
    double dTempDecimal_1 = 0.0;
    int lTempInteger_12 = 0;

    //:CASE Event
    switch (Event) {
    //:OF   zOCE_ACTIVATE:
    case zOCE_ACTIVATE:

        //:// We need to be sure that the College list exists as we need it below.
        //:GET VIEW mCollegeLST NAMED "mCollegeLST"
        RESULT = GetViewByName(mCollegeLST, "mCollegeLST", lTrnscpt, zLEVEL_TASK);
        //:IF RESULT < 0
        if (RESULT < 0) {
            //:ACTIVATE mCollegeLST Multiple
            RESULT = ActivateObjectInstance(mCollegeLST, "mCollege", lTrnscpt, 0, zMULTIPLE);
            //:NAME VIEW mCollegeLST "mCollegeLST"
            SetNameForView(mCollegeLST, "mCollegeLST", null, zLEVEL_TASK);
        }

        //:END
        //:/*
        //:IF RESULT < 0
        //:MessageSend( lTrnscpt, "", "Activate Transcript", 
        //:          "The mCollegeLST object needs to exist to process a Transcript.", 
        //:          zMSGQ_OBJECT_CONSTRAINT_ERROR, 0 )
        //:RETURN -1
        //:END
        //:*/

        //:FOR EACH lTrnscpt.Student
        RESULT = lTrnscpt.cursor("Student").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {

            //:// Order any "Completed" Registration entries by College Term, which is necessary to handle complex
            //:// "repeated" entries correctly.
            //:FOR EACH lTrnscpt.Registration WITHIN lTrnscpt.Student
            //:                 WHERE lTrnscpt.Registration.Status = "C"    // Completed
            //:                    OR lTrnscpt.Registration.Status = "F"    // Transferred
            //:                    OR lTrnscpt.Registration.Status = "X"    // L. Transferred
            //:                    OR lTrnscpt.Registration.Status = "W"    // Withdrawn
            //:                    OR lTrnscpt.Registration.Status = "T"    // Taking (Enrolled) for Midterm Grades
            RESULT = lTrnscpt.cursor("Registration").setFirst("Student").toInt();
            while (RESULT > zCURSOR_UNCHANGED) {
                if (CompareAttributeToString(lTrnscpt, "Registration", "Status", "C") == 0
                        || CompareAttributeToString(lTrnscpt, "Registration", "Status", "F") == 0
                        || CompareAttributeToString(lTrnscpt, "Registration", "Status", "X") == 0
                        || CompareAttributeToString(lTrnscpt, "Registration", "Status", "W") == 0
                        || CompareAttributeToString(lTrnscpt, "Registration", "Status", "T") == 0) {
                    //:IF lTrnscpt.RegistrationClass EXISTS
                    lTempInteger_0 = CheckExistenceOfEntity(lTrnscpt, "RegistrationClass");
                    if (lTempInteger_0 == 0) {
                        //:IF lTrnscpt.RegistrationCohort EXISTS
                        lTempInteger_1 = CheckExistenceOfEntity(lTrnscpt, "RegistrationCohort");
                        if (lTempInteger_1 == 0) {
                            //:GetStringFromAttributeByContext( szYear, lTrnscpt, "RegistrationClass", "ClassEndDate", "YYYY", 4 )
                            {
                                StringBuilder sb_szYear;
                                if (szYear == null)
                                    sb_szYear = new StringBuilder(32);
                                else
                                    sb_szYear = new StringBuilder(szYear);
                                GetStringFromAttributeByContext(sb_szYear, lTrnscpt, "RegistrationClass",
                                        "ClassEndDate", "YYYY", 4);
                                szYear = sb_szYear.toString();
                            }
                            //:lTrnscpt.Registration.wCompletedClassYear     = szYear
                            SetAttributeFromString(lTrnscpt, "Registration", "wCompletedClassYear", szYear);
                            //:lTrnscpt.Registration.wCompletedClassSemester = ""
                            SetAttributeFromString(lTrnscpt, "Registration", "wCompletedClassSemester", "");
                            //:lTrnscpt.Registration.wCohortClassEndDate     = lTrnscpt.RegistrationCohort.EndDate 
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCohortClassEndDate", lTrnscpt,
                                    "RegistrationCohort", "EndDate");
                            //:ELSE
                        } else {
                            //:lTrnscpt.Registration.wCompletedClassYear     = lTrnscpt.RegistrationCollegeYear.Year 
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCompletedClassYear", lTrnscpt,
                                    "RegistrationCollegeYear", "Year");
                            //:lTrnscpt.Registration.wCompletedClassSemester = lTrnscpt.RegistrationClassCollegeTerm.Semester
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCompletedClassSemester",
                                    lTrnscpt, "RegistrationClassCollegeTerm", "Semester");
                            //:lTrnscpt.Registration.wCohortClassEndDate     = ""
                            SetAttributeFromString(lTrnscpt, "Registration", "wCohortClassEndDate", "");
                        }

                        //:END
                        //:lTrnscpt.Registration.wSortOrder = "1"  // Regular entries are sorted before Transfer entries.
                        SetAttributeFromString(lTrnscpt, "Registration", "wSortOrder", "1");
                        //:IF lTrnscpt.CrossListedCourse EXISTS
                        lTempInteger_2 = CheckExistenceOfEntity(lTrnscpt, "CrossListedCourse");
                        if (lTempInteger_2 == 0) {
                            //:lTrnscpt.Registration.wCourseID                      = lTrnscpt.CrossListedCourse.ID
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCourseID", lTrnscpt,
                                    "CrossListedCourse", "ID");
                            //:lTrnscpt.Registration.wCourseNumber                  = lTrnscpt.CrossListedCourse.Number 
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCourseNumber", lTrnscpt,
                                    "CrossListedCourse", "Number");
                            //:lTrnscpt.Registration.wCourseTitle                   = lTrnscpt.CrossListedCourse.Title 
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCourseTitle", lTrnscpt,
                                    "CrossListedCourse", "Title");
                            //:lTrnscpt.Registration.wCourseRepeatableForCreditFlag = lTrnscpt.CrossListedCourse.RepeatableForCreditFlag 
                            SetAttributeFromAttribute(lTrnscpt, "Registration",
                                    "wCourseRepeatableForCreditFlag", lTrnscpt, "CrossListedCourse",
                                    "RepeatableForCreditFlag");
                            //:// If the CrossListedCourse college is different from the Registered college AND the override flag for grad/undergrad credit is not set,
                            //:// then set it from the CrossListedCourse college. This will make sure the course appears on the proper grad/undergrad transcript.
                            //:SET CURSOR FIRST mCollegeLST.College WHERE mCollegeLST.College.ID = lTrnscpt.CrossListedCourseCollege.ID 
                            {
                                MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3);
                                GetIntegerFromAttribute(mi_lTempInteger_3, lTrnscpt, "CrossListedCourseCollege",
                                        "ID");
                                lTempInteger_3 = mi_lTempInteger_3.intValue();
                            }
                            RESULT = mCollegeLST.cursor("College").setFirst("ID", lTempInteger_3).toInt();
                            //:IF lTrnscpt.Registration.GradUndergradOverrideFlag = "" 
                            if (CompareAttributeToString(lTrnscpt, "Registration", "GradUndergradOverrideFlag",
                                    "") == 0) {
                                //:lTrnscpt.Registration.GradUndergradOverrideFlag = mCollegeLST.College.Type 
                                SetAttributeFromAttribute(lTrnscpt, "Registration", "GradUndergradOverrideFlag",
                                        mCollegeLST, "College", "Type");
                            }

                            //:END
                            //:ELSE
                        } else {
                            //:lTrnscpt.Registration.wCourseID                      = lTrnscpt.RegistrationCourse.ID
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCourseID", lTrnscpt,
                                    "RegistrationCourse", "ID");
                            //:lTrnscpt.Registration.wCourseTitle                   = lTrnscpt.RegistrationCourse.Title 
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCourseTitle", lTrnscpt,
                                    "RegistrationCourse", "Title");
                            //:lTrnscpt.Registration.wCourseRepeatableForCreditFlag = lTrnscpt.RegistrationCourse.RepeatableForCreditFlag
                            SetAttributeFromAttribute(lTrnscpt, "Registration",
                                    "wCourseRepeatableForCreditFlag", lTrnscpt, "RegistrationCourse",
                                    "RepeatableForCreditFlag");
                            //:IF lTrnscpt.RegistrationCourseTopic EXISTS
                            lTempInteger_4 = CheckExistenceOfEntity(lTrnscpt, "RegistrationCourseTopic");
                            if (lTempInteger_4 == 0) {
                                //:lTrnscpt.Registration.wCourseNumber = lTrnscpt.RegistrationCourse.Number + lTrnscpt.RegistrationCourseTopic.Number
                                {
                                    StringBuilder sb_szTempString_0;
                                    if (szTempString_0 == null)
                                        sb_szTempString_0 = new StringBuilder(32);
                                    else
                                        sb_szTempString_0 = new StringBuilder(szTempString_0);
                                    GetStringFromAttribute(sb_szTempString_0, lTrnscpt, "RegistrationCourse",
                                            "Number");
                                    szTempString_0 = sb_szTempString_0.toString();
                                }
                                {
                                    StringBuilder sb_szTempString_1;
                                    if (szTempString_1 == null)
                                        sb_szTempString_1 = new StringBuilder(32);
                                    else
                                        sb_szTempString_1 = new StringBuilder(szTempString_1);
                                    GetStringFromAttribute(sb_szTempString_1, lTrnscpt,
                                            "RegistrationCourseTopic", "Number");
                                    szTempString_1 = sb_szTempString_1.toString();
                                }
                                {
                                    StringBuilder sb_szTempString_0;
                                    if (szTempString_0 == null)
                                        sb_szTempString_0 = new StringBuilder(32);
                                    else
                                        sb_szTempString_0 = new StringBuilder(szTempString_0);
                                    ZeidonStringConcat(sb_szTempString_0, 1, 0, szTempString_1, 1, 0, 255);
                                    szTempString_0 = sb_szTempString_0.toString();
                                }
                                SetAttributeFromString(lTrnscpt, "Registration", "wCourseNumber",
                                        szTempString_0);
                                //:ELSE
                            } else {
                                //:lTrnscpt.Registration.wCourseNumber = lTrnscpt.RegistrationCourse.Number 
                                SetAttributeFromAttribute(lTrnscpt, "Registration", "wCourseNumber", lTrnscpt,
                                        "RegistrationCourse", "Number");
                            }

                            //:END
                        }

                        //:END
                        //:IF lTrnscpt.RegistrationCourseTopic EXISTS
                        lTempInteger_5 = CheckExistenceOfEntity(lTrnscpt, "RegistrationCourseTopic");
                        if (lTempInteger_5 == 0) {
                            //:// Override the Title with the Topic, if one exists.
                            //:lTrnscpt.Registration.wCourseTitle  = lTrnscpt.RegistrationCourseTopic.Title 
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCourseTitle", lTrnscpt,
                                    "RegistrationCourseTopic", "Title");
                        }

                        //:END
                        //:ELSE
                    } else {
                        //:IF lTrnscpt.EquivalentCourse EXISTS
                        lTempInteger_6 = CheckExistenceOfEntity(lTrnscpt, "EquivalentCourse");
                        if (lTempInteger_6 == 0) {
                            //:IF lTrnscpt.TransferRecordTerm EXISTS
                            lTempInteger_7 = CheckExistenceOfEntity(lTrnscpt, "TransferRecordTerm");
                            if (lTempInteger_7 == 0) {
                                //:lTrnscpt.Registration.wCompletedClassYear     = lTrnscpt.TransferRecordYear.Year 
                                SetAttributeFromAttribute(lTrnscpt, "Registration", "wCompletedClassYear",
                                        lTrnscpt, "TransferRecordYear", "Year");
                                //:lTrnscpt.Registration.wCompletedClassSemester = lTrnscpt.TransferRecordTerm.Semester 
                                SetAttributeFromAttribute(lTrnscpt, "Registration", "wCompletedClassSemester",
                                        lTrnscpt, "TransferRecordTerm", "Semester");
                                //:ELSE
                            } else {
                                //:IF lTrnscpt.Registration.Status = "X"
                                if (CompareAttributeToString(lTrnscpt, "Registration", "Status", "X") == 0) {
                                    //:SET CURSOR FIRST lTrnscpt.LegacyTranscripRegistration WITHIN lTrnscpt.Student
                                    //:  WHERE lTrnscpt.LegacyTranscripRegistration.ID = lTrnscpt.Registration.ID 
                                    {
                                        MutableInt mi_lTempInteger_8 = new MutableInt(lTempInteger_8);
                                        GetIntegerFromAttribute(mi_lTempInteger_8, lTrnscpt, "Registration",
                                                "ID");
                                        lTempInteger_8 = mi_lTempInteger_8.intValue();
                                    }
                                    RESULT = lTrnscpt.cursor("LegacyTranscripRegistration")
                                            .setFirst("ID", lTempInteger_8, "Student").toInt();
                                    //:IF RESULT < zCURSOR_SET
                                    if (RESULT < zCURSOR_SET) {
                                        //:IssueError( lTrnscpt,0,0, "Programming Error. No match on Legacy reg." )
                                        IssueError(lTrnscpt, 0, 0,
                                                "Programming Error. No match on Legacy reg.");
                                    }

                                    //:END
                                    //:IF lTrnscpt.LegacyTranscriptTerm EXISTS
                                    lTempInteger_9 = CheckExistenceOfEntity(lTrnscpt, "LegacyTranscriptTerm");
                                    if (lTempInteger_9 == 0) {
                                        //:lTrnscpt.Registration.wCompletedClassYear     = lTrnscpt.LegacyTranscriptYear.Year 
                                        SetAttributeFromAttribute(lTrnscpt, "Registration",
                                                "wCompletedClassYear", lTrnscpt, "LegacyTranscriptYear",
                                                "Year");
                                        //:lTrnscpt.Registration.wCompletedClassSemester = lTrnscpt.LegacyTranscriptTerm.Semester 
                                        SetAttributeFromAttribute(lTrnscpt, "Registration",
                                                "wCompletedClassSemester", lTrnscpt, "LegacyTranscriptTerm",
                                                "Semester");
                                    }

                                    //:END
                                }

                                //:END
                            }

                            //:END
                            //:lTrnscpt.Registration.wCourseID                      = lTrnscpt.EquivalentCourse.ID 
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wCourseID", lTrnscpt,
                                    "EquivalentCourse", "ID");
                            //:lTrnscpt.Registration.wCourseRepeatableForCreditFlag = lTrnscpt.EquivalentCourse.RepeatableForCreditFlag 
                            SetAttributeFromAttribute(lTrnscpt, "Registration",
                                    "wCourseRepeatableForCreditFlag", lTrnscpt, "EquivalentCourse",
                                    "RepeatableForCreditFlag");
                            //:lTrnscpt.Registration.wSortOrder                     = "2"  // Transfer entries are sorted after Regular entries.
                            SetAttributeFromString(lTrnscpt, "Registration", "wSortOrder", "2");
                        }

                        //:END
                    }

                }

                RESULT = lTrnscpt.cursor("Registration").setNextContinue().toInt();
                ;
                //:END
            }

            //:END
            //:OrderEntityForView( lTrnscpt, "Registration", "wCompletedClassYear A wCohortClassEndDate A wCompletedClassSemester A wSortOrder A" )
            OrderEntityForView(lTrnscpt, "Registration",
                    "wCompletedClassYear A wCohortClassEndDate A wCompletedClassSemester A wSortOrder A");

            //:// This section processes Repeated entries. Where repeated entries exist, we will mark the "repeated" entry with either an "R"
            //:// or a "V" and the "replacing" entry with a "P". The attribute used for this is wRepeatedClass and its values are
            //:// defined as follows:
            //:// R - This entry is repeated and has a repeating entry, which appears LATER in the Transcript.
            //:// V - This entry is repeated, but is considered VOID, because the repeating entry appears EARLIER in the Transcript. A VOIDed
            //://     entry has no impact on cumulative entries in the Trascript.
            //:// P - This entry repeats another entry (a repeated entry) which appears EARLIER or LATER in the Transcript.
            //:// The reason for the last two entries being different is that accumulative values are handled differently for the two cases.

            //:// The wRepeatedClass values are set based on the following logic.
            //:// 1. If a "manual repeating" specification exists, the two manually repeating attributes determine the "repeated" and "repeating" entries.
            //:// 2. Otherwise, we will search the Registration entries to look for repeated entries and determine the "repeated" and "repeating" entries
            //://    based on grade.

            //:// To handle cumulative values properly, we will have to make adjusting entries in the Repeated entries. What adjusting entries are made
            //:// depend on whether the repeated entry appears before or after the repeating entry and on the grade, as follows. 
            //:// 1. If the repeated entry appears after, the repeating entry has no impact on cumulative values and no adjusting values are created. 
            //:// 2. If the repeated entry appears before, adjustments are always made for Attempted Credits.
            //:// 3. If the repeated entry appears before and the grade has grade point values or a grade of "S" or null (for transferred entries), 
            //://    then adjustment entries are made for Earned Credits.
            //:// 4. If the repeated entry appears before and the grade is not U, S or W, then adjustment entries are made for all GPA values.

            //:// We'll only consider Registration entries that are "Completed" or transferred with an Equivalent Course, which
            //:// had the wCourseID attribute set in the loop above.
            //:FOR EACH lTrnscpt.Registration WHERE lTrnscpt.Registration.wCourseID != ""
            RESULT = lTrnscpt.cursor("Registration").setFirst().toInt();
            while (RESULT > zCURSOR_UNCHANGED) {
                if (CompareAttributeToString(lTrnscpt, "Registration", "wCourseID", "") != 0) {
                    //:IF lTrnscpt.Registration.ManuallyRepeatedRegistrationID != ""
                    if (CompareAttributeToString(lTrnscpt, "Registration", "ManuallyRepeatedRegistrationID",
                            "") != 0) {
                        //:CreateViewFromView( lTrnscptT, lTrnscpt )
                        CreateViewFromView(lTrnscptT, lTrnscpt);
                        //:SET CURSOR NEXT lTrnscptT.Registration WHERE lTrnscptT.Registration.ID = lTrnscpt.Registration.ManuallyRepeatedRegistrationID
                        {
                            MutableInt mi_lTempInteger_10 = new MutableInt(lTempInteger_10);
                            GetIntegerFromAttribute(mi_lTempInteger_10, lTrnscpt, "Registration",
                                    "ManuallyRepeatedRegistrationID");
                            lTempInteger_10 = mi_lTempInteger_10.intValue();
                        }
                        RESULT = lTrnscptT.cursor("Registration").setNext("ID", lTempInteger_10).toInt();
                        //:IF RESULT >= zCURSOR_SET
                        if (RESULT >= zCURSOR_SET) {
                            //:// The Repeated Course is LATER in the Transcript.
                            //:lTrnscptT.Registration.wRepeatedClass  = "V"     // This Class is "repeated".
                            SetAttributeFromString(lTrnscptT, "Registration", "wRepeatedClass", "V");
                            //:lTrnscpt.Registration.wRepeatedClass   = "P"     // This Class "replaces" the "repeated" Class.
                            SetAttributeFromString(lTrnscpt, "Registration", "wRepeatedClass", "P");
                            //:ELSE
                        } else {
                            //:// The Repeated Course is EARLIER in the Transcript.
                            //:SET CURSOR FIRST lTrnscptT.Registration WHERE lTrnscptT.Registration.ID = lTrnscpt.Registration.ManuallyRepeatedRegistrationID
                            {
                                MutableInt mi_lTempInteger_11 = new MutableInt(lTempInteger_11);
                                GetIntegerFromAttribute(mi_lTempInteger_11, lTrnscpt, "Registration",
                                        "ManuallyRepeatedRegistrationID");
                                lTempInteger_11 = mi_lTempInteger_11.intValue();
                            }
                            RESULT = lTrnscptT.cursor("Registration").setFirst("ID", lTempInteger_11).toInt();
                            //:lTrnscptT.Registration.wRepeatedClass  = "R"     // This Class is "repeated".
                            SetAttributeFromString(lTrnscptT, "Registration", "wRepeatedClass", "R");
                            //:lTrnscpt.Registration.wRepeatedClass   = "P"     // This Class "replaces" the "repeated" Class.
                            SetAttributeFromString(lTrnscpt, "Registration", "wRepeatedClass", "P");
                            //:// Attempted Credits
                            //:lTrnscpt.Registration.wReplacedAttemptedCredits = lTrnscptT.Registration.CreditHours 
                            SetAttributeFromAttribute(lTrnscpt, "Registration", "wReplacedAttemptedCredits",
                                    lTrnscptT, "Registration", "CreditHours");
                            //:// Earned Credits
                            //:IF lTrnscptT.Registration.OverridingGradePointValue = "" 
                            if (CompareAttributeToString(lTrnscptT, "Registration", "OverridingGradePointValue",
                                    "") == 0) {
                                //:GetStringFromAttributeByContext( szDecimalString,
                                //:                        lTrnscptT, "Registration", "FinalGrade", "DegreeTrackGradePointValue", 20 )
                                {
                                    StringBuilder sb_szDecimalString;
                                    if (szDecimalString == null)
                                        sb_szDecimalString = new StringBuilder(32);
                                    else
                                        sb_szDecimalString = new StringBuilder(szDecimalString);
                                    GetStringFromAttributeByContext(sb_szDecimalString, lTrnscptT,
                                            "Registration", "FinalGrade", "DegreeTrackGradePointValue", 20);
                                    szDecimalString = sb_szDecimalString.toString();
                                }
                                //:EarlierGrade = StrToDecimal( szDecimalString )
                                {
                                    ZGLOBAL1_Operation m_ZGLOBAL1_Operation = new ZGLOBAL1_Operation(lTrnscpt);
                                    EarlierGrade = m_ZGLOBAL1_Operation.StrToDecimal(szDecimalString);
                                    // m_ZGLOBAL1_Operation = null;  // permit gc  (unnecessary)
                                }
                                //:ELSE
                            } else {
                                //:EarlierGrade = lTrnscptT.Registration.OverridingGradePointValue 
                                {
                                    MutableDouble md_EarlierGrade = new MutableDouble(EarlierGrade);
                                    GetDecimalFromAttribute(md_EarlierGrade, lTrnscptT, "Registration",
                                            "OverridingGradePointValue");
                                    EarlierGrade = md_EarlierGrade.doubleValue();
                                }
                            }

                            //:END
                            //:IF EarlierGrade > 0 OR 
                            //:lTrnscptT.Registration.FinalGrade = "S" OR
                            //:lTrnscptT.Registration.FinalGrade = ""
                            if (EarlierGrade > 0
                                    || CompareAttributeToString(lTrnscptT, "Registration", "FinalGrade",
                                            "S") == 0
                                    || CompareAttributeToString(lTrnscptT, "Registration", "FinalGrade",
                                            "") == 0) {

                                //:// Earned Credits are only adjusted if the Repeated Class grade had grade points or the grade was "S".
                                //:lTrnscpt.Registration.wReplacedEarnedCredits = lTrnscptT.Registration.CreditHours 
                                SetAttributeFromAttribute(lTrnscpt, "Registration", "wReplacedEarnedCredits",
                                        lTrnscptT, "Registration", "CreditHours");
                            }

                            //:END
                            //:// GPA Values
                            //:// Grade of U, S or W does not impact GPA values.
                            //:IF lTrnscptT.Registration.FinalGrade != "U" AND 
                            //:lTrnscptT.Registration.FinalGrade != "S" AND 
                            //:lTrnscptT.Registration.FinalGrade != "W" AND 
                            //:lTrnscptT.Registration.FinalGrade != ""
                            if (CompareAttributeToString(lTrnscptT, "Registration", "FinalGrade", "U") != 0
                                    && CompareAttributeToString(lTrnscptT, "Registration", "FinalGrade",
                                            "S") != 0
                                    && CompareAttributeToString(lTrnscptT, "Registration", "FinalGrade",
                                            "W") != 0
                                    && CompareAttributeToString(lTrnscptT, "Registration", "FinalGrade",
                                            "") != 0) {

                                //:lTrnscpt.Registration.wReplacedGPA_DivisorCredits = lTrnscptT.Registration.CreditHours
                                SetAttributeFromAttribute(lTrnscpt, "Registration",
                                        "wReplacedGPA_DivisorCredits", lTrnscptT, "Registration",
                                        "CreditHours");
                                //:lTrnscpt.Registration.wReplacedGPA_Points = EarlierGrade * lTrnscptT.Registration.CreditHours
                                {
                                    MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                                    GetDecimalFromAttribute(md_dTempDecimal_0, lTrnscptT, "Registration",
                                            "CreditHours");
                                    dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                                }
                                dTempDecimal_1 = EarlierGrade * dTempDecimal_0;
                                SetAttributeFromDecimal(lTrnscpt, "Registration", "wReplacedGPA_Points",
                                        dTempDecimal_1);
                            }

                            //:END
                        }

                        //:END
                        //:DropView( lTrnscptT )
                        DropView(lTrnscptT);
                        //:ELSE
                    } else {
                        //:IF lTrnscpt.Registration.wCourseRepeatableForCreditFlag != "Y" AND 
                        //:lTrnscpt.Registration.wRepeatedClass = ""
                        if (CompareAttributeToString(lTrnscpt, "Registration", "wCourseRepeatableForCreditFlag",
                                "Y") != 0
                                && CompareAttributeToString(lTrnscpt, "Registration", "wRepeatedClass",
                                        "") == 0) {

                            //:// Go to look for repeating entries recursively.
                            //:ProcessRepeatRecur( lTrnscpt, lTrnscpt )
                            olTrnscpt_ProcessRepeatRecur(lTrnscpt, lTrnscpt);
                        }

                        //:END
                    }

                }

                RESULT = lTrnscpt.cursor("Registration").setNextContinue().toInt();
                ;
                //:END
            }

            //:END

            //:// Set up College Type. We're setting it from mCollegeLST so as not to have to access the College entity in Transcript.
            //:FOR EACH lTrnscpt.RegistrationCourseCollege WITHIN lTrnscpt.Student 
            RESULT = lTrnscpt.cursor("RegistrationCourseCollege").setFirst("Student").toInt();
            while (RESULT > zCURSOR_UNCHANGED) {
                //:IF lTrnscpt.Registration.GradUndergradOverrideFlag = ""
                if (CompareAttributeToString(lTrnscpt, "Registration", "GradUndergradOverrideFlag", "") == 0) {
                    //:SET CURSOR FIRST mCollegeLST.College WHERE mCollegeLST.College.ID = lTrnscpt.RegistrationCourseCollege.ID  
                    {
                        MutableInt mi_lTempInteger_12 = new MutableInt(lTempInteger_12);
                        GetIntegerFromAttribute(mi_lTempInteger_12, lTrnscpt, "RegistrationCourseCollege",
                                "ID");
                        lTempInteger_12 = mi_lTempInteger_12.intValue();
                    }
                    RESULT = mCollegeLST.cursor("College").setFirst("ID", lTempInteger_12).toInt();
                    //:lTrnscpt.Registration.wCollegeType = mCollegeLST.College.Type 
                    SetAttributeFromAttribute(lTrnscpt, "Registration", "wCollegeType", mCollegeLST, "College",
                            "Type");
                    //:ELSE
                } else {
                    //:lTrnscpt.Registration.wCollegeType = lTrnscpt.Registration.GradUndergradOverrideFlag
                    SetAttributeFromAttribute(lTrnscpt, "Registration", "wCollegeType", lTrnscpt,
                            "Registration", "GradUndergradOverrideFlag");
                }

                RESULT = lTrnscpt.cursor("RegistrationCourseCollege").setNextContinue().toInt();
                ;
                //:END
            }

            RESULT = lTrnscpt.cursor("Student").setNextContinue().toInt();
            ;
            //:END
        }

        //:// Create the derived path of Registration entries organized around College Term.
        //://BuildTranscript( lTrnscpt, "" )

        //:END

        //:SET CURSOR FIRST lTrnscpt.Student
        RESULT = lTrnscpt.cursor("Student").setFirst().toInt();
        break;

    //:  /* end zOCE_ACTIVATE */
    //:OF   zOCE_ACTIVATE_EMPTY:
    case zOCE_ACTIVATE_EMPTY:
        break;

    //:  /* end zOCE_ACTIVATE_EMPTY */
    //:OF   zOCE_COMMIT:
    case zOCE_COMMIT:
        break;

    //:// Create the Change Log entry.
    //:// We need to change the following with a special academic record.
    //:/*IF lTrnscpt.Student EXISTS
    //:GenerateTransactionEntry( lTrnscpt )
    //:END*/

    //:  /* end zOCE_COMMIT */
    //:OF   zOCE_DROPOI:
    case zOCE_DROPOI:
        break;
    }

    //:     /* end zOCE_DROPOI */
    //:END  /* case */
    return (0);
    // END
}

From source file:com.quinsoft.epamms.mSPLDef_Object.java

public int omSPLDef_GeneratePDF_Label(View mSPLDef) {
    zVIEW mSPLDefPDF = new zVIEW();
    //:STRING ( 32000 ) szWriteBuffer
    String szWriteBuffer = null;/* w  w  w.  j  a v a  2 s.c o  m*/
    //:INTEGER lFile
    int lFile = 0;
    //:INTEGER lControl
    int lControl = 0;
    //:STRING ( 50 ) szLeadingBlanks
    String szLeadingBlanks = null;
    //:STRING ( 10 ) szSize
    String szSize = null;
    //:STRING ( 10 ) szTop
    String szTop = null;
    //:STRING ( 10 ) szHeight
    String szHeight = null;
    //:STRING ( 10 ) szWidth
    String szWidth = null;
    //:STRING ( 10 ) szPageHeight
    String szPageHeight = null;
    //:STRING ( 10 ) szPageWidth
    String szPageWidth = null;
    //:STRING ( 10 ) szLeft
    String szLeft = null;
    //:STRING ( 32 ) szLastSectionType
    String szLastSectionType = null;
    //:STRING ( 32 ) szVoid
    String szVoid = null;
    //:STRING ( 2 )  szCount
    String szCount = null;
    //:STRING ( 40 ) szPanelDottedBorder
    String szPanelDottedBorder = null;
    //:STRING ( 2 )  szSequenceNumber
    String szSequenceNumber = null;
    //:STRING ( 50 ) szSectionName
    String szSectionName = null;
    //:INTEGER       lCount
    int lCount = 0;
    //:SHORT         nRC
    int nRC = 0;
    //:DECIMAL       InterPanelSpace
    double InterPanelSpace = 0.0;
    //:DECIMAL       Left
    double Left = 0.0;
    //:DECIMAL       Temp
    double Temp = 0.0;
    //:STRING ( 32 ) szLPLR_Name
    String szLPLR_Name = null;
    //:STRING ( 64 ) szSystemIniApplName
    String szSystemIniApplName = null;
    //:STRING ( 64 ) szLabelName
    String szLabelName = null;
    //:STRING ( 256 ) szXslDirectory
    String szXslDirectory = null;
    //:STRING ( 256 ) szXmlName
    String szXmlName = null;
    //:STRING ( 256 ) szXslName
    String szXslName = null;
    //:STRING ( 30 ) szDateTime
    String szDateTime = null;
    //:STRING ( 30 ) szDateTimeDisplay
    String szDateTimeDisplay = null;
    int RESULT = 0;
    String szTempString_0 = null;
    int lTempInteger_0 = 0;
    int lTempInteger_1 = 0;
    double dTempDecimal_0 = 0.0;
    double dTempDecimal_1 = 0.0;
    double dTempDecimal_2 = 0.0;
    double dTempDecimal_3 = 0.0;
    int lTempInteger_2 = 0;
    int lTempInteger_3 = 0;
    double dTempDecimal_4 = 0.0;

    //:// Generate a PDF Label from the SPLD.
    //:SysGetDateTime( szDateTime )
    {
        StringBuilder sb_szDateTime;
        if (szDateTime == null)
            sb_szDateTime = new StringBuilder(32);
        else
            sb_szDateTime = new StringBuilder(szDateTime);
        m_KZOEP1AA.SysGetDateTime(sb_szDateTime);
        szDateTime = sb_szDateTime.toString();
    }
    //:mSPLDef.SubregPhysicalLabelDef.wDateTime = szDateTime
    SetAttributeFromString(mSPLDef, "SubregPhysicalLabelDef", "wDateTime", szDateTime);

    //:// Delete any existing DisplaySection entries.
    //:FOR EACH mSPLDef.DisplaySection 
    RESULT = SetCursorFirstEntity(mSPLDef, "DisplaySection", "");
    while (RESULT > zCURSOR_UNCHANGED) {
        //:DELETE ENTITY mSPLDef.DisplaySection NONE 
        RESULT = DeleteEntity(mSPLDef, "DisplaySection", zREPOS_NONE);
        RESULT = SetCursorNextEntity(mSPLDef, "DisplaySection", "");
    }

    //:END

    //:// Open the File
    //:// SfGetApplicationForSubtask( szLPLR_Name, mSPLDef )
    //:// szSystemIniApplName = "[App." + szLPLR_Name + "]"
    //:// SysReadZeidonIni( -1, szSystemIniApplName, "WebDirectory", szXslDirectory )
    //:// SysConvertEnvironmentString( szXslDirectory, szXslDirectory )
    //:// szXslDirectory = "C:/Program Files/Apache Group/tomcat 7.0/webapps/ROOT/epamms/"

    //:SysGetEnvVar( szXslName, "CATALINA_HOME", 256 ) // borrow szXslName for a couple of lines
    {
        StringBuilder sb_szXslName;
        if (szXslName == null)
            sb_szXslName = new StringBuilder(32);
        else
            sb_szXslName = new StringBuilder(szXslName);
        m_KZOEP1AA.SysGetEnvVar(sb_szXslName, "CATALINA_HOME", 256);
        szXslName = sb_szXslName.toString();
    }
    //:// SysAppendcDirSep( szXslName )
    //:SysConvertEnvironmentString( szXslDirectory, szXslName )
    {
        StringBuilder sb_szXslDirectory;
        if (szXslDirectory == null)
            sb_szXslDirectory = new StringBuilder(32);
        else
            sb_szXslDirectory = new StringBuilder(szXslDirectory);
        m_KZOEP1AA.SysConvertEnvironmentString(sb_szXslDirectory, szXslName);
        szXslDirectory = sb_szXslDirectory.toString();
    }
    //:szXslDirectory = szXslDirectory + "/webapps/ROOT/" + mSPLDef.SubregOrganization.LoginName + "/"
    {
        StringBuilder sb_szXslDirectory;
        if (szXslDirectory == null)
            sb_szXslDirectory = new StringBuilder(32);
        else
            sb_szXslDirectory = new StringBuilder(szXslDirectory);
        ZeidonStringConcat(sb_szXslDirectory, 1, 0, "/webapps/ROOT/", 1, 0, 257);
        szXslDirectory = sb_szXslDirectory.toString();
    }
    {
        MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0);
        StringBuilder sb_szTempString_0;
        if (szTempString_0 == null)
            sb_szTempString_0 = new StringBuilder(32);
        else
            sb_szTempString_0 = new StringBuilder(szTempString_0);
        GetVariableFromAttribute(sb_szTempString_0, mi_lTempInteger_0, 'S', 129, mSPLDef, "SubregOrganization",
                "LoginName", "", 0);
        lTempInteger_0 = mi_lTempInteger_0.intValue();
        szTempString_0 = sb_szTempString_0.toString();
    }
    {
        StringBuilder sb_szXslDirectory;
        if (szXslDirectory == null)
            sb_szXslDirectory = new StringBuilder(32);
        else
            sb_szXslDirectory = new StringBuilder(szXslDirectory);
        ZeidonStringConcat(sb_szXslDirectory, 1, 0, szTempString_0, 1, 0, 257);
        szXslDirectory = sb_szXslDirectory.toString();
    }
    {
        StringBuilder sb_szXslDirectory;
        if (szXslDirectory == null)
            sb_szXslDirectory = new StringBuilder(32);
        else
            sb_szXslDirectory = new StringBuilder(szXslDirectory);
        ZeidonStringConcat(sb_szXslDirectory, 1, 0, "/", 1, 0, 257);
        szXslDirectory = sb_szXslDirectory.toString();
    }

    //:szLabelName = mSPLDef.SubregProduct.Name
    {
        MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1);
        StringBuilder sb_szLabelName;
        if (szLabelName == null)
            sb_szLabelName = new StringBuilder(32);
        else
            sb_szLabelName = new StringBuilder(szLabelName);
        GetVariableFromAttribute(sb_szLabelName, mi_lTempInteger_1, 'S', 65, mSPLDef, "SubregProduct", "Name",
                "", 0);
        lTempInteger_1 = mi_lTempInteger_1.intValue();
        szLabelName = sb_szLabelName.toString();
    }

    //:szXmlName = szXslDirectory + "xml/"
    {
        StringBuilder sb_szXmlName;
        if (szXmlName == null)
            sb_szXmlName = new StringBuilder(32);
        else
            sb_szXmlName = new StringBuilder(szXmlName);
        ZeidonStringCopy(sb_szXmlName, 1, 0, szXslDirectory, 1, 0, 257);
        szXmlName = sb_szXmlName.toString();
    }
    {
        StringBuilder sb_szXmlName;
        if (szXmlName == null)
            sb_szXmlName = new StringBuilder(32);
        else
            sb_szXmlName = new StringBuilder(szXmlName);
        ZeidonStringConcat(sb_szXmlName, 1, 0, "xml/", 1, 0, 257);
        szXmlName = sb_szXmlName.toString();
    }
    //:szXslName = szXslDirectory + "xsl/"
    {
        StringBuilder sb_szXslName;
        if (szXslName == null)
            sb_szXslName = new StringBuilder(32);
        else
            sb_szXslName = new StringBuilder(szXslName);
        ZeidonStringCopy(sb_szXslName, 1, 0, szXslDirectory, 1, 0, 257);
        szXslName = sb_szXslName.toString();
    }
    {
        StringBuilder sb_szXslName;
        if (szXslName == null)
            sb_szXslName = new StringBuilder(32);
        else
            sb_szXslName = new StringBuilder(szXslName);
        ZeidonStringConcat(sb_szXslName, 1, 0, "xsl/", 1, 0, 257);
        szXslName = sb_szXslName.toString();
    }
    //:SysValidDirOrFile( szXmlName, 1, 1, 256 )
    SysValidDirOrFile(szXmlName, 1, 1, 256);
    //:SysValidDirOrFile( szXslName, 1, 1, 256 )
    SysValidDirOrFile(szXslName, 1, 1, 256);
    //:szXmlName = szXmlName + szLabelName + ".xml"
    {
        StringBuilder sb_szXmlName;
        if (szXmlName == null)
            sb_szXmlName = new StringBuilder(32);
        else
            sb_szXmlName = new StringBuilder(szXmlName);
        ZeidonStringConcat(sb_szXmlName, 1, 0, szLabelName, 1, 0, 257);
        szXmlName = sb_szXmlName.toString();
    }
    {
        StringBuilder sb_szXmlName;
        if (szXmlName == null)
            sb_szXmlName = new StringBuilder(32);
        else
            sb_szXmlName = new StringBuilder(szXmlName);
        ZeidonStringConcat(sb_szXmlName, 1, 0, ".xml", 1, 0, 257);
        szXmlName = sb_szXmlName.toString();
    }
    //:szXslName = szXslName + szLabelName + ".xsl"
    {
        StringBuilder sb_szXslName;
        if (szXslName == null)
            sb_szXslName = new StringBuilder(32);
        else
            sb_szXslName = new StringBuilder(szXslName);
        ZeidonStringConcat(sb_szXslName, 1, 0, szLabelName, 1, 0, 257);
        szXslName = sb_szXslName.toString();
    }
    {
        StringBuilder sb_szXslName;
        if (szXslName == null)
            sb_szXslName = new StringBuilder(32);
        else
            sb_szXslName = new StringBuilder(szXslName);
        ZeidonStringConcat(sb_szXslName, 1, 0, ".xsl", 1, 0, 257);
        szXslName = sb_szXslName.toString();
    }
    //:TraceLineS( "Output Xsl Filename: ", szXslName )
    TraceLineS("Output Xsl Filename: ", szXslName);
    //:lFile = SysOpenFile( mSPLDef, szXslName, COREFILE_WRITE )
    try {
        lFile = m_KZOEP1AA.SysOpenFile(mSPLDef, szXslName, COREFILE_WRITE);
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:IF lFile < 0
    if (lFile < 0) {
        //:MessageSend( mSPLDef, "", "Generate Label",
        //:             "Error opening output file.",
        //:             zMSGQ_OBJECT_CONSTRAINT_ERROR, 0 )
        MessageSend(mSPLDef, "", "Generate Label", "Error opening output file.", zMSGQ_OBJECT_CONSTRAINT_ERROR,
                0);
        //:RETURN 2
        if (8 == 8)
            return (2);
    }

    //:END
    //:TraceLineS( "##### After open: ", szXslName )
    TraceLineS("##### After open: ", szXslName);

    //:// Put out XSL header data.
    //:szWriteBuffer = "<?xml version=@1.0@ encoding='iso-8859-1'?>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "<?xml version=@1.0@ encoding='iso-8859-1'?>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "@", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "@", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:GetStringFromAttributeByContext( szDateTimeDisplay, mSPLDef, "SubregPhysicalLabelDef", "wDateTime", "YYYY/MM/DD HH:MM:SS.S AM", 30 )
    {
        StringBuilder sb_szDateTimeDisplay;
        if (szDateTimeDisplay == null)
            sb_szDateTimeDisplay = new StringBuilder(32);
        else
            sb_szDateTimeDisplay = new StringBuilder(szDateTimeDisplay);
        GetStringFromAttributeByContext(sb_szDateTimeDisplay, mSPLDef, "SubregPhysicalLabelDef", "wDateTime",
                "YYYY/MM/DD HH:MM:SS.S AM", 30);
        szDateTimeDisplay = sb_szDateTimeDisplay.toString();
    }
    //:szWriteBuffer = "<!-- Output created by ePamms   " + szDateTimeDisplay + " -->"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "<!-- Output created by ePamms   ", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szDateTimeDisplay, 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringConcat(sb_szWriteBuffer, 1, 0, " -->", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:szWriteBuffer = "<xsl:stylesheet version=^1.0^"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "<xsl:stylesheet version=^1.0^", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   xmlns:xsl=^http://www.w3.org/1999/XSL/Transform^"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   xmlns:xsl=^http://www.w3.org/1999/XSL/Transform^", 1, 0,
                32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   xmlns:fo=^http://www.w3.org/1999/XSL/Format^"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   xmlns:fo=^http://www.w3.org/1999/XSL/Format^", 1, 0,
                32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   xmlns:fox=^http://xml.apache.org/fop/extensions^"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   xmlns:fox=^http://xml.apache.org/fop/extensions^", 1, 0,
                32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   xmlns:exslt=^http://exslt.org/common^"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   xmlns:exslt=^http://exslt.org/common^", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   xmlns:exsl=^http://exslt.org/common^"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   xmlns:exsl=^http://exslt.org/common^", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   extension-element-prefixes=^exsl^"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   extension-element-prefixes=^exsl^", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   xmlns:msxsl=^urn:schemas-microsoft-com:xslt^"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   xmlns:msxsl=^urn:schemas-microsoft-com:xslt^", 1, 0,
                32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   exclude-result-prefixes=^msxsl^>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   exclude-result-prefixes=^msxsl^>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = ""
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   <xsl:output method=^xml^ indent=^yes^/>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   <xsl:output method=^xml^ indent=^yes^/>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:// Beginning of XSL Label Definition
    //:szWriteBuffer = "   <xsl:template match=^/zOI^>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   <xsl:template match=^/zOI^>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "      <fo:root>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "      <fo:root>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "         <fo:layout-master-set>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "         <fo:layout-master-set>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:// Page
    //:Temp = mSPLDef.LLD_Page.Height + 2.0  // add 1-inch border
    {
        MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
        GetDecimalFromAttribute(md_dTempDecimal_0, mSPLDef, "LLD_Page", "Height");
        dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
    }
    Temp = dTempDecimal_0 + 2.0;
    //:szPageHeight = Temp
    {
        StringBuilder sb_szPageHeight;
        if (szPageHeight == null)
            sb_szPageHeight = new StringBuilder(32);
        else
            sb_szPageHeight = new StringBuilder(szPageHeight);
        ZeidonStringConvertFromNumber(sb_szPageHeight, 1, 0, 10, 0, Temp, "D");
        szPageHeight = sb_szPageHeight.toString();
    }
    //:Temp = mSPLDef.LLD_Page.Width + 2.0 // add 1-inch border
    {
        MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1);
        GetDecimalFromAttribute(md_dTempDecimal_1, mSPLDef, "LLD_Page", "Width");
        dTempDecimal_1 = md_dTempDecimal_1.doubleValue();
    }
    Temp = dTempDecimal_1 + 2.0;
    //:szPageWidth  = Temp
    {
        StringBuilder sb_szPageWidth;
        if (szPageWidth == null)
            sb_szPageWidth = new StringBuilder(32);
        else
            sb_szPageWidth = new StringBuilder(szPageWidth);
        ZeidonStringConvertFromNumber(sb_szPageWidth, 1, 0, 10, 0, Temp, "D");
        szPageWidth = sb_szPageWidth.toString();
    }
    //:szWriteBuffer = "            <fo:simple-page-master master-name=^p1^ page-width=^" + szPageWidth + "in^ page-height=^" + szPageHeight + "in^>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0,
                "            <fo:simple-page-master master-name=^p1^ page-width=^", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szPageWidth, 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringConcat(sb_szWriteBuffer, 1, 0, "in^ page-height=^", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szPageHeight, 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringConcat(sb_szWriteBuffer, 1, 0, "in^>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:szWriteBuffer = "               <fo:region-body region-name=^xsl-region-body^ margin=^0.2in^/>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0,
                "               <fo:region-body region-name=^xsl-region-body^ margin=^0.2in^/>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "            </fo:simple-page-master>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "            </fo:simple-page-master>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "         </fo:layout-master-set>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "         </fo:layout-master-set>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "         <fo:page-sequence master-reference=^p1^>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "         <fo:page-sequence master-reference=^p1^>", 1, 0,
                32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "            <fo:flow flow-name=^xsl-region-body^>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "            <fo:flow flow-name=^xsl-region-body^>", 1, 0,
                32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:// Generate unique XML name for each Marketing Section, which contains a sequence number suffix.
    //:lCount = 0
    lCount = 0;
    //:FOR EACH mSPLDef.SPLD_MarketingSection 
    RESULT = SetCursorFirstEntity(mSPLDef, "SPLD_MarketingSection", "");
    while (RESULT > zCURSOR_UNCHANGED) {
        //:lCount = lCount + 1
        lCount = lCount + 1;
        //:szSequenceNumber = lCount
        {
            StringBuilder sb_szSequenceNumber;
            if (szSequenceNumber == null)
                sb_szSequenceNumber = new StringBuilder(32);
            else
                sb_szSequenceNumber = new StringBuilder(szSequenceNumber);
            ZeidonStringConvertFromNumber(sb_szSequenceNumber, 1, 0, 2, lCount, (double) 0.0, "I");
            szSequenceNumber = sb_szSequenceNumber.toString();
        }
        //:szSectionName = "SPLD_MarketingSection" + szSequenceNumber
        {
            StringBuilder sb_szSectionName;
            if (szSectionName == null)
                sb_szSectionName = new StringBuilder(32);
            else
                sb_szSectionName = new StringBuilder(szSectionName);
            ZeidonStringCopy(sb_szSectionName, 1, 0, "SPLD_MarketingSection", 1, 0, 51);
            szSectionName = sb_szSectionName.toString();
        }
        {
            StringBuilder sb_szSectionName;
            if (szSectionName == null)
                sb_szSectionName = new StringBuilder(32);
            else
                sb_szSectionName = new StringBuilder(szSectionName);
            ZeidonStringConcat(sb_szSectionName, 1, 0, szSequenceNumber, 1, 0, 51);
            szSectionName = sb_szSectionName.toString();
        }
        //:mSPLDef.SPLD_MarketingSection.wXML_MarketingName = szSectionName
        SetAttributeFromString(mSPLDef, "SPLD_MarketingSection", "wXML_MarketingName", szSectionName);
        RESULT = SetCursorNextEntity(mSPLDef, "SPLD_MarketingSection", "");
    }

    //:END
    //:mSPLDef.SubregPhysicalLabelDef.wLastDisplaySuffixCount = 0
    SetAttributeFromInteger(mSPLDef, "SubregPhysicalLabelDef", "wLastDisplaySuffixCount", 0);

    //:// Generate printer location icons.
    //:FormatPrintIcons( mSPLDef, lFile, szWriteBuffer )
    omSPLDef_FormatPrintIcons(mSPLDef, lFile, szWriteBuffer);

    //:// Compute the Top Position values for each Block and SubBlock.
    //:ComputeTopPositions( mSPLDef )
    omSPLDef_ComputeTopPositions(mSPLDef);

    //:// Loop through each PANEL, creating a Panel with Block containers.
    //:lCount          = 0
    lCount = 0;
    //:Left            = 1.0
    Left = 1.0;
    //:InterPanelSpace = 0.75
    InterPanelSpace = 0.75;
    //:IF mSPLDef.SubregPhysicalLabelDef.wFormatWithDottedBorders = "Y"
    if (CompareAttributeToString(mSPLDef, "SubregPhysicalLabelDef", "wFormatWithDottedBorders", "Y") == 0) {
        //:szPanelDottedBorder = " border=^1.0pt dotted green^"
        {
            StringBuilder sb_szPanelDottedBorder;
            if (szPanelDottedBorder == null)
                sb_szPanelDottedBorder = new StringBuilder(32);
            else
                sb_szPanelDottedBorder = new StringBuilder(szPanelDottedBorder);
            ZeidonStringCopy(sb_szPanelDottedBorder, 1, 0, " border=^1.0pt dotted green^", 1, 0, 41);
            szPanelDottedBorder = sb_szPanelDottedBorder.toString();
        }
        //:ELSE
    } else {
        //:szPanelDottedBorder = ""
        {
            StringBuilder sb_szPanelDottedBorder;
            if (szPanelDottedBorder == null)
                sb_szPanelDottedBorder = new StringBuilder(32);
            else
                sb_szPanelDottedBorder = new StringBuilder(szPanelDottedBorder);
            ZeidonStringCopy(sb_szPanelDottedBorder, 1, 0, "", 1, 0, 41);
            szPanelDottedBorder = sb_szPanelDottedBorder.toString();
        }
    }

    //:END
    //:FOR EACH mSPLDef.LLD_Panel 
    RESULT = SetCursorFirstEntity(mSPLDef, "LLD_Panel", "");
    while (RESULT > zCURSOR_UNCHANGED) {

        //:lCount = lCount + 1
        lCount = lCount + 1;
        //:szCount = lCount
        {
            StringBuilder sb_szCount;
            if (szCount == null)
                sb_szCount = new StringBuilder(32);
            else
                sb_szCount = new StringBuilder(szCount);
            ZeidonStringConvertFromNumber(sb_szCount, 1, 0, 2, lCount, (double) 0.0, "I");
            szCount = sb_szCount.toString();
        }
        //:szLeft = Left
        {
            StringBuilder sb_szLeft;
            if (szLeft == null)
                sb_szLeft = new StringBuilder(32);
            else
                sb_szLeft = new StringBuilder(szLeft);
            ZeidonStringConvertFromNumber(sb_szLeft, 1, 0, 10, 0, Left, "D");
            szLeft = sb_szLeft.toString();
        }

        //:// Panel Container
        //://szTop        = "1.0"
        //:Temp = mSPLDef.LLD_Panel.Top + 1.0
        {
            MutableDouble md_dTempDecimal_2 = new MutableDouble(dTempDecimal_2);
            GetDecimalFromAttribute(md_dTempDecimal_2, mSPLDef, "LLD_Panel", "Top");
            dTempDecimal_2 = md_dTempDecimal_2.doubleValue();
        }
        Temp = dTempDecimal_2 + 1.0;
        //:szTop = Temp 
        {
            StringBuilder sb_szTop;
            if (szTop == null)
                sb_szTop = new StringBuilder(32);
            else
                sb_szTop = new StringBuilder(szTop);
            ZeidonStringConvertFromNumber(sb_szTop, 1, 0, 10, 0, Temp, "D");
            szTop = sb_szTop.toString();
        }
        //:Temp = mSPLDef.LLD_Panel.Left + 1.0
        {
            MutableDouble md_dTempDecimal_3 = new MutableDouble(dTempDecimal_3);
            GetDecimalFromAttribute(md_dTempDecimal_3, mSPLDef, "LLD_Panel", "Left");
            dTempDecimal_3 = md_dTempDecimal_3.doubleValue();
        }
        Temp = dTempDecimal_3 + 1.0;
        //:szLeft = Temp
        {
            StringBuilder sb_szLeft;
            if (szLeft == null)
                sb_szLeft = new StringBuilder(32);
            else
                sb_szLeft = new StringBuilder(szLeft);
            ZeidonStringConvertFromNumber(sb_szLeft, 1, 0, 10, 0, Temp, "D");
            szLeft = sb_szLeft.toString();
        }
        //:szHeight     = mSPLDef.LLD_Panel.Height
        {
            MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2);
            StringBuilder sb_szHeight;
            if (szHeight == null)
                sb_szHeight = new StringBuilder(32);
            else
                sb_szHeight = new StringBuilder(szHeight);
            GetVariableFromAttribute(sb_szHeight, mi_lTempInteger_2, 'S', 11, mSPLDef, "LLD_Panel", "Height",
                    "", 0);
            lTempInteger_2 = mi_lTempInteger_2.intValue();
            szHeight = sb_szHeight.toString();
        }
        //:szWidth      = mSPLDef.LLD_Panel.Width
        {
            MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3);
            StringBuilder sb_szWidth;
            if (szWidth == null)
                sb_szWidth = new StringBuilder(32);
            else
                sb_szWidth = new StringBuilder(szWidth);
            GetVariableFromAttribute(sb_szWidth, mi_lTempInteger_3, 'S', 11, mSPLDef, "LLD_Panel", "Width", "",
                    0);
            lTempInteger_3 = mi_lTempInteger_3.intValue();
            szWidth = sb_szWidth.toString();
        }
        //:szWriteBuffer = "               <fo:block-container position=^absolute^ top=^" + szTop + "in^ left=^" + szLeft + 
        //:                "in^ height=^" + szHeight + "in^ width=^" + szWidth + "in^" + szPanelDottedBorder + ">"
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0,
                    "               <fo:block-container position=^absolute^ top=^", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szTop, 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, "in^ left=^", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szLeft, 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, "in^ height=^", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szHeight, 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, "in^ width=^", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szWidth, 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, "in^", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szPanelDottedBorder, 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, ">", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }
        //:szWriteBuffer = ""
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }

        //:// Panel Number
        //:szWriteBuffer = "                  <!-- Panel Number " + szCount + " -->"
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "                  <!-- Panel Number ", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szCount, 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, " -->", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }
        //:szWriteBuffer = "                  <fo:block-container position=^absolute^ top=^-0.2in^ left=^-0.2in^>" 
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0,
                    "                  <fo:block-container position=^absolute^ top=^-0.2in^ left=^-0.2in^>", 1,
                    0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }
        //:szWriteBuffer = "                     <fo:block text-align=^left^>"
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "                     <fo:block text-align=^left^>", 1, 0,
                    32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }
        //:szWriteBuffer = "                        " + szCount
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "                        ", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringConcat(sb_szWriteBuffer, 1, 0, szCount, 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }
        //:szWriteBuffer = "                     </fo:block>"
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "                     </fo:block>", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }
        //:szWriteBuffer = "                  </fo:block-container>"
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "                  </fo:block-container>", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }
        //:szWriteBuffer = ""
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }

        //:// Process each Block within the Panel.
        //:szLeadingBlanks = "               "
        {
            StringBuilder sb_szLeadingBlanks;
            if (szLeadingBlanks == null)
                sb_szLeadingBlanks = new StringBuilder(32);
            else
                sb_szLeadingBlanks = new StringBuilder(szLeadingBlanks);
            ZeidonStringCopy(sb_szLeadingBlanks, 1, 0, "               ", 1, 0, 51);
            szLeadingBlanks = sb_szLeadingBlanks.toString();
        }
        //:CreateViewFromView( mSPLDefPDF, mSPLDef )
        CreateViewFromView(mSPLDefPDF, mSPLDef);
        //:NAME VIEW mSPLDefPDF "mSPLDefPDF"
        SetNameForView(mSPLDefPDF, "mSPLDefPDF", null, zLEVEL_TASK);
        //://NAME VIEW mSPLDef "mSPLDef"
        //:nRC = ProcessPDF_Blocks( mSPLDef, mSPLDefPDF, lFile, szLeadingBlanks, szWriteBuffer )
        nRC = omSPLDef_ProcessPDF_Blocks(mSPLDef, mSPLDefPDF, lFile, szLeadingBlanks, szWriteBuffer);
        //:DropView( mSPLDefPDF )
        DropView(mSPLDefPDF);
        //:IF nRC = 2
        if (nRC == 2) {
            //:RETURN 2
            if (8 == 8)
                return (2);
        }

        //:END

        //:// Close Panel Container.
        //:szWriteBuffer = "               </fo:block-container>"
        {
            StringBuilder sb_szWriteBuffer;
            if (szWriteBuffer == null)
                sb_szWriteBuffer = new StringBuilder(32);
            else
                sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
            ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "               </fo:block-container>", 1, 0, 32001);
            szWriteBuffer = sb_szWriteBuffer.toString();
        }
        //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
        try {
            {
                ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
                m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
                // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
            }
            ;
        } catch (Exception e) {
            throw ZeidonException.wrapException(e);
        }

        //:// Increment Left position for next Panel.
        //:Left = Left + InterPanelSpace + mSPLDef.LLD_Panel.Width
        {
            MutableDouble md_dTempDecimal_4 = new MutableDouble(dTempDecimal_4);
            GetDecimalFromAttribute(md_dTempDecimal_4, mSPLDef, "LLD_Panel", "Width");
            dTempDecimal_4 = md_dTempDecimal_4.doubleValue();
        }
        Left = Left + InterPanelSpace + dTempDecimal_4;
        RESULT = SetCursorNextEntity(mSPLDef, "LLD_Panel", "");
    }

    //:   
    //:END

    //:// Close XSL body.
    //:szWriteBuffer = "            </fo:flow>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "            </fo:flow>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "         </fo:page-sequence>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "         </fo:page-sequence>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "      </fo:root>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "      </fo:root>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   </xsl:template>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   </xsl:template>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = ""
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:// Sub Template.
    //:szWriteBuffer = "   <xsl:template match=^sub^>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   <xsl:template match=^sub^>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "      <fo:inline vertical-align=^sub^ font-size=^75%^>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "      <fo:inline vertical-align=^sub^ font-size=^75%^>", 1, 0,
                32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "         <xsl:apply-templates select=^*||text()^/>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "         <xsl:apply-templates select=^*|text()^/>", 1, 0,
                32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "      </fo:inline>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "      </fo:inline>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   </xsl:template>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   </xsl:template>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:// Bold Template.
    //:szWriteBuffer = "   <xsl:template match=^bold^>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   <xsl:template match=^bold^>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "      <fo:inline font-weight=^bold^>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "      <fo:inline font-weight=^bold^>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "         <xsl:apply-templates select=^*||text()^/>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "         <xsl:apply-templates select=^*|text()^/>", 1, 0,
                32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "      </fo:inline>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "      </fo:inline>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "   </xsl:template>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "   </xsl:template>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:// Conclude XSL.
    //:szWriteBuffer = ""
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }
    //:szWriteBuffer = "</xsl:stylesheet>"
    {
        StringBuilder sb_szWriteBuffer;
        if (szWriteBuffer == null)
            sb_szWriteBuffer = new StringBuilder(32);
        else
            sb_szWriteBuffer = new StringBuilder(szWriteBuffer);
        ZeidonStringCopy(sb_szWriteBuffer, 1, 0, "</xsl:stylesheet>", 1, 0, 32001);
        szWriteBuffer = sb_szWriteBuffer.toString();
    }
    //:WL_QC( mSPLDef, lFile, szWriteBuffer, "^", 0 )
    try {
        {
            ZGlobal1_Operation m_ZGlobal1_Operation = new ZGlobal1_Operation(mSPLDef);
            m_ZGlobal1_Operation.WL_QC(mSPLDef, lFile, szWriteBuffer, "^", 0);
            // m_ZGlobal1_Operation = null;  // permit gc  (unnecessary)
        }
        ;
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:// Close the XSL file.
    //:SysCloseFile( mSPLDef, lFile, 0 )
    try {
        m_KZOEP1AA.SysCloseFile(mSPLDef, lFile, null);
    } catch (Exception e) {
        throw ZeidonException.wrapException(e);
    }

    //:// Generate XML. We do this at the end because the process above built data (e.g.  DisplayText attributes) in the mSPLDef object instance.
    //:// szWriteBuffer = "c:\lplr\epamms\xsl\TestLabel.xml"
    //:// CommitOI_ToXML_File( mSPLDef, szWriteBuffer, 0 )
    //:TraceLineS( "Output Xml Filename: ", szXmlName )
    TraceLineS("Output Xml Filename: ", szXmlName);
    //:GenerateXML_File( mSPLDef, "SubregPhysicalLabelDef", szXmlName )
    omSPLDef_GenerateXML_File(mSPLDef, "SubregPhysicalLabelDef", szXmlName);
    return (0);
    // END
}

From source file:com.quinsoft.swauopencuas.mSARuleS_Object.java

public int omSARuleS_ApplyColumnRule(View mSARuleS) {
    zVIEW vAnyView = new zVIEW();
    //:STRING (  1024  ) szStringToCompare
    String szStringToCompare = null;
    //:DECIMAL dValueToCompare
    double dValueToCompare = 0.0;
    //:STRING (  64  ) szView
    String szView = null;//  ww w . j av a 2 s . c o 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;
    //:INTEGER nCompareResult
    int nCompareResult = 0;
    //:INTEGER nCompareResult2
    int nCompareResult2 = 0;
    //:INTEGER nRC 
    int nRC = 0;
    int lTempInteger_0 = 0;
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;
    int lTempInteger_3 = 0;
    int lTempInteger_4 = 0;
    int RESULT = 0;

    //:// get the values we are looking for 
    //:szEntity    = mSARuleS.SACalcLookupColumn.QualEntityName  
    {
        MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0);
        StringBuilder sb_szEntity;
        if (szEntity == null)
            sb_szEntity = new StringBuilder(32);
        else
            sb_szEntity = new StringBuilder(szEntity);
        GetVariableFromAttribute(sb_szEntity, mi_lTempInteger_0, 'S', 65, mSARuleS, "SACalcLookupColumn",
                "QualEntityName", "", 0);
        lTempInteger_0 = mi_lTempInteger_0.intValue();
        szEntity = sb_szEntity.toString();
    }
    //:szAttribute = mSARuleS.SACalcLookupColumn.QualAttributeName 
    {
        MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1);
        StringBuilder sb_szAttribute;
        if (szAttribute == null)
            sb_szAttribute = new StringBuilder(32);
        else
            sb_szAttribute = new StringBuilder(szAttribute);
        GetVariableFromAttribute(sb_szAttribute, mi_lTempInteger_1, 'S', 65, mSARuleS, "SACalcLookupColumn",
                "QualAttributeName", "", 0);
        lTempInteger_1 = mi_lTempInteger_1.intValue();
        szAttribute = sb_szAttribute.toString();
    }
    //:szAttrType  = mSARuleS.SACalcLookupColumn.QualAttributeType 
    {
        MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2);
        StringBuilder sb_szAttrType;
        if (szAttrType == null)
            sb_szAttrType = new StringBuilder(32);
        else
            sb_szAttrType = new StringBuilder(szAttrType);
        GetVariableFromAttribute(sb_szAttrType, mi_lTempInteger_2, 'S', 2, mSARuleS, "SACalcLookupColumn",
                "QualAttributeType", "", 0);
        lTempInteger_2 = mi_lTempInteger_2.intValue();
        szAttrType = sb_szAttrType.toString();
    }
    //:szOper      = mSARuleS.SACalcLookupColumn.QualOperator 
    {
        MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3);
        StringBuilder sb_szOper;
        if (szOper == null)
            sb_szOper = new StringBuilder(32);
        else
            sb_szOper = new StringBuilder(szOper);
        GetVariableFromAttribute(sb_szOper, mi_lTempInteger_3, 'S', 11, mSARuleS, "SACalcLookupColumn",
                "QualOperator", "", 0);
        lTempInteger_3 = mi_lTempInteger_3.intValue();
        szOper = sb_szOper.toString();
    }
    //:szView      = mSARuleS.SACalcLookupColumn.QualViewName 
    {
        MutableInt mi_lTempInteger_4 = new MutableInt(lTempInteger_4);
        StringBuilder sb_szView;
        if (szView == null)
            sb_szView = new StringBuilder(32);
        else
            sb_szView = new StringBuilder(szView);
        GetVariableFromAttribute(sb_szView, mi_lTempInteger_4, 'S', 65, mSARuleS, "SACalcLookupColumn",
                "QualViewName", "", 0);
        lTempInteger_4 = mi_lTempInteger_4.intValue();
        szView = sb_szView.toString();
    }

    //:GET VIEW vAnyView NAMED szView
    RESULT = GetViewByName(vAnyView, szView, mSARuleS, zLEVEL_TASK);

    //:// 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, "SACalcLookupColumn", "QualStringValue", szStringToCompare )
        nCompareResult = CompareAttributeToString(mSARuleS, "SACalcLookupColumn", "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, "SACalcLookupColumn", "MinAttributeForAward", dValueToCompare )
        nCompareResult = CompareAttributeToDecimal(mSARuleS, "SACalcLookupColumn", "MinAttributeForAward",
                dValueToCompare);
        //:nCompareResult2 = 
        //:   CompareAttributeToDecimal( mSARuleS, "SACalcLookupColumn", "MaxAttributeForAward", dValueToCompare )
        nCompareResult2 = CompareAttributeToDecimal(mSARuleS, "SACalcLookupColumn", "MaxAttributeForAward",
                dValueToCompare);
    }

    //:END 

    //:// -1   attribute value is less than string value 
    //://  0   attribute value is equal to string value
    //://  1   attribute value is greater than string value 
    //:nRC = CompareResults( szOper, nCompareResult, nCompareResult2 )
    nRC = omSARuleS_CompareResults(szOper, nCompareResult, nCompareResult2);
    //:IF nRC = 1 
    if (nRC == 1) {
        //:mSARuleS.SACalcLookupColumn.wQualTrue = "Y"
        SetAttributeFromString(mSARuleS, "SACalcLookupColumn", "wQualTrue", "Y");
        //:RETURN 1
        if (8 == 8)
            return (1);
    }

    //:END 
    //:IF nRC = -1   
    if (nRC == -1) {
        //:mSARuleS.SACalcLookupColumn.wQualTrue = "N"
        SetAttributeFromString(mSARuleS, "SACalcLookupColumn", "wQualTrue", "N");
        //:RETURN -1
        if (8 == 8)
            return (-1);
    }

    //:END
    return (0);
    // END
}