public FrmAjoutTypeChambre(BD5B6TP1_ConstantinBrassardLaheyDataSet.TypeChambreRow nouveauTypeChambre, bool modifMode = false) { InitializeComponent(); controlesAValider = new Control[] { tbDescription, tbNoType, tbPrixBas, tbPrixHaut, tbPrixMoyen, }; this.nouveauTypeChambre = nouveauTypeChambre; tbNoType.Text = nouveauTypeChambre.NoTypeChambre.ToString(); if (modifMode) { tbDescription.Text = nouveauTypeChambre.Description; tbPrixBas.Text = nouveauTypeChambre.PrixBas.ToString(); tbPrixHaut.Text = nouveauTypeChambre.PrixHaut.ToString(); tbPrixMoyen.Text = nouveauTypeChambre.PrixMoyen.ToString(); Text = "Modification d'un type de chambre"; lblEntete.Text = "Modifer type chambre"; btnConfirmer.Text = "Confirmer les modifications"; } }
private void btnModifierType_Click(object sender, EventArgs e) { int noTypeSelec = (int)((DataRowView)typeChambreBindingSource.Current)["NoTypeChambre"]; BD5B6TP1_ConstantinBrassardLaheyDataSet.TypeChambreRow rowSelec = bD5B6TP1_ConstantinBrassardLaheyDataSet.TypeChambre.FindByNoTypeChambre(noTypeSelec); FrmAjoutTypeChambre frmAjout = new FrmAjoutTypeChambre(rowSelec, true); DialogResult resultat = frmAjout.ShowDialog(); if (resultat == DialogResult.Cancel) { rowSelec.CancelEdit(); } else { BaseFormGestion.estSavegarder = true; } }