Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
            }
        }
Exemplo n.º 4
0
        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);
        }