Skip to content

Commit

Permalink
[FIX] Somehow cosplans created before version 0.1.3 got a default dat…
Browse files Browse the repository at this point in the history
…e as 17.11.1858 when the update gets installed
  • Loading branch information
AokiMiku committed Mar 10, 2020
1 parent 90bd870 commit 6ec94ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
15 changes: 6 additions & 9 deletions ACP/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,13 @@ public void SaveCosplan(string name = "", int franchise_nr = 0, int? nummer = nu
public Cosplans GetCosplans(int? franchise_nr = null)
{
Cosplans cosplans = new Cosplans();
if (franchise_nr != null)
if (franchise_nr == null || franchise_nr == 0)
{
if (franchise_nr == 0)
{
cosplans.Where = "Nummer is not null";
}
else
{
cosplans.Where = "Franchise_Nr = " + franchise_nr;
}
cosplans.Where = "Nummer is not null";
}
else
{
cosplans.Where = "Franchise_Nr = " + franchise_nr;
}
cosplans.OrderBy = this.CosplansOrderBy.ToString().Replace("_", " ");
cosplans.Read();
Expand Down
11 changes: 11 additions & 0 deletions ACP_GUI/ApSCosplayplanner.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
updater.UpdateDatabase();

this.core = new Core();

if (!UserSettings.Settings.GetSetting("ErstelltAm_Fix").ToBoolean())
{
using (Cosplans c = this.core.GetCosplans())
{
c.Where = "ErstelltAm = '17.11.1858'";
c.ErstelltAm = DateTime.Today;
c.Save(ApS.Databases.SqlAction.Update);
}
}

this.ActualizeFanchises();
this.SetSortingIcons();
}
Expand Down

0 comments on commit 6ec94ce

Please sign in to comment.