private void mbsearch_Click(object sender, EventArgs e) { CopieIntegral.list_ci.Clear(); ocon = new SqlDbConnect(); ocon.SqlQuery("select * from personne where num=@num and anneeAct=@aa"); ocon.Cmd.Parameters.Add("num", MySql.Data.MySqlClient.MySqlDbType.VarChar).Value = tnumact.Text; ocon.Cmd.Parameters.Add("aa", MySql.Data.MySqlClient.MySqlDbType.VarChar).Value = tyear.Text; numact = tnumact.Text; year = tyear.Text; CopieIntegral c = new CopieIntegral(); c.AnneeAct = year; c.Num = numact; CopieIntegral.list_ci.Add(c); try { namewewanttosee.Text = ocon.QueryEx().Rows[0][2].ToString() + " " + ocon.QueryEx().Rows[0][4].ToString(); filltext(); } catch { if (MessageBox.Show("Personne n'existe pas voulez-vous l'ajouter ?", "Erreur", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes) { AjoutActe ac = new AjoutActe(); ac.Show(); } } }
public void DoSearch(string num, string year) { ocon = new SqlDbConnect(); ocon.SqlQuery("select * from personne where num=@num and anneeAct=@aa"); ocon.Cmd.Parameters.Add("num", MySql.Data.MySqlClient.MySqlDbType.VarChar).Value = num; ocon.Cmd.Parameters.Add("aa", MySql.Data.MySqlClient.MySqlDbType.VarChar).Value = year; try { namewewanttosee.Text = ocon.QueryEx().Rows[0][2].ToString() + " " + ocon.QueryEx().Rows[0][4].ToString(); } catch { if (MessageBox.Show("Personne n'existe pas voulez-vous l'ajouter ?", "Erreur", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes) { AjoutActe ac = new AjoutActe(); ac.Show(); } } }
private void metroTile1_Click(object sender, EventArgs e) { AjoutActe add = new AjoutActe(); add.Show(); }