public Colis findid(int id)
        {
            var bd1 = new ProjetContext();

            Colis c = bd.Colis.Find(id);
            if (c != null)
            {
                var v = bd1.Ville.Find(c.villeDepartColisid);
                c.villeDepartColis = v;

                v = bd1.Ville.Find(c.villeArriveColisid);
                c.villeArriveColis = v;
                return c;
            }
            else {
                c = new Colis();
                c.Colisid = -1;
                return c;
            }
        }
        public void update(Colis type_)
        {
            var query = bd.Colis.Find(type_.Colisid);

            if (query != null)
            {
                query.adresseDestinaraire = type_.adresseDestinaraire;
                query.clientid = type_.clientid;
                query.dateArriveColis = type_.dateArriveColis;
                query.dateDepartColis = type_.dateDepartColis;
                query.detailsColis = type_.detailsColis;
                query.etatColis = type_.etatColis;
                query.naturecolisid = type_.naturecolisid;
                query.nomDestinateire = type_.nomDestinateire;
                query.prixColis = type_.prixColis;
                query.telDestinataire = type_.telDestinataire;
                query.typecolisid = type_.typecolisid;
                query.villeArriveColisid = type_.villeArriveColisid;
                query.villeDepartColisid = type_.villeDepartColisid;
                query.voietransmissionid = type_.voietransmissionid;
                bd.SaveChanges();
            }
        }
 public void add(Colis type_)
 {
     bd.Colis.Add(type_);
     bd.SaveChanges();
 }