private void btnImport_Click(object sender, EventArgs e) { listeDate.Clear(); pictureBox1.Visible = true; if (Model.isConnected() == true) { dgvVisite.Rows.Clear(); Model.ImportVisite(Personne.getId()); var LQuery = Model.maConnexion.visite.ToList() .Where(x => x.infirmiere == Personne.getId()) .Select(x => new { x.id, x.patient, x.date_prevue, x.date_reelle, x.duree, x.compte_rendu_infirmiere }); foreach (var v in LQuery) { listeDate.Add(v.date_prevue); String NomPrenomPatient = Model.GetNomPersonneFromId(v.patient) + " " + Model.GetPrenomPersonneFromId(v.patient); string[] LaVisite = { v.id.ToString(), NomPrenomPatient, v.date_prevue.ToString(), v.date_reelle.ToString(), v.duree.ToString(), v.compte_rendu_infirmiere }; dgvVisite.Rows.Add(LaVisite); } } else { Form404 Form404 = new Form404(); Form404.Show(); } pictureBox1.Visible = false; }
private void btExporter_Click(object sender, EventArgs e) { if (dgvVisite.RowCount > 0) { if (Model.isConnected() == true) { FormExporter FormExporter = new FormExporter(dgvVisite, idInfirmiere); FormExporter.Show(); } else { Form404 Form404 = new Form404(); Form404.Show(); } } else { Model.Shake_Form(this); } }