Rolando Puno

Rolando Puno

  • 1.5k
  • 211
  • 5.8k

How to add foreach (var detail in payment.PaymentDetails + 4)?

Jul 14 2023 12:24 PM

1. This is my Code

    foreach (var detail in payment.PaymentDetails)
                {
                    PAYMENT_DETAILS pdetail = new PAYMENT_DETAILS()
                    {
                        DETAILS_NO = detail.Order,
                        ACCOUNT_CODE = detail.AccountCode,
                        AMOUNT = detail.Payment,

                        PARTICULARS = detail.Particulars,
                        SUBACCOUNT_CODE = detail.SubAccountCode,
                        SUBACCOUNT_TYPE = detail.SubAccountType,

                        USER_ID = User.Identity.Name,
                        T1 = detail.T1,
                        T5 = detail.T5,

                        GPN_FLAG = detail.GPN_Flag,
                        LAST_UPDATE = DateTime.Now,
                        EMPLOYEE_NO = detail.EmployeeNo
                    };
                    paymentHeader.PAYMENT_DETAILS.Add(pdetail);
                }
2. i wanted to add foreach (var detail in payment.PaymentDetails + 4)
3. if possible can i add 4 count?

Plase help me


Answers (1)