public void AddGrade(StudentGrade grade)
        {
            var grades = GetAllGrades();

            grades.Add(grade);
            Save(grades);
        }
Exemple #2
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            var newGrade = new StudentGrades.StudentGrade()
            {
                FirstName = txtFirstName.Text,
                LastName  = txtLastName.Text,
                Grade     = txtGrade.Text,
                Id        = Convert.ToInt32(txtId.Text),
                Class     = txtClass.Text
            };

            repository.AddGrade(newGrade);
            LoadGrades();
            UpdateStatusText("A new grade was added");
        }