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); }
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" }); }
public ActionResult List(Document doc) { repo.SaveDocument(doc); return(View("List", repo.GetDocument(doc.DocId))); }