public CtrlSyntheseECF()
 {
     _evaluationSelectionnee = null;
     _lesSessionsECFsStag = null;
     _sessionSelectionnee = null;
     _stagiaireEncours = null;
 }
 public CtrlSaisieResultats()
 {
     _evaluationEnCours = null;
     _listeSessionECFs = null;
     _planif = null;
     _sessionECFcourant = null;
 }
Beispiel #3
0
        public static Evaluation donneNote(SessionECF pSession, Stagiaire pStag, Competence pComp)
        {
            Evaluation eval = new Evaluation(pSession.Ecf, pComp, pStag, pSession.Version, -1, pSession.Date);

            SqlConnection connexion = ConnexionSQL.CreationConnexion();
            SqlCommand cmd = new SqlCommand(SELECT_NOTE_STAG, connexion);

            cmd.Parameters.AddWithValue("@idECF", pSession.Ecf.Id);
            cmd.Parameters.AddWithValue("@version", pSession.Version);
            cmd.Parameters.AddWithValue("@date", pSession.Date);
            cmd.Parameters.AddWithValue("@idStagiaire", pStag._id);
            cmd.Parameters.AddWithValue("@idCompetence", pComp.Id);
            SqlDataReader reader = cmd.ExecuteReader();

            if (reader.Read())
            {
                eval = new Evaluation();

                eval.Id = reader.GetInt32(reader.GetOrdinal("idEvaluation"));
                eval.Ecf = pSession.Ecf;
                eval.Stagiaire = pStag;
                eval.Competence = pComp;
                eval.Note = (float)reader.GetDouble(reader.GetOrdinal("note"));
                eval.Version = reader.GetInt32(reader.GetOrdinal("version"));
                eval.Date = reader.GetDateTime(reader.GetOrdinal("date"));
            }
            connexion.Close();

            return eval;
        }
Beispiel #4
0
        public static void ajouterEvaluation(Evaluation eval)
        {
            //Récup de l'id max dans la table EVALUATIONS
            SqlConnection connexion = ConnexionSQL.CreationConnexion();
            SqlCommand cmd = new SqlCommand(SELECT_MAX, connexion);
            SqlDataReader reader = cmd.ExecuteReader();
            int idMaxEvaluation = 0;
            if (reader.Read())
            {
                if (reader[0] != DBNull.Value)
                {
                    idMaxEvaluation = reader.GetInt32(0);
                }
            }
            eval.Id = idMaxEvaluation + 1;
            connexion.Close();

            //Création de la competence
            connexion = ConnexionSQL.CreationConnexion();
            cmd = new SqlCommand(INSERT_EVALUATION, connexion);

            cmd.Parameters.AddWithValue("@idEvaluation", eval.Id);
            cmd.Parameters.AddWithValue("@idECF", eval.Ecf.Id);
            cmd.Parameters.AddWithValue("@idStagiaire", eval.Stagiaire._id);
            cmd.Parameters.AddWithValue("@idCompetence", eval.Competence.Id);
            cmd.Parameters.AddWithValue("@note", eval.Note);
            cmd.Parameters.AddWithValue("@version", eval.Version);
            cmd.Parameters.AddWithValue("@date", eval.Date);

            cmd.ExecuteReader();
            connexion.Close();
        }
 public void ajouterEvaluation(Evaluation pEval)
 {
     EvaluationsDAL.ajouterEvaluation(pEval);
 }
 public void modifierNoteEvaluation(Evaluation pEvaluation, float pNote)
 {
     EvaluationsDAL.modifierNoteEvaluation(pEvaluation, pNote);
 }
Beispiel #7
0
        public static void modifierNoteEvaluation(Evaluation pEvaluation, float pNote)
        {
            if (pEvaluation.Id != 0)
            {
                //Modification de la note
                SqlConnection connexion = ConnexionSQL.CreationConnexion();
                SqlCommand cmd = new SqlCommand(UPDATE_EVALUATION, connexion);

                cmd.Parameters.AddWithValue("@idEvaluation", pEvaluation.Id);
                cmd.Parameters.AddWithValue("@note", pNote);

                cmd.ExecuteReader();
                connexion.Close();
            }
            else
            {
                pEvaluation.Note = pNote;
                ajouterEvaluation(pEvaluation);
            }
        }
 public CtrlModifNoteECF()
 {
     _evaluation = null;
     _stagaire = null;
 }