/* * NAME * * Class_Form::Export_One_Click - gets the selected student and sends to IO class to be exported. * * SYNOPSIS * * void Export_One_Click(object sender, EventArgs e); * * sender --> the object sending the event. * e --> the event arguments. * * DESCRIPTION * * This function gets the student data and sends it to the IO class. It also informs the user where the file will be saved. */ private void Export_One_Click(object sender, EventArgs e) { List <Student> student = new List <Student>(); //create temporary list //Get student obj via textboxes Populate_Textboxes(); Student export = Textboxes_To_Student(); Clear_TextBoxes(); student.Add(export); //Add student obj to list (only once since we are exporting one student, but this way we can reuse code) IO.Students_To_File(student); MessageBox.Show("Exports saved in HomeroomHelper directory"); }
/* * NAME * * Class_Form::Export_All_Click - sends all students to IO class to be exported. * * SYNOPSIS * * void Export_All_Click(object sender, EventArgs e); * * sender --> the object sending the event. * e --> the event arguments. * * DESCRIPTION * * This function takes all the student data and sends it to the IO class * to be exported separately. It also informs the user where the files will be saved. */ private void Export_All_Click(object sender, EventArgs e) { IO.Students_To_File(Database_Interface.Query_All_Students()); MessageBox.Show("Exports saved in HomeroomHelper directory"); }