Пример #1
0
        public ResponseDTO UpdateVLCPaymentDetail(VLCPaymentDTO vLCPaymentDTO)
        {
            ResponseDTO responseDTO = new ResponseDTO();
            var         vLCPayment  = unitOfWork.VLCPaymentDetailRepository.GetPaymentDetailByPaymentId(vLCPaymentDTO.VLCPaymentId);

            if (vLCPayment == null)
            {
                throw new PlatformModuleException("VLC Payment Details not found with VLC Payment Id");
            }

            // return AddVLCPaymentDetail(vLCPaymentDTO);

            VLCPaymentConvertor.ConvertToVLCPaymentDetailEntity(ref vLCPayment, vLCPaymentDTO, true);

            vLCPayment.DockMilkCollectionId = vLCPaymentDTO.DockMilkCollectionId;
            vLCPayment.PaymentCrAmount      = vLCPaymentDTO.PaymentCrAmount;
            vLCPayment.PaymentDrAmount      = vLCPaymentDTO.PaymentDrAmount;
            vLCPayment.ModifiedBy           = "Admin";
            vLCPayment.ModifiedDate         = DateTimeHelper.GetISTDateTime();

            unitOfWork.VLCPaymentDetailRepository.Update(vLCPayment);
            unitOfWork.SaveChanges();
            vLCPaymentDTO       = VLCPaymentConvertor.ConvertToVLCPaymentDTO(vLCPayment);
            responseDTO.Status  = true;
            responseDTO.Message = "VLC Payment Detail Updated Successfully";
            responseDTO.Data    = vLCPaymentDTO;
            return(responseDTO);
        }
Пример #2
0
        public VLCPaymentDetail AddDockCollectionPaymentDetail(VLCPaymentDTO vLCPaymentDTO, int dockCollectionId, decimal paidAmount)
        {
            VLCPaymentDetail vLCPaymentDetail = new VLCPaymentDetail();

            vLCPaymentDetail.VLCPaymentId = unitOfWork.DashboardRepository.NextNumberGenerator("VLCPaymentDetail");
            var vLC = unitOfWork.DistributionCenterRepository.GetById(vLCPaymentDTO.VLCId);

            VLCPaymentConvertor.ConvertToVLCPaymentDetailEntity(ref vLCPaymentDetail, vLCPaymentDTO, false);
            vLCPaymentDetail.DockMilkCollectionId = dockCollectionId;
            vLCPaymentDetail.IsDeleted            = false;
            vLCPaymentDetail.CreatedBy            = vLCPaymentDetail.ModifiedBy = "Admin";
            vLCPaymentDetail.CreatedDate          = vLCPaymentDetail.ModifiedDate = DateTimeHelper.GetISTDateTime();
            if (vLCPaymentDTO.PaymentDate != DateTime.MinValue)
            {
                vLCPaymentDetail.PaymentDate = DateTimeHelper.GetISTDateTime().Date;
            }
            else
            {
                vLCPaymentDetail.PaymentDate = vLCPaymentDTO.PaymentDate;
            }
            vLCPaymentDetail.PaymentCrAmount = paidAmount;
            unitOfWork.VLCPaymentDetailRepository.Add(vLCPaymentDetail);
            return(vLCPaymentDetail);
        }