Ejemplo n.º 1
0
        public IActionResult Put(Guid id, [FromBody] FicheSortie ficheSortie)
        {
            var result = _Db.FichesSorties.Where(f => f.Id == id).FirstOrDefault();

            if (result == null || ficheSortie.Id != id)
            {
                return(NotFound(string.Format("Fiche avec l'identifiant {0} est non trouvée", id)));
            }
            else
            {
                try {
                    _Db.Update(ficheSortie);
                    if (_Db.SaveChanges() != 0)
                    {
                        return(Ok(ficheSortie));
                    }
                    else
                    {
                        return(Ok(string.Format("Aucune opération n'est effectuée!")));
                    }
                } catch (Exception ex) {
                    return(BadRequest(string.Format("Echec de la modification de la fiche! : {0}", ex.ToString())));
                }
            }
        }
 public void AddFicheSortie(FicheSortie newFicheSortie)
 {
     throw new NotImplementedException();
 }