コード例 #1
0
        public bool ExternalRefreshFile(ExternalRefreshFileInput input)
        {
            var documentInfo = _context.DocumentInfos.FirstOrDefault(a => a.ExternalID == input.ID);

            if (documentInfo == null)
            {
                return(false);
            }

            DocumentHistory documentHistory = _context.DocumentHistories.FirstOrDefault(a => a.DocumentInfoId == documentInfo.Id && a.Version == documentInfo.CurrentVersion);

            documentInfo.Key    = Guid.NewGuid().ToString();
            documentHistory.Key = documentInfo.Key;
            if (!string.IsNullOrEmpty(input.NewID))
            {
                documentInfo.ExternalID = input.NewID;
            }

            documentService.StoreDocumentFile(documentInfo, input.FilePath);
            _context.SaveChanges();

            return(true);
        }
コード例 #2
0
        public ActionResult ExternalRefreshFile(ExternalRefreshFileInput input)
        {
            fileManageService.ExternalRefreshFile(input);

            return(Json(new { Code = "OK" }));
        }