public studentManager(string path) { list = studentStorage.ReadStudents(path); list = new studentList(); filename = string.Empty; }
public static void WriteStudents(string filename, studentList list) { if (filename == null) { throw new ArgumentNullException("path is not exsit"); } StreamWriter sw = new StreamWriter(filename, false); foreach (Student p in list) { sw.WriteLine(p.Id); sw.WriteLine(string.IsNullOrEmpty(p.Grade) ? "" : p.Grade); sw.WriteLine(p.Birth.ToString()); sw.WriteLine(p.Intake.ToString()); sw.WriteLine(string.IsNullOrEmpty(p.Name) ? "" : p.Name); sw.WriteLine(string.IsNullOrEmpty(p.Major) ? "" : p.Major); sw.WriteLine(string.IsNullOrEmpty(p.Interest) ? "" : p.Interest); sw.WriteLine(p.Sex.ToString()); sw.WriteLine(string.IsNullOrEmpty(p.Hostel) ? "" : p.Hostel); sw.WriteLine(string.IsNullOrEmpty(p.Picture) ? "" : p.Picture); } }
public studentManager() { list = new studentList(); filename = string.Empty; }