예제 #1
0
        /// <summary>
        /// Retourne la liste des étudiants disponibles en fonction des dates d'un job
        /// </summary>
        /// <param name="debut"></param>
        /// <param name="fin"></param>
        /// <returns></returns>
        public static List <Connectds.etudiantRow> GetPeriodeList(DateTime debut, DateTime fin)
        {
            Connectds ds = new Connectds();

            using (ConnectdsTableAdapters.etudiantTableAdapter etudiantAdpt = new ConnectdsTableAdapters.etudiantTableAdapter())
            {
                etudiantAdpt.Fill(ds.etudiant);
            }
            using (ConnectdsTableAdapters.periodeTableAdapter periodeAdpt = new ConnectdsTableAdapters.periodeTableAdapter())
            {
                periodeAdpt.Fill(ds.periode);
            }
            List <Connectds.periodeRow>  periodeList           = ds.periode.Where(p => p.debut_periode <= debut && p.fin_periode >= fin).ToList();
            List <Connectds.etudiantRow> etudiantList          = ds.etudiant.ToList();
            List <Connectds.etudiantRow> rechercheEtudiantList = new List <Connectds.etudiantRow>();

            foreach (var periode in periodeList)
            {
                foreach (var etudiant in etudiantList)
                {
                    if (periode.etudiant_id == etudiant.etudiant_id)
                    {
                        rechercheEtudiantList.Add(etudiant);
                    }
                }
            }
            return(rechercheEtudiantList);
        }
예제 #2
0
        /// <summary>
        /// Retourne la liste des périodes disponibles pour un étudiant donné
        /// </summary>
        /// <param name="etudiant_id"></param>
        /// <returns></returns>
        public static List <Connectds.periodeRow> GetPeriodeList(int etudiant_id)
        {
            Connectds.periodeDataTable periodeDT = new Connectds.periodeDataTable();

            using (ConnectdsTableAdapters.periodeTableAdapter periodeAdpt = new ConnectdsTableAdapters.periodeTableAdapter())
            {
                periodeAdpt.Fill(periodeDT);
            }
            List <Connectds.periodeRow> periodeList = periodeDT.Where(p => p.etudiant_id == etudiant_id).ToList();

            return(periodeList);
        }
예제 #3
0
        public static Connectds.periodeRow GetPeriode(int periode_id)
        {
            Connectds.periodeDataTable periodeDT = new Connectds.periodeDataTable();

            using (ConnectdsTableAdapters.periodeTableAdapter periodeAdpt = new ConnectdsTableAdapters.periodeTableAdapter())
            {
                periodeAdpt.Fill(periodeDT);
            }
            Connectds.periodeRow periodeRow = periodeDT.FindByperiode_id(periode_id);

            return(periodeRow);
        }
예제 #4
0
        public static void DeletePeriode(int periode_id)
        {
            Connectds.periodeDataTable periodeDT = new Connectds.periodeDataTable();

            using (ConnectdsTableAdapters.periodeTableAdapter periodeAdpt = new ConnectdsTableAdapters.periodeTableAdapter())
            {
                periodeAdpt.Fill(periodeDT);
                Connectds.periodeRow periodeRow = periodeDT.FindByperiode_id(periode_id);
                periodeRow.Delete();

                periodeAdpt.Update(periodeDT);
            }
        }
예제 #5
0
        /// <summary>
        /// Remplit un dataset de toutes les tables de la Base de données
        /// </summary>
        /// <returns></returns>
        public static Connectds GetDS()
        {
            Connectds ds = new Connectds();

            using (ConnectdsTableAdapters.entrepriseTableAdapter entrepriseAdpt = new ConnectdsTableAdapters.entrepriseTableAdapter())
            {
                entrepriseAdpt.Fill(ds.entreprise);
            }
            using (ConnectdsTableAdapters.etudiantTableAdapter etudiantAdpt = new ConnectdsTableAdapters.etudiantTableAdapter())
            {
                etudiantAdpt.Fill(ds.etudiant);
            }
            using (ConnectdsTableAdapters.jobTableAdapter jobAdpt = new ConnectdsTableAdapters.jobTableAdapter())
            {
                jobAdpt.Fill(ds.job);
            }
            using (ConnectdsTableAdapters.periodeTableAdapter periodeAdpt = new ConnectdsTableAdapters.periodeTableAdapter())
            {
                periodeAdpt.Fill(ds.periode);
            }

            return(ds);
        }