示例#1
0
        public void _loadLogInfo(Log log, bool WithBackup)
        {
            ESBackupServerAdminServiceClient client = new ESBackupServerAdminServiceClient();

            if (WithBackup)
            {
                this.groupBox_Log_LogsBackup.Visibility = Visibility.Visible;
                this.groupBox_Log_LogsClient.Visibility = Visibility.Hidden;
                this.groupBox_Log_Logins.Visibility     = Visibility.Hidden;

                this.textBox_Log_LogsBackup_Client.Text         = client.GetClientByID(log.IDClient).Name;
                this.textBox_Log_LogsBackup_Backup.Text         = client.GetBackupByID((long)log.IDBackup).Name;
                this.comboBox_Log_LogsBackup_Type.SelectedIndex = log.LogType;
                this.dateTimePicker_Log_LogsBackup_Time.Value   = log.UTCTime;
                this.textBox_Log_LogsBackup_Value.Text          = this._formatLogValue(log.Value);
            }
            else
            {
                this.groupBox_Log_LogsClient.Visibility = Visibility.Visible;
                this.groupBox_Log_LogsBackup.Visibility = Visibility.Hidden;
                this.groupBox_Log_Logins.Visibility     = Visibility.Hidden;

                this.textBox_Log_LogsClient_Client.Text         = client.GetClientByID(log.IDClient).Name;
                this.comboBox_Log_LogsClient_Type.SelectedIndex = log.LogType;
                this.dateTimePicker_Log_LogsClient_Time.Value   = log.UTCTime;
                this.textBox_Log_LogsClient_Value.Text          = this._formatLogValue(log.Value);
            }

            client.Close();
        }
示例#2
0
        private void _loadBackupInfo(BackupInfo b)
        {
            this._backupTab_DisableComponents();
            if (b != null)
            {
                ESBackupServerAdminServiceClient client = new ESBackupServerAdminServiceClient();

                this.textBox_Backup_Name.Text        = b.Name;
                this.textBox_Backup_Description.Text = b.Description;

                this.textBox_Backup_Template.Text = client.GetTemplateByID(Convert.ToInt32(b.IDBackupTemplate)).Name;


                if (b.BaseBackupID != null)
                {
                    this.textBox_Backup_BaseBackup.Text = client.GetBackupByID((long)b.BaseBackupID).Name;
                }

                if (b.Compressed)
                {
                    this.radioBtn_Backup_Compress.IsChecked = true;
                }

                switch (b.BackupType)
                {
                case 0:
                    this.radioBtn_Backup_Full.IsChecked = true;
                    break;

                case 1:
                    this.radioBtn_Backup_Diff.IsChecked = true;
                    break;

                case 2:
                    this.radioBtn_Backup_Increm.IsChecked = true;
                    break;

                default:
                    break;
                }

                this.textBox_Backup_Source.Text = b.Source;
                this.textBox_Backup_Dest.Text   = b.Destination;

                if (b.UTCExpiration == null)
                {
                    this.dateTimePicker_Backup_Expire.Watermark = "Expire date is not set.";
                    this.dateTimePicker_Backup_Expire.Value     = null;
                }
                else
                {
                    this.dateTimePicker_Backup_Expire.Value = b.UTCExpiration;
                }

                this.dateTimePicker_Backup_Start.Value = b.UTCStart;

                if (b.UTCEnd == null)
                {
                    this.dateTimePicker_Backup_End.Watermark = "End time is not set.";
                }
                else
                {
                    this.dateTimePicker_Backup_End.Value = b.UTCEnd;
                }

                if (this.btn_Backup_Edit.IsEnabled == false)
                {
                    this.btn_Backup_Edit.IsEnabled = true;
                }

                client.Close();

                this.label_Backup_ExpireError.Visibility = Visibility.Hidden;
            }
            else
            {
                this._backupTab_SetDefaultValues();
            }
        }