private void btnBackup_Click(object sender, EventArgs e) { BackupAndRestoreDatabase b = new BackupAndRestoreDatabase(); bool Flag = b.BackupDatabase(); if (Flag == true) { MessageBox.Show("Database has been successfully backup", "Success Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Failed to backup database", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnRestore_Click(object sender, EventArgs e) { if (txtFilePath.Text.Trim() == "") { MessageBox.Show("Please select latest .bak file to restore.", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); btnBrowse.Focus(); } else { BackupAndRestoreDatabase b = new BackupAndRestoreDatabase(); bool Flag = b.RestoreDatabase(txtFilePath.Text.Trim()); if (Flag == true) { MessageBox.Show("Database has been successfully restored", "Success Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Failed to retored database", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }