void IPaymentService.SendPaymentToHeadCashier(BatchTransferDTO batchTransferDTO) { batchtransfer batchtransferEntity = new batchtransfer(); AutoMapper.Mapper.Map(batchTransferDTO, batchtransferEntity); using (TransactionScope transactionScope = new TransactionScope()) { base.BatchTransferRepository.Save(batchtransferEntity); foreach (PaymentTransitDTO item in batchTransferDTO.PaymentTransits) { PaymentCollectionDTO paymentCollectionDTO = GetCollectionDetailsById(item.PaymentTransit_CollectionId); paymentCollectionDTO.PC_Status = (int)Globals.CollectionStatus.SENTTOCASHIER; paymentCollectionDTO.PC_LastUpdateDate = DateTime.Now; paymentcollection paymentcollectionEntity = new paymentcollection(); AutoMapper.Mapper.Map(paymentCollectionDTO, paymentcollectionEntity); base.PaymentCollectionRepository.Update(paymentcollectionEntity); } transactionScope.Complete(); } }
private void Fixupbatchtransfer(batchtransfer previousValue) { if (previousValue != null && previousValue.paymenttransits.Contains(this)) { previousValue.paymenttransits.Remove(this); } if (batchtransfer != null) { if (!batchtransfer.paymenttransits.Contains(this)) { batchtransfer.paymenttransits.Add(this); } if (PaymentTransit_BatchId != batchtransfer.BT_ID) { PaymentTransit_BatchId = batchtransfer.BT_ID; } } }
void IPaymentService.UpdateBatchDetails(BatchTransferDTO batchTransferDTO) { using (TransactionScope transactionScope = new TransactionScope()) { batchtransfer batchTransferEntity = new batchtransfer(); AutoMapper.Mapper.Map(batchTransferDTO, batchTransferEntity); base.BatchTransferRepository.Update(batchTransferEntity); foreach (PaymentTransitDTO item in batchTransferDTO.PaymentTransits) { PaymentCollectionDTO paymentCollectionDTO = GetCollectionDetailsById(item.PaymentTransit_CollectionId); paymentCollectionDTO.PC_Status = (int)Globals.CollectionStatus.ACCEPTEDBYCASHIER; paymentCollectionDTO.PC_LastUpdateDate = DateTime.Now; ////Instrument status and Instrument Realization date to be updated ////in case payment mode is cheque if (paymentCollectionDTO.PC_PaymentMode == (int)Globals.PaymentModes.CHEQUE) { paymentCollectionDTO.PC_InstrumentStatus = (int)Globals.InstrumentStatus.PENDING; paymentCollectionDTO.PC_InstrumentRealizationDate = DateTime.Now; } else { paymentCollectionDTO.PC_InstrumentStatus = 0; } paymentcollection paymentcollectionEntity = new paymentcollection(); AutoMapper.Mapper.Map(paymentCollectionDTO, paymentcollectionEntity); base.PaymentCollectionRepository.Update(paymentcollectionEntity); } transactionScope.Complete(); } }