From e5512b06b0e0ea4e4ee3b56e74c4a3ef3f28c2e8 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Mon, 31 Jul 2017 17:17:17 -0500 Subject: [PATCH] Minor bug with incorrect dat showing when we select a homework --- EduNetworkBuilder/PersonProfileForm.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs index 93c7bbf..c3d973c 100644 --- a/EduNetworkBuilder/PersonProfileForm.cs +++ b/EduNetworkBuilder/PersonProfileForm.cs @@ -85,6 +85,7 @@ namespace EduNetworkBuilder CurrentUser.UserSettings.AutoStartPuzzles = false; CurrentUser.UserSettings.ChosenLanguage = oldsettings.ChosenLanguage; CurrentUser.UserSettings.LanguageHasBeenChosen = true; + } else if (CurrentUser == null) { @@ -108,6 +109,8 @@ namespace EduNetworkBuilder tbHWSubmitted.LostFocus += SaveSchoolworkDataFromForm; dtpHWDue.LostFocus += SaveSchoolworkDataFromForm; + tcTabControl.SelectedIndexChanged += UpdateFormFromSchoolwork; + //Make sure we update any profile settings they change tbFullName.LostFocus += SaveUserInfoFromForm; } @@ -289,6 +292,10 @@ namespace EduNetworkBuilder ViewedSchoolwork.Name = tbHWName.Text; ViewedSchoolwork.DueDate = dtpHWDue.Value; } + private void UpdateFormFromSchoolwork(object sender, EventArgs e) + { + UpdateFormFromSchoolwork(); + } private void UpdateFormFromSchoolwork(SchoolworkClass What) { @@ -322,8 +329,8 @@ namespace EduNetworkBuilder } else { - tbHWSubmitted.Visible = false; - lblHWDue.Visible = false; + tbHWSubmitted.Visible = false; + lblHWSubmitted.Visible = false; } if (ViewedSchoolwork.DueDate < dtpHWDue.MinDate) ViewedSchoolwork.DueDate = dtpHWDue.MinDate; dtpHWDue.Value = ViewedSchoolwork.DueDate;