From e13341010b33bd72fbe49b70ee9b2f25948115f9 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Sat, 5 Aug 2017 21:39:57 -0500 Subject: [PATCH] Finish the save --- EduNetworkBuilder/PersonProfileForm.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)