Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using StudentManager.Models;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace StudentManager.Operations
- {
- class NewStudent
- {
- private StudentFileManager StudentFileManager = new StudentFileManager();
- public void AddStudent()
- {
- List<Student> student = new List<Student>();
- student = StudentFileManager.Load();
- Console.Clear();
- Console.WriteLine("Podaj imię ucznia: ");
- string FName = Console.ReadLine();
- Console.WriteLine("Podaj imię ucznia: ");
- string LName = Console.ReadLine();
- Console.WriteLine("Podaj pesel ucznia: ");
- string Pesel = Console.ReadLine();
- Console.WriteLine("Podaj wiek ucznia: ");
- string Age = Console.ReadLine();
- Student newStudent = new Student
- {
- FirstName = FName,
- LastName = LName,
- Pesel = Pesel,
- Age = Convert.ToInt32(Age)
- };
- student.Add(newStudent);
- StudentFileManager.Save(student);
- }
- }
- }
Add Comment
Please, Sign In to add comment