Ejemplo n.º 1
0
 public Document(int documentId, DocumentType documentType, string fileName, string contentType, byte[] fileData)
 {
     this.DocumentId = documentId;
     this.DocumentTypeId = documentType.GetId();
     this.FileName = fileName;
     this.ContentType = contentType;
     this.FileData = fileData;
 }
Ejemplo n.º 2
0
        private static Document GetDocument(int? documentId, DocumentType documentType, string documentFileName, string documentContentType, byte[] documentBytes)
        {
            if (documentId == null)
            {
                return null;
            }

            if (documentBytes.Length != 0)
            {
                return new Document(documentId.Value, documentType, documentFileName, documentContentType, documentBytes);
            }

            using (var documentReader = JobApplication.GetDocument(documentId.Value))
            {
                if (documentReader.Read())
                {
                    return new Document(
                        documentId.Value,
                        documentType,
                        (string)documentReader["filename"],
                        (string)documentReader["ContentType"],
                        (byte[])documentReader["ResumeData"]);
                }

                return new Document(documentId.Value, documentType, null, null, null);
            }
        }