Beispiel #1
0
 private void BOk_Click(object sender, EventArgs e)
 {
     // Verif
     if (Control() == false)
     {
         MessageBox.Show("erreur");
     }
     else
     {
         // init var
         string nom      = tbnom.Text;
         string prenom   = tbprenom.Text;
         string remarque = rtbRemarque.Text;
         int    anmort   = int.Parse(tbmort.Text);
         int    annais   = int.Parse(tbnais.Text);
         int    nati     = ((NATIONALITE)bsnat.Current).idNation;
         int    style    = ((STYLE)bsstyle.Current).idStyle;
         // Crée Comp
         COMPOSITEUR newComp = new COMPOSITEUR();
         newComp.nomCompositeur    = nom;
         newComp.prenomCompositeur = prenom;
         newComp.remarque          = remarque;
         newComp.anMort            = anmort;
         newComp.anNais            = annais;
         newComp.idNation          = nati;
         newComp.idStyle           = style;
         Modele.ajoutCompo(newComp);
         //Messagebox
         MessageBox.Show("Compositeur Crée");
     }
 }
Beispiel #2
0
 private void FCompositeurOeuvre_Load(object sender, EventArgs e)
 {
     comboStyle.ValueMember   = "idStyle";//permet de stocker l'identifiant
     comboStyle.DisplayMember = "libStyle";
     bsstyle.DataSource       = Modele.listestyle();
     comboStyle.DataSource    = bsstyle;
 }
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Modele.init();
     Application.Run(new FConnex());
 }
Beispiel #4
0
 public FVille()
 {
     InitializeComponent();
     //les Villes
     bsVille.DataSource  = Modele.listeville();
     dgvville.DataSource = bsVille.DataSource;
 }
Beispiel #5
0
 public FTypeOeuvre()
 {
     InitializeComponent();
     //les Types d'Oeuvre
     bsto.DataSource          = Modele.listetypoeuvre();
     dgvto.DataSource         = bsto.DataSource;
     dgvto.Columns[2].Visible = false;
 }
 private void FCompositeurNation_Load(object sender, EventArgs e)
 {
     comboCompNat.ValueMember   = "idNation";//permet de stocker l'identifiant
     comboCompNat.DisplayMember = "libNation";
     bsnat.DataSource           = Modele.listenat();
     comboCompNat.DataSource    = bsnat;
     close = false;
 }
        private void BSuppr_Click(object sender, EventArgs e)
        {
            System.Type type = bsComp.Current.GetType();
            var         id   = (int)type.GetProperty("idCompositeur").GetValue(bsComp.Current, null);

            Modele.SupprCompparID(id);
            MessageBox.Show("Comp Supprimé");
        }
        private void BModif_Click(object sender, EventArgs e)
        {
            System.Type type = bsComp.Current.GetType();
            var         id   = (int)type.GetProperty("idCompositeur").GetValue(bsComp.Current, null);

            Modele.trouveCompositeurId(id);
            Form fmodif = new FModifComp();

            fmodif.ShowDialog();
        }
Beispiel #9
0
        public FSalle()
        {
            InitializeComponent();
            //les Salles
            bssalle.DataSource          = Modele.listesalles();
            dgvsalle.DataSource         = bssalle.DataSource;
            dgvsalle.Columns[5].Visible = false;
            dgvsalle.Columns[6].Visible = false;

            dgvsalle.Columns[0].HeaderText = "numéro";
        }
 public FBatiment()
 {
     InitializeComponent();
     //les Batiments
     bsbat.DataSource          = Modele.listebati();
     dgvbat.DataSource         = bsbat.DataSource;
     dgvbat.Columns[3].Visible = false;
     dgvbat.Columns[4].Visible = false;
     dgvbat.Columns[5].Visible = false;
     dgvbat.Columns[8].Visible = false;
     dgvbat.Columns[9].Visible = false;
 }
Beispiel #11
0
 private void FAjoutComp_Load(object sender, EventArgs e)
 {
     // Les Styles
     cbstyle.ValueMember   = "idStyle";//permet de stocker l'identifiant
     cbstyle.DisplayMember = "libStyle";
     bsstyle.DataSource    = Modele.listestyle();
     cbstyle.DataSource    = bsstyle;
     // Les Nations
     cbnat.ValueMember   = "idNation";//permet de stocker l'identifiant
     cbnat.DisplayMember = "libNation";
     bsnat.DataSource    = Modele.listenat();
     cbnat.DataSource    = bsnat;
 }
 public FCompositeurStyle()
 {
     InitializeComponent();
     //les Compositeur
     bscomp.DataSource                = Modele.listecomp();
     dgvCompStyle.DataSource          = bscomp.DataSource;
     dgvCompStyle.Columns[0].Visible  = false;
     dgvCompStyle.Columns[1].Visible  = false;
     dgvCompStyle.Columns[2].Visible  = false;
     dgvCompStyle.Columns[8].Visible  = false;
     dgvCompStyle.Columns[9].Visible  = false;
     dgvCompStyle.Columns[10].Visible = false;
 }
Beispiel #13
0
        private void BOk_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.None;
            // appli Modif
            Modele.lecompoChoisi.anMort            = int.Parse(tbmort.Text);
            Modele.lecompoChoisi.anNais            = int.Parse(tbnais.Text);
            Modele.lecompoChoisi.remarque          = rtbRemarque.Text;
            Modele.lecompoChoisi.nomCompositeur    = tbnom.Text;
            Modele.lecompoChoisi.prenomCompositeur = tbprenom.Text;
            Modele.savechange();

            MessageBox.Show("Coucou c'est modifié ^^");
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
        private void BindingSource1_CurrentChanged(object sender, EventArgs e)
        {
            NATIONALITE v = (NATIONALITE)bsnat.Current;
            int         x = v.idNation;

            bsComp.DataSource             = Modele.CompositeurParNationalite(int.Parse(x.ToString()));
            dgvComp.DataSource            = bsComp;
            dgvComp.Columns[0].HeaderText = "NOM";
            dgvComp.Columns[1].HeaderText = "PRENOM";
            dgvComp.Columns[2].HeaderText = "STYLE";
            dgvComp.Columns[3].HeaderText = "Né le";
            dgvComp.Columns[4].HeaderText = "Mort le";
            dgvComp.Columns[5].HeaderText = "Informations";
        }
        private void Bsstyle_CurrentChanged(object sender, EventArgs e)
        {
            STYLE v = (STYLE)bsstyle.Current;
            int   x = v.idStyle;

            bscomp.DataSource                  = Modele.CompositeurParStyle(int.Parse(x.ToString()));
            dgvCompStyle.DataSource            = bscomp;
            dgvCompStyle.Columns[0].HeaderText = "NOM";
            dgvCompStyle.Columns[1].HeaderText = "PRENOM";
            dgvCompStyle.Columns[2].HeaderText = "STYLE";
            dgvCompStyle.Columns[3].HeaderText = "Né le";
            dgvCompStyle.Columns[4].HeaderText = "Mort le";
            dgvCompStyle.Columns[5].HeaderText = "Informations";
            tbdebstyle.Text = v.dateDebut.ToString();
            tbfinstyle.Text = v.dateFin.ToString();
        }
Beispiel #16
0
 private void BOK_Click(object sender, EventArgs e)
 {
     if (Verif())
     {
         string ID  = tbID.Text;
         string mdp = tbMDP.Text;
         if (Modele.verifLogin(ID, mdp))
         {
             System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(ThreadProc));
             t.Start();
             this.Close();
         }
         else
         {
             MessageBox.Show("Login ou mdp invalide");
         }
     }
     else
     {
         MessageBox.Show("ID ou MDP non remplit");
     }
 }