Exemple #1
0
        public bool GetAnotherInforOfStudentPrepareToPrint(InformationOfStudentResultPrepareForPrint input, string studentID)
        {
            bool success = Connect();

            if (!success)
            {
                return(false);
            }
            try
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    string strQuery = "SELECT Surname,Firstname,CLASS.ClassID,ConductSE01,ConductSE02,YearConduct,AverageScore " +
                                      "FROM STUDENT INNER JOIN LEARNRESULT ON STUDENT.StudentID = LEARNRESULT.StudentID  " +
                                      "INNER JOIN CLASS ON CLASS.ClassID = STUDENT.ClassID " +
                                      "WHERE STUDENT.StudentID = @studentID";
                    cmd.Parameters.AddWithValue("studentID", studentID);
                    cmd.CommandText = strQuery;
                    cmd.CommandType = CommandType.Text;
                    cmd.Connection  = connection;
                    using (SqlDataReader reader = cmd.ExecuteReader())
                        if (reader.Read())
                        {
                            input.nameOfStudent  = reader.GetString(0) + " " + reader.GetString(1);
                            input.classOfStudent = reader.GetString(2);
                            if (!reader.IsDBNull(3))
                            {
                                input.conductS1 = reader.GetString(3);
                            }
                            if (!reader.IsDBNull(4))
                            {
                                input.conductS2 = reader.GetString(4);
                            }
                            if (!reader.IsDBNull(5))
                            {
                                input.conductS3 = reader.GetString(5);
                            }
                            if (!reader.IsDBNull(6))
                            {
                                input.averageResult = reader.GetDouble(6);
                            }
                        }
                };
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(false);
            }
            finally
            {
                Disconnect();
            }
            return(true);
        }
Exemple #2
0
 public bool GetAllInfoAndResultOfStudentPrepareToPrint(InformationOfStudentResultPrepareForPrint input, string studentID)
 {
     input.scoreBoards = new DataSet();
     if (!GetDataStudentResultPrepareToPrint(input.scoreBoards, studentID))
     {
         return(false);
     }
     if (!GetAnotherInforOfStudentPrepareToPrint(input, studentID))
     {
         return(false);
     }
     return(true);
 }
Exemple #3
0
 public bool GetAllInfoAndResultOfStudentPrepareToPrint(InformationOfStudentResultPrepareForPrint input, string studentID)
 {
     return(studentDA.GetAllInfoAndResultOfStudentPrepareToPrint(input, studentID));
 }