Example #1
0
        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));
        }
Example #3
0
        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));
        }
Example #4
0
        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));
        }
Example #6
0
        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));
        }