public ActionResult SetArchivePreservationConfiguration(ArchivePreservationConfigurationViewModel model) { DocumentArchive archive = ArchiveService.GetArchive(model.Archive.IdArchive); archive.PreservationConfiguration = JsonConvert.SerializeObject(model.ArchiveConfiguration); ArchiveService.UpdateArchive(archive); return(RedirectToAction("ArchivePreservationConfiguration", new { id = model.Archive.IdArchive })); }
private ArchivePreservationConfigurationViewModel ArchivePreservationConfigurationModel(Guid id) { DocumentArchive archive = ArchiveService.GetArchive(id); ArchivePreservationConfigurationViewModel viewModel = new ArchivePreservationConfigurationViewModel() { Archive = archive, ArchiveConfiguration = new ArchiveConfiguration() }; if (!string.IsNullOrEmpty(archive.PreservationConfiguration)) { viewModel.ArchiveConfiguration = JsonConvert.DeserializeObject <ArchiveConfiguration>(archive.PreservationConfiguration); } if (viewModel.Archive.FiscalDocumentType == null) { viewModel.Archive.FiscalDocumentType = string.Empty; } if (viewModel.ArchiveConfiguration.PreservationLimitTaskToDocumentDate == null) { viewModel.ArchiveConfiguration.PreservationLimitTaskToDocumentDate = DateTime.Now; } return(viewModel); }
public ActionResult ArchivePreservationConfiguration(Guid id) { ArchivePreservationConfigurationViewModel viewModel = ArchivePreservationConfigurationModel(id); return(View(viewModel)); }