private void btnmodifierclient_Click(object sender, EventArgs e) { PL.FRM_Ajoute_Modifier_Client frmclient = new PL.FRM_Ajoute_Modifier_Client(this); if ((dvgclient.SelectedRows.Count != 0) && (dvgclient.Rows.Count != 0)) { frmclient.txtNom.Text = dvgclient.CurrentRow.Cells[2].Value.ToString(); frmclient.txtPrenom.Text = dvgclient.CurrentRow.Cells[3].Value.ToString(); frmclient.txtAdresse.Text = dvgclient.CurrentRow.Cells[5].Value.ToString(); frmclient.txtTelephone.Text = dvgclient.CurrentRow.Cells[9].Value.ToString(); frmclient.txtEmail.Text = dvgclient.CurrentRow.Cells[10].Value.ToString(); frmclient.txtVille.Text = dvgclient.CurrentRow.Cells[7].Value.ToString(); frmclient.txtPays.Text = dvgclient.CurrentRow.Cells[8].Value.ToString(); frmclient.lblTitre.Text = "Modifier Client"; frmclient.txtNumClient.Text = dvgclient.CurrentRow.Cells[1].Value.ToString(); frmclient.txtNumClient.ForeColor = Color.Silver; frmclient.txtNumClient.Enabled = false; frmclient.txtZip.Text = dvgclient.CurrentRow.Cells[6].Value.ToString(); frmclient.txtRabais.Text = dvgclient.CurrentRow.Cells[4].Value.ToString(); frmclient.ShowDialog(); } else { MessageBox.Show("Aucun client séléctionnée.", "Modification", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnmodifierclient_Click(object sender, EventArgs e) { PL.FRM_Ajoute_Modifier_Client frmclient = new PL.FRM_Ajoute_Modifier_Client(this); if (SelectVerif() == null) { for (int i = 0; i < dvgclient.RowCount; i++) { if ((bool)dvgclient.Rows[i].Cells[0].Value == true)//si le chekbox est vraie afficher les information dans le formulaire { frmclient.IDselect = (int)dvgclient.Rows[i].Cells[1].Value; frmclient.txtNom.Text = dvgclient.Rows[i].Cells[2].Value.ToString(); frmclient.txtNom.ForeColor = Color.Black; frmclient.txtPrenom.Text = dvgclient.Rows[i].Cells[3].Value.ToString(); frmclient.txtPrenom.ForeColor = Color.Black; frmclient.txtAdresse.Text = dvgclient.Rows[i].Cells[4].Value.ToString(); frmclient.txtAdresse.ForeColor = Color.Black; frmclient.txtTelephone.Text = dvgclient.Rows[i].Cells[5].Value.ToString(); frmclient.txtTelephone.ForeColor = Color.Black; frmclient.txtEmail.Text = dvgclient.Rows[i].Cells[6].Value.ToString(); frmclient.txtEmail.ForeColor = Color.Black; frmclient.txtVille.Text = dvgclient.Rows[i].Cells[7].Value.ToString(); frmclient.txtVille.ForeColor = Color.Black; frmclient.txtPays.Text = dvgclient.Rows[i].Cells[8].Value.ToString(); frmclient.txtPays.ForeColor = Color.Black; } } frmclient.lblTitre.Text = "Modifier Client"; frmclient.btnactualiser.Visible = false; frmclient.ShowDialog(); } else { MessageBox.Show(SelectVerif(), "Modification", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void modifierToolStripMenuItem_Click(object sender, EventArgs e) { PL.FRM_Ajoute_Modifier_Client frmclient = new PL.FRM_Ajoute_Modifier_Client(this); Client CL = new Client(); if (dvgclient.CurrentRow != null) { frmclient.IDselect = (int)dvgclient.CurrentRow.Cells[1].Value; frmclient.txtNom.Text = dvgclient.CurrentRow.Cells[2].Value.ToString(); frmclient.txtNom.ForeColor = Color.Black; frmclient.txtPrenom.Text = dvgclient.CurrentRow.Cells[3].Value.ToString(); frmclient.txtPrenom.ForeColor = Color.Black; frmclient.txtAdresse.Text = dvgclient.CurrentRow.Cells[4].Value.ToString(); frmclient.txtAdresse.ForeColor = Color.Black; frmclient.txtTelephone.Text = dvgclient.CurrentRow.Cells[5].Value.ToString(); frmclient.txtTelephone.ForeColor = Color.Black; frmclient.txtEmail.Text = dvgclient.CurrentRow.Cells[6].Value.ToString(); frmclient.txtEmail.ForeColor = Color.Black; frmclient.txtVille.Text = dvgclient.CurrentRow.Cells[7].Value.ToString(); frmclient.txtVille.ForeColor = Color.Black; frmclient.txtPays.Text = dvgclient.CurrentRow.Cells[8].Value.ToString(); frmclient.txtPays.ForeColor = Color.Black; frmclient.lblTitre.Text = "Modifier Client"; frmclient.ShowDialog(); } }