public FormAjoutEmploye()
        {
            InitializeComponent();
            IGestionEmployes
                gestionEmployes = GestionEmployesBuilderClassFactory.getInterface();

            List <Role>    listeRoles    = gestionEmployes.findAllRoles();
            List <Ville>   listeVilles   = gestionEmployes.findAllVilles();
            List <Societe> listeSocietes = gestionEmployes.findAllSocietes();

            foreach (Role role in listeRoles)
            {
                ComboboxItem item = new ComboboxItem();
                item.Value = role.IdRole;
                item.Text  = role.CodeRole;

                comboBoxRole.Items.Add(item);
            }
            foreach (Ville ville in listeVilles)
            {
                ComboboxItem item = new ComboboxItem();
                item.Value = ville.IdVille;
                item.Text  = ville.CodeVille;

                comboBoxVille.Items.Add(item);
            }
            foreach (Societe societe in listeSocietes)
            {
                ComboboxItem item = new ComboboxItem();
                item.Value = societe.IdSociete;
                item.Text  = societe.NomSociete;

                comboBoxSociete.Items.Add(item);
            }
        }
        private void btnReset_Click(object sender, EventArgs e)
        {
            textBoxSearch.Text = "";
            IGestionEmployes
                gestionEmployes = GestionEmployesBuilderClassFactory.getInterface();

            dataGridVilles.DataSource = gestionEmployes.findAllVilles();
        }
        public FormGestionVilles()
        {
            InitializeComponent();
            IGestionEmployes
                gestionEmployes = GestionEmployesBuilderClassFactory.getInterface();

            dataGridVilles.DataSource = gestionEmployes.findAllVilles();
        }
 private void btnDeleteVille_Click(object sender, EventArgs e)
 {
     if (this.dataGridVilles.SelectedRows.Count > 0)
     {
         int selectedRowIndex = this.dataGridVilles.SelectedRows[0].Index;
         int idVille          = Convert.ToInt32(this.dataGridVilles.Rows[selectedRowIndex].Cells["IdVille"].Value);
         IGestionEmployes
             gestionEmployes = GestionEmployesBuilderClassFactory.getInterface();
         gestionEmployes.deleteVille(idVille);
         dataGridVilles.DataSource = gestionEmployes.findAllVilles();
     }
 }
Exemplo n.º 5
0
        public FormGestionAdresses()
        {
            InitializeComponent();
            IGestionEmployes
                gestionEmployes = GestionEmployesBuilderClassFactory.getInterface();

            dataGridAdresses.DataSource = gestionEmployes.findAllAdresses();

            List <Ville> listeVilles = gestionEmployes.findAllVilles();

            foreach (Ville ville in listeVilles)
            {
                ComboboxItem item = new ComboboxItem();
                item.Value = ville.IdVille;
                item.Text  = ville.CodeVille;

                comboBoxVille.Items.Add(item);
            }
        }