Exemplo n.º 1
0
        public studentManager(string path)

        {
            list     = studentStorage.ReadStudents(path);
            list     = new studentList();
            filename = string.Empty;
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 public studentManager()
 {
     list     = new studentList();
     filename = string.Empty;
 }