public void RemplireDataGridView()
        {
            List <Rendezvous> list = RendezvousController.GetNonValidatedRvs(Medecin.Id_doc);

            rendezvousBindingSource.Clear();
            foreach (Rendezvous rv in list)
            {
                rendezvousBindingSource.Add(rv);
            }
        }
 public void Rempliredgv()
 {
     if (RendezvousController.GetRvList().Rows.Count > 0)
     {
         dgv_rvs.DataSource       = RendezvousController.GetRvList();
         dgv_rvs.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;
         NoResult_lbl1.Visible    = false;
     }
     else
     {
         NoResult_lbl1.Visible = true;
     }
 }
        private void btn_refuser_Click(object sender, EventArgs e)
        {
            if (dataGridView_NewRv.SelectedCells.Count > 0)
            {
                int             selectedrowindex = dataGridView_NewRv.SelectedCells[0].RowIndex;
                DataGridViewRow row = dataGridView_NewRv.Rows[selectedrowindex];
                int             id  = Convert.ToInt32(row.Cells["Id"].Value);

                RendezvousController.RefuserRv(id);
                rendezvousBindingSource.RemoveCurrent();
                MessageBox.Show("rendez-vous Refusé!", "information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
 private void date_ValueChanged(object sender, EventArgs e)
 {
     if (go)
     {
         if (RendezvousController.GetRvListByDate(date.Value).Rows.Count > 0)
         {
             dgv_rvs.DataSource       = RendezvousController.GetRvListByDate(date.Value);
             dgv_rvs.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;
             NoResult_lbl1.Visible    = false;
         }
         else
         {
             dgv_rvs.DataSource    = null;
             NoResult_lbl1.Visible = true;
         }
     }
 }
 private void search_txtbox_TextChanged(object sender, EventArgs e)
 {
     if (search_txtbox.Text != "")
     {
         if (RendezvousController.GetRvListSearchByPat(search_txtbox.Text).Rows.Count > 0)
         {
             dgv_rvs.DataSource       = RendezvousController.GetRvListSearchByPat(search_txtbox.Text);
             dgv_rvs.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;
             NoResult_lbl1.Visible    = false;
         }
         else
         {
             dgv_rvs.DataSource    = null;
             NoResult_lbl1.Visible = true;
         }
     }
     else
     {
         Rempliredgv();
     }
 }