Exemple #1
0
 private void button_backup_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(path))
     {
         return;
     }
     try
     {
         using (StoreDbContext context = new StoreDbContext())
         {
             context.CreateBackup(path);
             try
             {
                 context.CheckIntegrity(path);
             }
             catch (Exception ex)
             {
                 ErrorLogger.Log(ex);
                 MessageBox.Show("Backup integrity violated, check log file", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         MessageBox.Show("Backup Created", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         ErrorLogger.Log(ex);
         MessageBox.Show("Backup Couldn't be created, check log file", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }