Example #1
0
        private void buttonstart_Click(object sender, EventArgs e)
        {
            if (comboBoxuser.SelectedValue.Equals(textBoxpassword.Text))
            {
                User        u    = (User)comboBoxuser.SelectedItem;
                Departament d    = new Departament();
                IUserType   tipo = new IEmploye();


                if (u.idDepartamento == 2)
                {
                    tipo = new IAdmin();
                    //this.Hide();
                }
                else if (u.idDepartamento == 3)
                {
                    tipo = new IVigilant();
                }
                else
                {
                    tipo = new IEmploye();
                }

                tipo.UserType();
            }
            else
            {
                MessageBox.Show("¡Contraseña incorrecta!", "CellphoneStore",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #2
0
        public void SupprimerEmploye(string pID)
        {
            IEmploye employe = ChercherEmpID(pID);

            if (employe == null)
            {
                throw new ArgumentNullException("Impossible de trouver l'employé avec cet identifiant");
            }

            m_lstEmploye.Remove(employe);
        }
Example #3
0
        private void BtnGenEmpl_Click(object sender, EventArgs e)
        {
            IEmploye employe = horaire.ChercherEmpID(txtIDEmpl.Text);

            if (employe == null)
            {
                MessageBox.Show("Impossible de trouver l'employé avec cet identifiant", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            txtNom.Text    = employe.Nom;
            txtPrenom.Text = employe.Prenom;
        }
Example #4
0
        public void ModifierEmp(string pNom, string pPrenom, string pID)
        {
            IEmploye employe = ChercherEmpID(pID);

            if (employe == null)
            {
                throw new ArgumentNullException("Impossible de trouver l'employé avec cet identifiant");
            }

            employe.Nom    = pNom;
            employe.Prenom = pPrenom;
        }
Example #5
0
 public void SetEmploye(IEmploye employe, out bool result)
 {
     if (_listEmployes.Count() >= MaximumCountEmployes ||
         employe.Specification == Specification.Unknown ||
         (DepartmentType == DepartmentType.SpacecraftCrew &&
          employe.Specification != Specification.Spaceman))
     {
         result = false;
         return;
     }
     _listEmployes.Add(employe);
     result = true;
 }
Example #6
0
        private void LsvEmp_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Affiche les informations de l'employé sélectioné.
            if (lsvEmp.SelectedIndices.Count <= 0)
            {
                return;
            }

            string   ID      = lsvEmp.Items[lsvEmp.SelectedIndices[0]].SubItems[0].Text;
            IEmploye employe = horaire.ChercherEmpID(ID);

            txtNom.Text    = employe.Nom;
            txtPrenom.Text = employe.Prenom;
            txtIDEmpl.Text = employe.ID;
        }
Example #7
0
 public EmployeController(IEmploye employe) => this.employe = employe;