diff --git a/PKHeX/MainWindow/MainPK4.cs b/PKHeX/MainWindow/MainPK4.cs index e48237f20..e6639102e 100644 --- a/PKHeX/MainWindow/MainPK4.cs +++ b/PKHeX/MainWindow/MainPK4.cs @@ -41,14 +41,7 @@ namespace PKHeX CB_EncounterType.SelectedValue = pk4.Gen4 ? pk4.EncounterType : 0; CB_Ball.SelectedValue = pk4.Ball; - if (pk4.MetDate.HasValue) - { - CAL_MetDate.Value = pk4.MetDate.Value; - } - else - { - CAL_MetDate.Value = new DateTime(2000, 1, 1); - } + CAL_MetDate.Value = pk4.MetDate ?? new DateTime(2000, 1, 1); if (pk4.Egg_Location != 0) { @@ -288,14 +281,7 @@ namespace PKHeX CB_EncounterType.SelectedValue = pk4.Gen4 ? pk4.EncounterType : 0; CB_Ball.SelectedValue = pk4.Ball; - if (pk4.MetDate.HasValue) - { - CAL_MetDate.Value = pk4.MetDate.Value; - } - else - { - CAL_MetDate.Value = new DateTime(2000, 1, 1); - } + CAL_MetDate.Value = pk4.MetDate ?? new DateTime(2000, 1, 1); if (pk4.Egg_Location != 0) { @@ -304,14 +290,7 @@ namespace PKHeX GB_EggConditions.Enabled = true; CB_EggLocation.SelectedValue = pk4.Egg_Location; - if (pk4.EggMetDate.HasValue) - { - CAL_EggDate.Value = pk4.EggMetDate.Value; - } - else - { - CAL_EggDate.Value = new DateTime(2000, 1, 1); - } + CAL_EggDate.Value = pk4.EggMetDate ?? new DateTime(2000, 1, 1); } else { CAL_EggDate.Value = new DateTime(2000, 01, 01); CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; } diff --git a/PKHeX/MainWindow/MainPK5.cs b/PKHeX/MainWindow/MainPK5.cs index 9b4b41c30..9ff9cbcbe 100644 --- a/PKHeX/MainWindow/MainPK5.cs +++ b/PKHeX/MainWindow/MainPK5.cs @@ -49,14 +49,7 @@ namespace PKHeX CB_EncounterType.SelectedValue = pk5.Gen4 ? pk5.EncounterType : 0; CB_Ball.SelectedValue = pk5.Ball; - if (pk5.MetDate.HasValue) - { - CAL_MetDate.Value = pk5.MetDate.Value; - } - else - { - CAL_MetDate.Value = new DateTime(2000, 1, 1); - } + CAL_MetDate.Value = pk5.MetDate ?? new DateTime(2000, 1, 1); if (pk5.Egg_Location != 0) { @@ -65,14 +58,7 @@ namespace PKHeX GB_EggConditions.Enabled = true; CB_EggLocation.SelectedValue = pk5.Egg_Location; - if (pk5.EggMetDate.HasValue) - { - CAL_EggDate.Value = pk5.EggMetDate.Value; - } - else - { - CAL_EggDate.Value = new DateTime(2000, 1, 1); - } + CAL_EggDate.Value = pk5.EggMetDate ?? new DateTime(2000, 1, 1); } else { CAL_EggDate.Value = new DateTime(2000, 01, 01); CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; } diff --git a/PKHeX/MainWindow/MainPK6.cs b/PKHeX/MainWindow/MainPK6.cs index ee9721782..1c6780bb6 100644 --- a/PKHeX/MainWindow/MainPK6.cs +++ b/PKHeX/MainWindow/MainPK6.cs @@ -56,14 +56,7 @@ namespace PKHeX CB_EncounterType.SelectedValue = pk6.Gen4 ? pk6.EncounterType : 0; CB_Ball.SelectedValue = pk6.Ball; - if (pk6.MetDate.HasValue) - { - CAL_MetDate.Value = pk6.MetDate.Value; - } - else - { - CAL_MetDate.Value = new DateTime(2000, 1, 1); - } + CAL_MetDate.Value = pk6.MetDate ?? new DateTime(2000, 1, 1); if (pk6.Egg_Location != 0) { @@ -72,14 +65,7 @@ namespace PKHeX GB_EggConditions.Enabled = true; CB_EggLocation.SelectedValue = pk6.Egg_Location; - if (pk6.EggMetDate.HasValue) - { - CAL_EggDate.Value = pk6.EggMetDate.Value; - } - else - { - CAL_EggDate.Value = new DateTime(2000, 1, 1); - } + CAL_EggDate.Value = pk6.EggMetDate ?? new DateTime(2000, 1, 1); } else { CAL_EggDate.Value = new DateTime(2000, 01, 01); CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; } diff --git a/PKHeX/MainWindow/MainPK7.cs b/PKHeX/MainWindow/MainPK7.cs index 1301b466d..3f4c0e4ee 100644 --- a/PKHeX/MainWindow/MainPK7.cs +++ b/PKHeX/MainWindow/MainPK7.cs @@ -56,14 +56,7 @@ namespace PKHeX CB_EncounterType.SelectedValue = pk7.Gen4 ? pk7.EncounterType : 0; CB_Ball.SelectedValue = pk7.Ball; - if (pk7.MetDate.HasValue) - { - CAL_MetDate.Value = pk7.MetDate.Value; - } - else - { - CAL_MetDate.Value = new DateTime(2000, 1, 1); - } + CAL_MetDate.Value = pk7.MetDate ?? new DateTime(2000, 1, 1); if (pk7.Egg_Location != 0) { @@ -72,14 +65,7 @@ namespace PKHeX GB_EggConditions.Enabled = true; CB_EggLocation.SelectedValue = pk7.Egg_Location; - if (pk7.EggMetDate.HasValue) - { - CAL_EggDate.Value = pk7.EggMetDate.Value; - } - else - { - CAL_EggDate.Value = new DateTime(2000, 1, 1); - } + CAL_EggDate.Value = pk7.EggMetDate ?? new DateTime(2000, 1, 1); } else { CAL_EggDate.Value = new DateTime(2000, 01, 01); CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; }