Beispiel #1
0
        public void SubmitToCreditChecking(string appId, int customerId, bool hasConsentScoreModel,
                                           ICollection <AttachmentUploadResource> attachmentUploadResourceFiles,
                                           UserProfile userProfile)
        {
            using (var transaction = _creditCheckingRepo.BeginTransaction())
            {
                CcCreditChk creditChecking = SaveCreditCheckingForCustomer(appId, customerId,
                                                                           hasConsentScoreModel, userProfile.UserId);

                _creditCheckingRepo.Commit();

                int creditCheckingId = creditChecking.Id;

                int attachmentFileCount = AddAttachmentFiles(appId, customerId,
                                                             creditCheckingId, attachmentUploadResourceFiles, userProfile.UserId);

                _attachmentRepo.Commit();

                _creditCheckingRepo.SaveConsentReceiveStatus(creditCheckingId, userProfile.UserId);

                _creditCheckingRepo.Commit();

                transaction.Commit();
            }
        }
 public int SaveAttachment(AttachmentRequest _request)
 {
     var entity = Mapper.Map<AttachmentRequest, Attachment>(_request);
     entity.IsDeleted = false;
     entity.CreatedBy = 1;
     entity.CreatedDate = System.DateTime.Now;
     entity.Remark = "None";
     entity.ReportId = 1;
     entity.ModifiedBy = 1;
     entity.ModifiedDate = System.DateTime.Now;
     _attachmentRepository.Add(entity);
     if (_attachmentRepository.Commit())
     {
         return entity.Id;
     }
     else
     {
         return 0;
     }
 }