Finish the save
This commit is contained in:
parent
f49705ec11
commit
e13341010b
@ -839,7 +839,6 @@ namespace EduNetworkBuilder
|
|||||||
|
|
||||||
Dictionary<string, bool> Response = NB.CheckPromptBox(HWList, "Homework to include", Properties.Resources.NBIco);
|
Dictionary<string, bool> Response = NB.CheckPromptBox(HWList, "Homework to include", Properties.Resources.NBIco);
|
||||||
if (Response == null) return; //if we canceled out
|
if (Response == null) return; //if we canceled out
|
||||||
|
|
||||||
//Add each homework to a list
|
//Add each homework to a list
|
||||||
List<SchoolworkClass> HWClassList = new List<SchoolworkClass>();
|
List<SchoolworkClass> HWClassList = new List<SchoolworkClass>();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@ -852,9 +851,9 @@ namespace EduNetworkBuilder
|
|||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
if (HWClassList.Count == 0) return; //none selected.
|
||||||
|
|
||||||
OpenFileDialog mydialog = new OpenFileDialog();
|
OpenFileDialog mydialog = new OpenFileDialog();
|
||||||
mydialog.AddExtension = true;
|
|
||||||
//If we have a user loaded, we can open homework files
|
//If we have a user loaded, we can open homework files
|
||||||
string filter = "EduNetworkBuilder Homework File (*.enbh)|*.enbh;";
|
string filter = "EduNetworkBuilder Homework File (*.enbh)|*.enbh;";
|
||||||
mydialog.Filter = filter;
|
mydialog.Filter = filter;
|
||||||
@ -862,11 +861,12 @@ namespace EduNetworkBuilder
|
|||||||
mydialog.ShowHelp = true;
|
mydialog.ShowHelp = true;
|
||||||
mydialog.CheckFileExists = true;
|
mydialog.CheckFileExists = true;
|
||||||
mydialog.CheckPathExists = true;
|
mydialog.CheckPathExists = true;
|
||||||
|
mydialog.AddExtension = true;
|
||||||
DialogResult result = mydialog.ShowDialog();
|
DialogResult result = mydialog.ShowDialog();
|
||||||
if (result == System.Windows.Forms.DialogResult.Cancel) return; //Choose a file
|
if (result == System.Windows.Forms.DialogResult.Cancel) return; //Choose a file
|
||||||
|
|
||||||
//save that list in that file
|
//save that list in that file
|
||||||
|
SchoolworkClass.Save(HWClassList, mydialog.FileName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnReadAllStudentHomework_Click(object sender, EventArgs e)
|
private void btnReadAllStudentHomework_Click(object sender, EventArgs e)
|
||||||
|
Loading…
Reference in New Issue
Block a user