//Release used ressources and return to the parent control
        private void cleanAndReturn()
        {
            foreach (Control item in mainForm.Instance.PnlContainer.Controls)
            {
                if (item.Name == "ModifierAtelierModal")
                {
                    mainForm.Instance.PnlContainer.Controls.Remove(item);
                    item.Dispose(); // Release all the resources used by the control
                    break;
                }
            }

            foreach (Control item in mainForm.Instance.PnlContainer.Controls)
            {
                if (item.Name == "m2lAteliers")
                {
                    mainForm.Instance.PnlContainer.Controls.Remove(item);
                    item.Dispose(); // Release all the resources used by the control
                    break;
                }
            }

            m2lAteliers ucAtelier = new m2lAteliers();

            ucAtelier.Dock = DockStyle.Fill;
            mainForm.Instance.PnlContainer.Controls.Add(ucAtelier);

            mainForm.Instance.PnlContainer.Controls["m2lAteliers"].BringToFront();
        }
        private void DeleteAtelierBtn_Click(object sender, EventArgs e)
        {
            m2lAteliers atelierAjout = new m2lAteliers();

            DAOAtelier.supprimerAtelier(atelierId);

            cleanAndReturn();
        }
        private void ValidateModificationBtn_Click(object sender, EventArgs e)
        {
            m2lAteliers atelierAjout = new m2lAteliers();
            Atelier     unAtelier;

            int capactieModif = Convert.ToInt32(txbModifCapacite.Text);

            unAtelier = new Atelier(atelierId, txbNomModif.Text, capactieModif, dtpDebut.Value, dtpFin.Value);

            DAOAtelier.modifierAtelier(unAtelier);

            cleanAndReturn();
        }
        private void btnAjoutValid_Click_1(object sender, EventArgs e)
        {
            m2lAteliers atelierAjout = new m2lAteliers();
            Atelier     unAtelier;

            int capaciteAjout = Convert.ToInt32(txbCapaciteAjouter.Text);

            unAtelier = new Atelier(txbNomAjouter.Text, capaciteAjout, dtpdebutAjouter.Value, dtpFinAjouter.Value);

            DAOAtelier.creerAtelier(unAtelier);

            atelierAjout.Refresh();
        }
示例#5
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            _obj = this;

            m2lStands       ucStands       = new m2lStands();
            m2lParticipants ucParticipants = new m2lParticipants();
            m2lHotel        ucHotel        = new m2lHotel();
            m2lAteliers     ucAtelier      = new m2lAteliers();

            ucStands.Dock       = DockStyle.Fill;
            ucParticipants.Dock = DockStyle.Fill;
            ucHotel.Dock        = DockStyle.Fill;
            ucAtelier.Dock      = DockStyle.Fill;

            panelContainer.Controls.Add(ucStands);
            panelContainer.Controls.Add(ucParticipants);
            panelContainer.Controls.Add(ucHotel);
            panelContainer.Controls.Add(ucAtelier);
        }