Ejemplo n.º 1
0
 public override void Delete(int studentId)
 {
     if (StudentValidation.IsValidStudentId(studentId))
     {
         DataAccessProvider.ExecuteNonQuery($"DELETE Students " +
                                            $"WHERE StudentID = {studentId}");
     }
 }
Ejemplo n.º 2
0
 public override void Update(Student student)
 {
     if (StudentValidation.IsValidStudent(student) &&
         StudentValidation.IsValidStudentId(student.StudentId))
     {
         DataAccessProvider.ExecuteNonQuery($"UPDATE Students " +
                                            $"SET StudentName = \'{student.StudentName}\'," +
                                            $" StudentSurname = \'{student.StudentSurname}\', " +
                                            $" StudentAge = {student.StudentAge}, " +
                                            $" GroupID = {student.GroupId} " +
                                            $"WHERE StudentID = {student.StudentId}");
     }
 }