public StudentDTO GetStudentByID(int studentID)
        {
            var returnedStudent = StudentContext.student_table.Find(studentID);

            if (returnedStudent == null)
            {
                return(null);
            }

            StudentDTO studentDTO = new StudentDTO();

            studentDTO.StudentAddress = returnedStudent.StudentAddress;
            studentDTO.StudentAge     = returnedStudent.StudentAge;
            studentDTO.StudentName    = returnedStudent.StudentName;
            studentDTO.StudentNIN     = returnedStudent.StudentNIN;
            studentDTO.Id             = returnedStudent.ID;

            return(studentDTO);
        }
        public StudentDTO GetStudentByNIN(string studentNIN)
        {
            var returnedStudent = StudentContext.spGetStudentByNIN(studentNIN).FirstOrDefault();

            if (returnedStudent == null)
            {
                return(null);
            }

            StudentDTO studentDTO = new StudentDTO();

            studentDTO.StudentAddress = returnedStudent.StudentAddress;
            studentDTO.StudentAge     = returnedStudent.StudentAge;
            studentDTO.StudentName    = returnedStudent.StudentName;
            studentDTO.StudentNIN     = returnedStudent.StudentNIN;
            studentDTO.Id             = returnedStudent.ID;

            return(studentDTO);
        }
 public void UpdateStudentByID(int studentID, StudentDTO updateStudentInfo)
 {
     StudentContext.spUpdateStudent(studentID, updateStudentInfo.StudentNIN,
                                    updateStudentInfo.StudentName, updateStudentInfo.StudentAddress,
                                    updateStudentInfo.StudentAge);
 }
 public void AddStudent(StudentDTO newStudentInfo)
 {
     StudentContext.spAddStudent(newStudentInfo.StudentNIN, newStudentInfo.StudentName,
                                 newStudentInfo.StudentAddress, newStudentInfo.StudentAge);
 }