// CONSTRUCTS : public MainForm() { this.connection = new SqlConnection("Server=localhost;Database=medical-analysis;User ID=sa;Password=itu;"); this.axeDAO = new AxeDAO(this.connection); this.anDAO = new AnalysisResultDAO(this.connection); this.results = new List <AnalysisResult>(); InitializeComponent(); this.InitAxes(); this.showSimilaire = false; this.showCmp = false; }
private void AjoutConsultation_Load(object sender, EventArgs e) { List <Consultation> consultations = new AxeDAO(connection).SelectConsultation(null); foreach (Consultation cons in consultations) { cbConsultation.Items.Add(cons.Name); } if (consultations.Count() > 0) { cbConsultation.SelectedIndex = 0; } }
private void btnValider_Click(object sender, EventArgs e) { try { String nomCons = cbConsultation.SelectedItem.ToString(); Axe cons = new AxeDAO(connection).SelectConsultation("WHERE name = '" + nomCons + "'").First(); main.AddAxe(cons); this.Close(); } catch (FormatException ex) { MessageBox.Show("Veuillez saisir le bon format de donnees !"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }