Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public void DeleteArchiveServerConfig(ArchiveServerConfig config)
 {
     ServerService.DeleteArchiveServerConfig(config);
 }
Exemplo n.º 6
0
 public ArchiveServerConfig AddArchiveServerConfig(ArchiveServerConfig config)
 {
     return(ServerService.AddArchiveServerConfig(config));
 }