internal void ClearAll()
{
try
{
Int32 Counter = 0;
List<String> Tables = new List<String>() {"tbVisitedStations",
"tbVisitedSystems",
"tbLog",
"tbCommodityData",
"tbPriceHistory",
"tbCommodityClassification",
"tbCommodityLocalization",
"tbCategoryLocalization",
"tbLevelLocalization",
"tbCommodity",
"tbCategory",
"tbStations_org",
"tbSystems_org",
"tbStations",
"tbSystems"};
sendProgressEvent(new ProgressEventArgs() { Info="clearing database...", CurrentValue=0, TotalValue=0, AddSeparator=true });
foreach (String Table in Tables)
{
Debug.Print("deleting " + Table + "...");
sendProgressEvent(new ProgressEventArgs() { Info="deleting " + Table + "...", CurrentValue=Counter + 1, TotalValue=Tables.Count, ForceRefresh=true });
Program.DBCon.Execute("delete from " + Table);
Counter++;
}
sendProgressEvent(new ProgressEventArgs() { Info="clearing database...<done>", CurrentValue=1, TotalValue=1, ForceRefresh=true });
}
catch (Exception ex)
{
throw new Exception("Error while clearing the database", ex);
}
}