Beispiel #1
0
        public BECategory AjouterCategory(int id, String nom, bool pardefaut)
        {
            CategoryDao categoryDao = new CategoryDao();

            //On ajoute
            BECategory category = null;

            try
            {
                category = categoryDao.AjouterCategory(id, nom, pardefaut);
                if (category == null)
                {
                    throw new Exception("La categorie est null.");
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Une erreur est survenue lors de l'ajout de la catégorie", ex);
            }

            return(category);
        }