示例#1
0
        private void buttonItem4_Click(object sender, EventArgs e)
        {
            // Bouton Recherche
            Rech form = new Rech();

            form.table = "compte";
            form.ShowDialog();
            if (form.code != 0)
            {
                List <DataColumn> lis = new List <DataColumn>();
                lis.Add(ds.Tables["compte"].Columns["ID"]);
                ds.Tables["compte"].PrimaryKey = lis.ToArray();
                index = ds.Tables["compte"].Rows.IndexOf(ds.Tables["compte"].Rows.Find(form.code));
                affiche();
            }
        }
示例#2
0
        private void buttonX9_Click(object sender, EventArgs e)
        {
            // Bouton Recherche
            Rech form = new Rech();

            form.table = "client";
            form.ShowDialog();
            form.textBoxX2.Focus();
            if (form.code != 0)
            {
                List <DataColumn> lis = new List <DataColumn>();
                lis.Add(ds4.Tables["client"].Columns["ID"]);
                ds4.Tables["client"].PrimaryKey = lis.ToArray();
                DataRow[] dr = ds4.Tables["client"].Select("ID = '" + form.code + "'");
                if (dr.Length != 0)
                {
                    int i = ds4.Tables[0].Rows.IndexOf(dr[0]);
                    mygrid2.Rows[i].Selected = true;
                }
            }
        }