Ejemplo n.º 1
0
        private DocumentUserSignature CreateUsersSignatur(TbDocumentUsersSignature oldUsersSignature)
        {
            try
            {
                var userId = GetUserId(oldUsersSignature.FlUserId);
                if (userId == null || userId == 0)
                {
                    return(null);
                }

                var workflowId = GetObjectId <DocumentWorkflow>(oldUsersSignature.FlDocUId);
                if (workflowId == null || workflowId == 0)
                {
                    return(null);
                }

                var userSignature = new DocumentUserSignature
                {
                    DateCreate         = new DateTimeOffset(oldUsersSignature.FlSignDate.GetValueOrDefault(DateTime.Now)),
                    DateUpdate         = new DateTimeOffset(oldUsersSignature.FlSignDate.GetValueOrDefault(DateTime.Now)),
                    ExternalId         = oldUsersSignature.Id,
                    IsValidCertificate = true,
                    PlainData          = oldUsersSignature.FlFingerPrint,
                    SignedData         = oldUsersSignature.FlSignedData,
                    SignerCertificate  = oldUsersSignature.FlSignerCertificate,
                    Timestamp          = BitConverter.GetBytes(DateTime.Now.Ticks),
                    UserId             = userId.Value,
                    WorkflowId         = workflowId.Value
                };

                return(userSignature);
            }
            catch (Exception)
            {
                return(null);
            }
        }
 public void CreateDocumentUserSignature(DocumentUserSignature documentUserSignature)
 {
     _context.DocumentUserSignatures.Add(documentUserSignature);
     _context.SaveChanges();
 }