Exemplo n.º 1
0
        protected void chkRestore_OnCheckedChanged(object sender, EventArgs e)
        {
            CheckBox checkbox = (CheckBox)sender;

            if (checkbox.Checked == true)
            {
                GridViewRow gridViewRow       = (GridViewRow)checkbox.Parent.Parent;
                string      fileName          = gridViewRow.Cells[5].Text;
                string      relativeDirectory = gridViewRow.Cells[3].Text;
                string      type       = gridViewRow.Cells[1].Text;
                string      container  = gridViewRow.Cells[2].Text;
                string      backupName = this.Target;

                if (relativeDirectory.Equals(" ", StringComparison.InvariantCultureIgnoreCase) == true)
                {
                    relativeDirectory = String.Empty;
                }


                if (_createBackupBeforeRestore == true)
                {
                    backupName = GetBackupNameFromPreviousAutoBackup(backupName);

                    AutoUpdateManager.CreateBackup("Auto Backup - Restoring from " + backupName);
                    _createBackupBeforeRestore = false;
                }

                AutoUpdateManager.RestoreFile(backupName, type, container, relativeDirectory, fileName);
            }

            _refreshRequired  = true;
            FilesWereRestored = true;
        }