private void btnExp_Click(object sender, EventArgs e) { if (dvgDetailCommande.Rows.Count != 0) { MessageBox.Show("Un changement de d'expediteur annulera la commande en cour.", "Expediteur", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } PL.FRM_Client_Commande frmC = new FRM_Client_Commande(); frmC.txtID.Text = IDCLIENT.ToString(); frmC.ShowDialog(); //afficher les info de client if ((frmC.dvgclient.CurrentRow != null) && (frmC.dvgclient.Rows.Count != 0)) { IDEXPEDITEUR = (int)frmC.dvgclient.CurrentRow.Cells[0].Value; //on recupere l'ID client pour le mettre en variable puis utiliser a l'enregistrement de la commande txtNomExp.Text = frmC.dvgclient.CurrentRow.Cells[2].Value.ToString(); txtIdExp.Text = frmC.dvgclient.CurrentRow.Cells[0].Value.ToString(); } }
private void btnDst_Click(object sender, EventArgs e) { if (dvgDetailLivraison.Rows.Count != 0) { MessageBox.Show("Un changement de déstinataire annulera la commande en cour.", "Déstinataire", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } PL.FRM_Client_Commande frmC = new FRM_Client_Commande(); frmC.ShowDialog(); //afficher les info de client if ((frmC.dvgclient.CurrentRow != null) && (frmC.dvgclient.Rows.Count != 0)) { IDDEST = (int)frmC.dvgclient.CurrentRow.Cells[0].Value; //on recupere l'ID client pour le mettre en variable puis utiliser a l'enregistrement de la commande txtNomDest.Text = frmC.dvgclient.CurrentRow.Cells[2].Value.ToString(); txtIdDest.Text = frmC.dvgclient.CurrentRow.Cells[0].Value.ToString(); } }