Simplify date loading

no functional change
This commit is contained in:
Kurt 2016-11-29 21:52:21 -08:00
parent c186db2048
commit c3eec76ddc
4 changed files with 9 additions and 72 deletions

View file

@ -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; }

View file

@ -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; }

View file

@ -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; }

View file

@ -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; }