示例#1
0
        public List <BETache> rechercherTache(string nom, int id)
        {
            List <BETache> retour   = new List <BETache>();
            TacheDao       tacheDao = new TacheDao();

            List <BETache> list = new List <BETache>();


            try
            {
                list = tacheDao.getTaches(id);
                if (list == null)
                {
                    throw new Exception("Erreur lors de la récupération des taches.");
                }

                else
                {
                    foreach (BETache be in list)
                    {
                        if (be.Nom == nom)
                        {
                            retour.Add(be);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Une erreur est survenue lors de la récupération des taches", ex);
            }

            return(retour);
        }
示例#2
0
        public List <BETache> rechercherRetardTache(int id)
        {
            List <BETache> retour   = new List <BETache>();
            TacheDao       tacheDao = new TacheDao();

            List <BETache> list = new List <BETache>();


            try
            {
                list = tacheDao.getTaches(id);
                if (list == null)
                {
                    throw new Exception("Erreur lors de la récupération des taches.");
                }

                else
                {
                    foreach (BETache be in list)
                    {
                        if (DateTime.Compare(be.Fin, DateTime.Now) <= 0 && be.Etat.Libelle != "Terminée")
                        {
                            retour.Add(be);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Une erreur est survenue lors de la récupération des taches", ex);
            }

            return(retour);
        }
示例#3
0
        public List <BETache> trieTache(int id)
        {
            CategoryDao       catDao         = new CategoryDao();
            List <BECategory> listCategories = catDao.GetCategories(id);
            List <BETache>    retour         = new List <BETache>();
            TacheDao          tacheDao       = new TacheDao();

            List <BETache> list = new List <BETache>();

            try
            {
                list = tacheDao.getTaches(id);
                if (list == null)
                {
                    throw new Exception("Erreur lors de la récupération des taches.");
                }

                else
                {
                    bool cond = true;
                    foreach (BECategory cat in listCategories)
                    {
                        foreach (BETache be in list)
                        {
                            foreach (BECategory c in be.Categories)
                            {
                                if (c.Id == cat.Id && cond)
                                {
                                    retour.Add(be);
                                    cond = false;
                                }
                                cond = true;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Une erreur est survenue lors de la récupération des taches", ex);
            }

            return(retour);
        }
示例#4
0
        public List <BETache> VisualiserTache(int id)
        {
            TacheDao tacheDao = new TacheDao();

            List <BETache> list = new List <BETache>();


            try
            {
                list = tacheDao.getTaches(id);
                if (list == null)
                {
                    throw new Exception("Erreur lors de la récupération des taches.");
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Une erreur est survenue lors de la récupération des taches", ex);
            }

            return(list);
        }