コード例 #1
0
        public IHttpActionResult PostrdvPatient(rdv rdv)
        {
            /* if (!ModelState.IsValid)
             * {
             *   return BadRequest(ModelState);
             * }*/

            db.rdv.Add(rdv);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (rdvPatientExists(rdv.id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = rdv.id }, rdv));
        }
コード例 #2
0
        public IHttpActionResult PutrdvPatient(decimal id, rdv rdv)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != rdv.id)
            {
                return(BadRequest());
            }

            db.Entry(rdv).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!rdvPatientExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #3
0
        public IHttpActionResult GetrdvPatient(string id)
        {
            rdv rdvPatient = db.rdv.Find(id);

            if (rdvPatient == null)
            {
                return(NotFound());
            }

            return(Ok(rdvPatient));
        }
コード例 #4
0
        public IHttpActionResult DeleterdvPatient(string id)
        {
            rdv rdv = db.rdv.Find(id);

            if (rdv == null)
            {
                return(NotFound());
            }

            db.rdv.Remove(rdv);
            db.SaveChanges();

            return(Ok(rdv));
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: yan38000/Projet-Charton
        private void button1_Click(object sender, EventArgs e)
        {
            MySqlConnection Connection = new MySqlConnection("database=charton; server=localhost; user id=root");
            MySqlCommand    table      = new MySqlCommand("Select * from agence where username = '******' and password= '******'");


            try
            {
                Cmd.Open();
                rdv rdv = new rdv();
                rdv.Show();
                this.Hide();
            }
            catch
            {
                MessageBox.Show("pas bon");
            }
        }