public bool AddPaymentDetails(List <PaymentDetail> paymentDetails, int cartId) { //add cart items foreach (var item in paymentDetails) { PaymentDetail tempPayment = new PaymentDetail() { CartDetailId = cartId, Amount = item.Amount, dtPayment = item.dtPayment, PaymentPartyId = item.PaymentPartyId, PaymentReceiverId = item.PaymentReceiverId, PartyInfo = item.PartyInfo, PaymentStatusId = item.PaymentStatusId, ReceiverInfo = item.ReceiverInfo }; var result = cartdb.AddPaymentDetails(tempPayment); if (result == false) { return(false); } } return(true); }