private void AjouterRegleBtn_Click(object sender, EventArgs e) { AjoutRegle a = new AjoutRegle(reglesdgv, faitCombo, butCombo); a.Show(); }
public Process(DataGridView dgv, string b, GroupBox gb) { InitializeComponent(); AjoutRegle.loadRegles(datadgv); this.faitdgv = dgv; this.but = b; this.groupBox = gb; List <RadioButton> radioButtons = new List <RadioButton>(); foreach (var r in this.groupBox.Controls.OfType <RadioButton>()) { radioButtons.Add(r); } Boolean s1 = radioButtons[0].Checked; Boolean s2 = radioButtons[1].Checked; getInitialFait(); while (!testIn(this.but, this.BF) && datadgv.Rows.Count > 0 && !saturee) { // update listeRegle + delete used regles this.listeRegle = getNewRegles(this.BF); if (s1) { strategyLabel.Text = radioButtons[0].Text; fillRegles1(); } // fill the regles DGV with the used regles if (s2) { strategyLabel.Text = radioButtons[1].Text; fillRegles2(); } // update the BF list // fill the BF DGV with the updates list of BF // clear the listRegle fillBF(); } for (int i = 0; i < regledgv.Rows.Count; i++) { regledgv.Rows[i].Cells[0].Value = "Cycle" + (i + 1).ToString(); bfdgv.Rows[i].Cells[0].Value = "Cycle" + (i + 1).ToString(); } if (!testIn(this.but, this.BF)) { if (saturee) { resultLabel.Text = "La base est saturée, le but n'est pas atteint"; resultLabel.ForeColor = Color.Red; } if (datadgv.Rows.Count == 0) { resultLabel.Text = "Il n'y a pas assez de regles, le but n'est pas atteint"; resultLabel.ForeColor = Color.Red; } } else { resultLabel.Text = "Le but est atteint"; } }
private void Form1_Load(object sender, EventArgs e) { AjoutRegle.loadRegles(reglesdgv); retrieveFait(reglesdgv, faitCombo, butCombo); }