private void modifyServerConfig(ArchiveServerConfig item = null) { this.Enabled = false; try { var frm = new ArchiveServerConfiguration(ref Client, archive, item != null, item); var result = frm .ShowDialog(this); if (result == DialogResult.OK) { if (!frm.EditMode) { var toAdd = Client.AddArchiveServerConfig(frm.Result); (gvServers.DataSource as BindingList<ArchiveServerConfig>).Add(toAdd); } gvServers.Refresh(); } } finally { this.Enabled = true; } }
public static void DeleteArchiveServerConfig(ArchiveServerConfig config) { logger.Debug("DeleteArchiveServerConfig"); try { DbProvider.DeleteArchiveServerConfig(config); } catch (Exception ex) { logger.Error(ex); Logging.WriteLogEvent(LoggingSource.BiblosDS_General, "ServerService." + MethodBase.GetCurrentMethod().Name, ex.ToString(), LoggingOperationType.BiblosDS_General, LoggingLevel.BiblosDS_Errors); throw; } }
public ArchiveServerConfiguration(ref AdministrationClient adminClient, Archive archive, bool isEditing = false, ArchiveServerConfig editConfig = null) { InitializeComponent(); client = adminClient; serverArchive = archive; EditMode = isEditing; editedConfig = editConfig ?? new ArchiveServerConfig { Archive = archive, TransitEnabled = true }; ckEnabled.Checked = editedConfig.TransitEnabled; ckEnabled_CheckedChanged(null, EventArgs.Empty); DialogResult = System.Windows.Forms.DialogResult.Cancel; }
public static bool IsArchiveRedirectable(Guid idArchive, out ArchiveServerConfig archiveServerConfig) { DocumentArchive currentArchive = DbProvider.GetArchive(idArchive); archiveServerConfig = null; if (currentArchive == null) { throw new Exceptions.Archive_Exception($"Archive {idArchive} not found"); } ArchiveServerConfig serverConfig = DbProvider.GetArchiveServerConfig(idArchive); if (serverConfig != null && serverConfig.Server.ServerRole == ServerRole.Remote) { archiveServerConfig = serverConfig; return(true); } return(false); }
public void DeleteArchiveServerConfig(ArchiveServerConfig config) { ServerService.DeleteArchiveServerConfig(config); }
public ArchiveServerConfig AddArchiveServerConfig(ArchiveServerConfig config) { return(ServerService.AddArchiveServerConfig(config)); }