/// <summary>
/// Clears the stats database of all data
/// </summary>
private void ClearStatsBtn_Click(object sender, EventArgs e)
{
if (MessageBox.Show(
"Are you sure you want to clear the stats database? This will ERASE ALL stats data, and cannot be recovered!",
"Confirm",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Warning) == DialogResult.OK)
{
try
{
using (StatsDatabase Database = new StatsDatabase())
{
Database.Truncate();
}
Notify.Show("Database Successfully Cleared!", "All stats have successfully been cleared.", AlertType.Success);
}
catch (Exception E)
{
MessageBox.Show(
"An error occured while clearing the stats database!\r\n\r\nMessage: " + E.Message,
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error
);
}
}
}