Ejemplo n.º 1
0
 private async Task NotifyUserSuccessfully(Document document, IncomingSignatureRequest signatureRequest)
 {
     await _emailNotificator.SendEventNotificationToUser(new EventReportModel
     {
         Subject = "Document sign",
         Body    = $"Document {document.DocumentName} with version {document.Version} was signed.",
         ToUser  = signatureRequest.UserRequester
     });
 }
Ejemplo n.º 2
0
        private async Task <PreparatorySignatureData> GetPreparatorySignatureDataAsync(IncomingSignatureRequest signatureRequest, Document document, ApplicationUser user)
        {
            var result = new PreparatorySignatureData();

            if (signatureRequest.ClonnedUsingWarrant)
            {
                var validWarrant = _signatureWarrantRepository
                                   .FindBy(x => x.ToUser == user.Email)
                                   .OrderBy(x => x.Expired)
                                   .LastOrDefault(x => x.Expired < DateTime.Now);

                if (validWarrant == null)
                {
                    await _emailNotificator.SendErrorReportToAdmin(new EventReportModel
                    {
                        Subject = "Document sign",
                        Body    = "Your all warrants were expired.",
                        ToUser  = user.Email
                    });

                    return(null);
                }

                var originalRequest = _signatureRequestRepository
                                      .FindBy(x => !x.ClonnedUsingWarrant && x.DocumentId == document.Id)
                                      .Single();

                result.UserKeys    = originalRequest.ApplicationUser.UserKeys;
                result.SignDetails = "(using signature warrant)";
            }
            else
            {
                result.UserKeys = user.UserKeys;
            }

            return(result);
        }
Ejemplo n.º 3
0
 public async Task CreateSignatureRequest(IncomingSignatureRequest signatureRequest)
 {
     await _signatureRequestRepository.Add(signatureRequest);
 }