public IHttpActionResult PostExamen(Examen examen) { using (YouLabEntities db = new YouLabEntities()) { db.Examen.Add(examen); db.SaveChanges(); } return(CreatedAtRoute("DefaultApi", new { id = examen.ID_Exam }, examen)); }
public IHttpActionResult PostSecretaire(Secretaire secretaire) { using (YouLabEntities db = new YouLabEntities()) { db.Secretaire.Add(secretaire); db.SaveChanges(); } return(CreatedAtRoute("DefaultApi", new { id = secretaire.ID_sec }, secretaire)); }
public IHttpActionResult PostLaborantin(Laborantin laborantin) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } using (YouLabEntities db = new YouLabEntities()) { db.Laborantin.Add(laborantin); db.SaveChanges(); } return(CreatedAtRoute("DefaultApi", new { id = laborantin.ID_laboran }, laborantin)); }
public IHttpActionResult PostResultat(Resultat resultat) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } using (YouLabEntities db = new YouLabEntities()) { db.Resultat.Add(resultat); db.SaveChanges(); } return(CreatedAtRoute("DefaultApi", new { id = resultat.ID_Res }, resultat)); }
public IHttpActionResult PostCategorie(Categorie categorie) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } using (YouLabEntities db = new YouLabEntities()) { db.Categorie.Add(categorie); db.SaveChanges(); } return(CreatedAtRoute("DefaultApi", new { id = categorie.ID_Cat }, categorie)); }
public IHttpActionResult PostPatient(Patient patient) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } using (YouLabEntities db = new YouLabEntities()) { db.Patient.Add(patient); db.SaveChanges(); } return(CreatedAtRoute("DefaultApi", new { id = patient.ID_P }, patient)); }
public IHttpActionResult PostConsultation(Consultation consultation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } using (YouLabEntities db = new YouLabEntities()) { consultation.Date_consult = DateTime.Now; db.Consultation.Add(consultation); db.SaveChanges(); } return(CreatedAtRoute("DefaultApi", new { id = consultation.ID_Consult }, consultation)); }