Esempio n. 1
0
        public void UploadDocument(DocumentContractModel documentContractModel)
        {
            ValidarModel(documentContractModel);
            Document doc = new Document()
            {
                Name       = documentContractModel.Name,
                Type       = documentContractModel.Type,
                Size       = documentContractModel.Size,
                Data       = Convert.FromBase64String(documentContractModel.Data),
                Username   = documentContractModel.Username,
                UploadDate = DateTime.Now
            };

            repo.SaveDocument(doc);
        }
Esempio n. 2
0
        public ActionResult <RequestResponse> PostDocuments(Documents document)
        {
            var currentDate = DateTime.Now;

            document.CreatedOn  = currentDate;
            document.ModifiedOn = currentDate;

            var result = _documentsRepository.SaveDocument(document);

            if (result > 0)
            {
                return(new RequestResponse
                {
                    Status = "Success",
                    Remarks = "Employee Document added successfully"
                });
            }

            return(new RequestResponse
            {
                Status = "Failure",
                Remarks = "Add new record action failed"
            });
        }
Esempio n. 3
0
        public ActionResult List(Document doc)
        {
            repo.SaveDocument(doc);

            return(View("List", repo.GetDocument(doc.DocId)));
        }