private void ExportToCsvFile(string filename, List <Faculty> faculties) { TextFileUtil.CreateOrEmptyFile(filename); var separator = ","; var exportStrings = new List <string>(); exportStrings.Add("FacultyId" + separator + "Name"); foreach (var faculty in faculties) { exportStrings.Add(faculty.FacultyId + separator + faculty.Name); } TextFileUtil.WriteStringList(filename, exportStrings); }
private void ExportToCsvFile(string filename, List <Student> students) { TextFileUtil.CreateOrEmptyFile(filename); var separator = ","; var exportStrings = new List <string>(); exportStrings.Add("StudentId" + separator + "Fio" + separator + "Address" + separator + "Phone" + separator + "AdmissionYear" + separator + "SpecialityId"); foreach (var student in students) { exportStrings.Add(student.StudentId + separator + student.Fio + separator + student.Address + separator + student.Phone + separator + student.AdmissionYear + separator + student.SpecialityId); } TextFileUtil.WriteStringList(filename, exportStrings); }
private void ExportToCsvFile(string filename, List <Specialty> specialities) { TextFileUtil.CreateOrEmptyFile(filename); var separator = ","; var exportStrings = new List <string>(); exportStrings.Add("SpecialtyId" + separator + "Name" + separator + "FacultyId"); foreach (var speciality in specialities) { exportStrings.Add(speciality.SpecialtyId + separator + speciality.Name + separator + speciality.FacultyId); } TextFileUtil.WriteStringList(filename, exportStrings); }
private void ExportToCsvFile(string filename, IEnumerable <ReportItem> reportItems) { TextFileUtil.CreateOrEmptyFile(filename); var separator = ","; var exportStrings = new List <string>(); exportStrings.Add("Year" + separator + "Faculty" + separator + "StudentsCount"); foreach (var reportItem in reportItems) { exportStrings.Add(reportItem.Year + separator + reportItem.Faculty + separator + reportItem.StudentsCount); } TextFileUtil.WriteStringList(filename, exportStrings); }