Пример #1
0
 public Mission(int idMission, int initCodeEntreprise, MotifFin motif, Qualification qualif, Niveau niv, Consultant consult, DateTime dateOuv, DateTime? dateFin, decimal? remu, string precis, sbyte? duree)
 {
     IdMission = idMission;
     CodeEntreprise = initCodeEntreprise;
     Motif = motif;
     QualificationDemandee = qualif;
     NiveauDemande = niv;
     Consult = consult;
     DateOuverture = dateOuv;
     DateFin = dateFin;
     RemunerationProposee = remu;
     Precisions = precis;
     Duree = duree;
 }
Пример #2
0
        // Récupération de la liste des qualifications
        public static List<Qualification> GetAllQualifications()
        {
            List<Qualification> Qualif = new List<Qualification>();

            using (SqlConnection sqlConnect = GetConnection())
            {
                using (SqlCommand sqlCde = new SqlCommand())
                {
                    sqlCde.Connection = sqlConnect;
                    string strsql = "GetAllQualifications";

                    try
                    {
                        sqlCde.CommandType = CommandType.StoredProcedure;
                        sqlCde.CommandText = strsql;
                        SqlDataReader sqlRdr = sqlCde.ExecuteReader();
                        while (sqlRdr.Read())
                        {
                            Qualification qualification = new Qualification()
                            {
                                IdQualification = sqlRdr.GetInt32(0),
                                LibelleQualification = sqlRdr.GetString(1)
                            };
                            Qualif.Add(qualification);

                        }
                        sqlRdr.Close();
                        return Qualif;

                    }
                    catch (SqlException ex)
                    {
                        throw new DaoExceptionFinApplication("Chargement des qualifications impossible, l'application va se fermer: \n" + ex.Message, ex);
                    }
                }
            }
        }
Пример #3
0
        // Récupération de la liste des missions
        public static List<Mission> GetAllMissions(int idEntre)
        {
            List<Mission> Missions = new List<Mission>();
            using (SqlConnection sqlConnect = GetConnection())
            {
                using (SqlCommand sqlCde = new SqlCommand())
                {
                    sqlCde.Connection = sqlConnect;
                    string strsql = "GetAllMissions";
                    sqlCde.CommandType = CommandType.StoredProcedure;
                    sqlCde.CommandText = strsql;
                    SqlParameter p1 = new SqlParameter("@vidEntreprise", SqlDbType.Int);
                    p1.Direction = ParameterDirection.Input;
                    p1.Value = idEntre;
                    sqlCde.Parameters.Add(p1);

                    try
                    {

                        SqlDataReader sqlRdr = sqlCde.ExecuteReader();
                        while (sqlRdr.Read())
                        {
                            int idMission = sqlRdr.GetInt32(0);
                            Entreprise ent = new Entreprise() { IdEntreprise = sqlRdr.GetInt32(1) };
                            MotifFin motif = (!sqlRdr.IsDBNull(2)) ? new MotifFin() { IdMotif = (sbyte)sqlRdr.GetByte(2) } : null;
                            Qualification qualif = new Qualification() { IdQualification = sqlRdr.GetInt32(3), LibelleQualification = sqlRdr.GetString(4) };
                            Niveau niv = (!sqlRdr.IsDBNull(5)) ? new Niveau() { IdNiveau = (sbyte)sqlRdr.GetByte(5) } : null;
                            Consultant consult = new Consultant() { IdConsultant = (sbyte)sqlRdr.GetByte(6) };
                            DateTime dateOuv = sqlRdr.GetDateTime(7);
                            DateTime? dateFin = (sqlRdr.IsDBNull(8)) ? (DateTime?)null : sqlRdr.GetDateTime(8);
                            decimal? remu = (sqlRdr.IsDBNull(9)) ? (decimal?)null : sqlRdr.GetDecimal(9);
                            string precis = (!sqlRdr.IsDBNull(10)) ? sqlRdr.GetString(10) : string.Empty;
                            sbyte? duree = (sqlRdr.IsDBNull(11)) ? (sbyte?)null : (sbyte)sqlRdr.GetByte(11);

                            Mission miss = new Mission(idMission, ent, motif, qualif, niv, consult, dateOuv, dateFin, remu, precis, duree);
                            Missions.Add(miss);

                        }
                        sqlRdr.Close();
                        return Missions;
                    }
                    catch (SqlException ex)
                    {
                        throw new DaoExceptionFinApplication("Chargement des missions impossible, l'application va se fermer: \n" + ex.Message, ex);
                    }
                }
            }
        }