コード例 #1
0
 private void btnNouveau_Click(object sender, EventArgs e)
 {
     GererContextes(Context.New);
     adherentBindingSource.Clear();
     etablissementTextbox.Text = null;
     roleTextbox.Text          = null;
     adherentBindingSource.AddNew();
     AdherentEP.Clear();
 }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 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;
 }
コード例 #4
0
 private void btnAnnuler_Click(object sender, EventArgs e)
 {
     AdherentEP.Clear();
     adherentBindingSource.CancelEdit();
     GererContextes(Context.Initial);
 }
コード例 #5
0
 private void btnNouveau_Click(object sender, EventArgs e)
 {
     GererContextes(Contexte.Nouveau);
     adherentBindingSource.AddNew();
     AdherentEP.Clear();
 }