diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs index 0588f23..c04448e 100644 --- a/EduNetworkBuilder/PersonProfileForm.cs +++ b/EduNetworkBuilder/PersonProfileForm.cs @@ -839,7 +839,6 @@ namespace EduNetworkBuilder Dictionary Response = NB.CheckPromptBox(HWList, "Homework to include", Properties.Resources.NBIco); if (Response == null) return; //if we canceled out - //Add each homework to a list List HWClassList = new List(); int index = 0; @@ -852,9 +851,9 @@ namespace EduNetworkBuilder } index++; } + if (HWClassList.Count == 0) return; //none selected. OpenFileDialog mydialog = new OpenFileDialog(); - mydialog.AddExtension = true; //If we have a user loaded, we can open homework files string filter = "EduNetworkBuilder Homework File (*.enbh)|*.enbh;"; mydialog.Filter = filter; @@ -862,11 +861,12 @@ namespace EduNetworkBuilder mydialog.ShowHelp = true; mydialog.CheckFileExists = true; mydialog.CheckPathExists = true; + mydialog.AddExtension = true; DialogResult result = mydialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.Cancel) return; //Choose a file + //save that list in that file - - + SchoolworkClass.Save(HWClassList, mydialog.FileName); } private void btnReadAllStudentHomework_Click(object sender, EventArgs e)