Esempio n. 1
0
        public Utilisateur LogIn(string pLogin, string pPassword)
        {
            Utilisateur user = new Utilisateur();

            try
            {
                user = context.GetAll <Utilisateur>()
                       .Where(u => u.adresseMail == pLogin && u.motDePasse == pPassword)
                       .FirstOrDefault();
            }
            catch (Exception ex)
            {
                Log.WriteLog(ex);
            }

            return(user);
        }
Esempio n. 2
0
        public List <Categorie> GetAllCategories()
        {
            List <Categorie> allCategories = new List <Categorie>();

            try
            {
                allCategories = baseDA.GetAll <Categorie>().ToList();
            }
            catch (Exception ex)
            {
                HCK_TOOLS.Log.WriteLog(ex);
            }
            return(allCategories);
        }
Esempio n. 3
0
        public bool DeleteAnnounce(int pIdAnnounce)
        {
            Annonce announceToDelete = null;

            try
            {
                announceToDelete = context.GetAll <Annonce>().Where(a => a.idAnnonce == pIdAnnounce).First();
                if (announceToDelete != null)
                {
                    context.Delete <Annonce>(announceToDelete);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                HCK_TOOLS.Log.WriteLog(ex);
                return(false);
            }
        }
        public List <Voyage> FindTravelsByNumTrain(DateTime pDatetravel, int pNumTrain)
        {
            List <Voyage> result = new List <Voyage>();

            try
            {
                result = context.GetAll <Voyage>()
                         .Where(v => v.numeroTrain == pNumTrain && v.date == pDatetravel.Date).ToList();
            }
            catch (Exception)
            {
                throw;
            }

            return(result);
        }