Exemple #1
0
        public bool del_voiture(int id)
        {
            Voiture v = new Voiture();

            v = (from user in voitures
                 where user.Id == id
                 select user).FirstOrDefault();
            db.GetTable <Voiture>().DeleteOnSubmit(v);
            db.SubmitChanges();

            return(true);
        }
Exemple #2
0
        public bool set_accepted(int id)
        {
            Resrvation r = (from user in resrvations
                            where user.Id == id
                            select user).FirstOrDefault();

            r.Etat = "confirmee";
            Voiture v = (from voi in voitures
                         where voi.Id == r.Id_v
                         select voi
                         ).FirstOrDefault();

            v.Joignable = "non";
            db.SubmitChanges();
            return(true);
        }
Exemple #3
0
        public bool terminer(int id)
        {
            Resrvation r = (from user in resrvations
                            where user.Id == id
                            select user).FirstOrDefault();

            r.Etat = "terminee";
            Voiture v = (from voi in voitures
                         where voi.Id == r.Id_v
                         select voi
                         ).FirstOrDefault();

            v.Joignable = "oui";

            db.SubmitChanges();

            return(true);
        }
Exemple #4
0
        public bool set_refused(int id)
        {
            Resrvation r = (from user in resrvations
                            where user.Id == id
                            select user).FirstOrDefault();

            db.GetTable <Resrvation>().DeleteOnSubmit(r);

            Voiture v = (from voi in voitures
                         where voi.Id == r.Id_v
                         select voi
                         ).FirstOrDefault();

            v.Joignable = "oui";

            db.SubmitChanges();
            return(true);
        }
Exemple #5
0
        public bool edit_voiture(int id, string mat, string mod, string mar, string pri, string ima, string des, string car, string pas, string vil, string opt, string edi)
        {
            Voiture v = new Voiture();

            v = (from user in voitures
                 where user.Id == id
                 select user).FirstOrDefault();

            v.Matricule   = mat;
            v.Carburant   = car;
            v.Description = des;
            v.Image       = ima;
            v.Marque      = mar;
            v.Modele      = mod;
            v.Options     = opt;
            v.Passagers   = Convert.ToInt32(pas);
            v.Prix        = Convert.ToDouble(pri);
            v.Ville       = vil;
            v.Id_Manager  = Convert.ToInt32(edi);

            db.SubmitChanges();
            return(true);
        }
Exemple #6
0
        public bool add_voiture(string mat, string mod, string mar, string pri, string ima, string des, string car, string pas, string vil, string opt, string edi)
        {
            Voiture v = new Voiture()
            {
                Id          = db.GetTable <Voiture>().Count() + 1,
                Matricule   = mat,
                Carburant   = car,
                Description = des,
                Image       = ima,
                Marque      = mar,
                Modele      = mod,
                Options     = opt,
                Passagers   = Convert.ToInt32(pas),
                Prix        = Convert.ToDouble(pri),
                Ville       = vil,
                Joignable   = "oui",
                Id_Manager  = Convert.ToInt32(edi)
            };

            db.GetTable <Voiture>().InsertOnSubmit(v);
            db.SubmitChanges();
            return(true);
        }