示例#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;
            }
        }
示例#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;
     }
 }
示例#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;
        }
示例#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);
        }
示例#5
0
 public void DeleteArchiveServerConfig(ArchiveServerConfig config)
 {
     ServerService.DeleteArchiveServerConfig(config);
 }
示例#6
0
 public ArchiveServerConfig AddArchiveServerConfig(ArchiveServerConfig config)
 {
     return(ServerService.AddArchiveServerConfig(config));
 }