private void btnNouveau_Click(object sender, EventArgs e) { GererContextes(Context.New); adherentBindingSource.Clear(); etablissementTextbox.Text = null; roleTextbox.Text = null; adherentBindingSource.AddNew(); AdherentEP.Clear(); }
private void GererContextes(Contexte contexte) { contexteActuel = contexte; switch (contexte) { case Contexte.Initial: adherentBindingSource.Clear(); AdherentEP.Clear(); txtAdherentID.Clear(); txtDebNom.Clear(); gbRecherche.Visible = true; gbDetails.Visible = false; btnAnnuler.Visible = false; btnEditer.Visible = false; btnValider.Visible = false; btnNouveau.Visible = true; break; case Contexte.Affichage: gbRecherche.Visible = true; gbDetails.Visible = true; btnAnnuler.Visible = false; btnEditer.Visible = true; gbDetails.Enabled = false; btnValider.Visible = false; btnNouveau.Visible = true; break; case Contexte.Edition: gbRecherche.Visible = false; gbDetails.Enabled = true; adherentIDTextBox.ReadOnly = true; btnAnnuler.Visible = true; btnEditer.Visible = false; btnValider.Visible = true; btnNouveau.Visible = false; break; case Contexte.Nouveau: gbRecherche.Visible = false; gbDetails.Visible = true; gbDetails.Enabled = true; adherentIDTextBox.ReadOnly = false; btnAnnuler.Visible = true; btnEditer.Visible = false; btnValider.Visible = true; btnNouveau.Visible = false; break; default: break; } }
private void AffichageInitial() { adherentBindingSource.Clear(); AdherentEP.Clear(); txtAdherentID.Clear(); txtDebNom.Clear(); gbRecherche.Visible = true; gbDetails.Visible = false; btnAnnuler.Visible = false; btnEditer.Visible = false; btnValider.Visible = false; btnNouveau.Visible = true; }
private void btnAnnuler_Click(object sender, EventArgs e) { AdherentEP.Clear(); adherentBindingSource.CancelEdit(); GererContextes(Context.Initial); }
private void btnNouveau_Click(object sender, EventArgs e) { GererContextes(Contexte.Nouveau); adherentBindingSource.AddNew(); AdherentEP.Clear(); }