tcbs之集合類與子類的示例

wisdomone1發表於2011-09-15
//deductschedsubmdtlcollection為集合類,可理解為一個表集合,有多條記錄
    DeductSchedSubmDtlCollection deductSchedSubmDtlCollection = DeductSchedSubmDtlCollection.SvrGetDeductSchedSubmDtlCollection
    (dam, this._deductSchedNbr,
     this._submNbrToCopy, new object[] { DeductSchedSubmDtlFetch.Basic });
    if ((deductSchedSubmDtlCollection != null) && (deductSchedSubmDtlCollection.Count > 0))
    {
         //DeductSchedSubmDtl為集合類的子類,可理解為一條記錄
        DeductSchedSubmDtl deductSchedSubmDtl = null;
         //採用for迴圈利用集合類為子類進行初始化提供值
        for (iCount = 0; iCount < deductSchedSubmDtlCollection.Count; iCount++)
        {
            deductSchedSubmDtl = DeductSchedSubmDtl.NewDeductSchedSubmDtl();
            deductSchedSubmDtl.DeductSchedNbr = deductSchedSubmDtlCollection[iCount].DeductSchedNbr;
            deductSchedSubmDtl.SubmNbr = new long?(this._submdNbr);
            deductSchedSubmDtl.DetailSeqNbr = deductSchedSubmDtlCollection[iCount].DetailSeqNbr;
            deductSchedSubmDtl.MemberAgreeNbr = deductSchedSubmDtlCollection[iCount].MemberAgreeNbr;
            deductSchedSubmDtl.ExtEmployeeNbr = deductSchedSubmDtlCollection[iCount].ExtEmployeeNbr;
            deductSchedSubmDtl.ExtEmployeeName = deductSchedSubmDtlCollection[iCount].ExtEmployeeName;
            deductSchedSubmDtl.ExtTaxIdNbr = deductSchedSubmDtlCollection[iCount].ExtTaxIdNbr;
            deductSchedSubmDtl.Amt = deductSchedSubmDtlCollection[iCount].Amt;
            base.Add(Guid.NewGuid().ToString(), deductSchedSubmDtl);
            deductSchedSubmDtl.SvrPersist(dam);
        }
    }

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-707530/,如需轉載,請註明出處,否則將追究法律責任。

相關文章