Exemplo n.º 1
0
        private void ValiderDossier(DossierReservation dossier)
        {
            dossier.EtatDossierReservation = 0;
            string validation = DossierReservation.ValiderSolvabilite(dossier);

            switch (validation)
            {
            case "ok":
                dossier.EtatDossierReservation = 1;
                MethodesDossier.ModifierDossier(dossier);
                break;

            case "nok":
                Supprimer();
                break;
            }
        }
        public IHttpActionResult PutValiderReservation(int id)
        {
            DossierReservation dossierReservation = db.DossierReservations.Find(id);

            if (dossierReservation == null)
            {
                return(NotFound());
            }
            if (dossierReservation.ValiderSolvabilite())
            {
                db.SaveChanges();
                return(Ok(dossierReservation.EtatDossierReservation));
            }
            else
            {
                return(BadRequest());
            }
        }