private void InitForm() { cmbPays.Items.Clear(); cmbSexe.Items.Clear(); cmbCodeTelephone1.Items.Clear(); cmbCodeTelephone2.Items.Clear(); cmbVille.Items.Clear(); cmbRoleEmploye.Items.Clear(); lblCodeEmploye.Text = string.Empty; txbNomUtilisateur.Text = string.Empty; txbNumeroCNI.Text = string.Empty; txbNomComplet.Text = string.Empty; txbMotDePasse.Text = string.Empty; txbConfirmMDP.Text = string.Empty; txbLieuNaissance.Text = string.Empty; txbNumero1.Text = string.Empty; txbNumero2.Text = string.Empty; txbAdresse.Text = string.Empty; fonction.ChargerEnumerationComboBox(cmbSexe, Enum.GetNames(typeof(StatutSexe))); fonction.ChargerEnumerationComboBox(cmbRoleEmploye, Enum.GetNames(typeof(StatutEmploye))); cmbRoleEmploye.Items.Remove(Enum.GetNames(typeof(StatutEmploye))[0]); fonction.ChargerPaysComboBox(cmbPays, paysBLO.TousPays); fonction.ChargerCodePhoneComboBox(cmbCodeTelephone1, paysBLO.TousPays); fonction.ChargerCodePhoneComboBox(cmbCodeTelephone2, paysBLO.TousPays); cmbPays.SelectedIndex = -1; cmbSexe.SelectedIndex = -1; cmbCodeTelephone1.SelectedIndex = -1; cmbCodeTelephone2.SelectedIndex = -1; cmbVille.SelectedIndex = -1; cmbRoleEmploye.SelectedIndex = -1; pbEmploye.Image = pbEmploye.InitialImage; }
public void InitForm() { cmbPays.Items.Clear(); cmbSexe.Items.Clear(); cmbCodeTelephone1.Items.Clear(); cmbCodeTelephone2.Items.Clear(); cmbVille.Items.Clear(); cmbTypeCompte.Items.Clear(); cmbTypeAppartenant.Items.Clear(); lblCodeClient.Text = string.Empty; lblCodeCompte.Text = string.Empty; fonction.ChargerEnumerationComboBox(cmbSexe, Enum.GetNames(typeof(StatutSexe))); fonction.ChargerEnumerationComboBox(cmbTypeCompte, Enum.GetNames(typeof(TypeCompte))); fonction.ChargerEnumerationComboBox(cmbTypeAppartenant, Enum.GetNames(typeof(TypeAppartenantCompteEpargne))); fonction.ChargerPaysComboBox(cmbPays, paysBLO.TousPays); fonction.ChargerCodePhoneComboBox(cmbCodeTelephone1, paysBLO.TousPays); fonction.ChargerCodePhoneComboBox(cmbCodeTelephone2, paysBLO.TousPays); cmbPays.SelectedIndex = -1; cmbSexe.SelectedIndex = -1; cmbCodeTelephone1.SelectedIndex = -1; cmbCodeTelephone2.SelectedIndex = -1; cmbVille.SelectedIndex = -1; cmbTypeCompte.SelectedIndex = -1; cmbTypeAppartenant.SelectedIndex = -1; cmbTypeAppartenant.Enabled = false; lblCodeClient.Text = clientBLO.CodeClient; txbNomStructure.Text = string.Empty; txbNomStructure.Enabled = false; }
private void InformationEmploye(Employe employe) { fonction.ChargerEnumerationComboBox(cmbSexe, Enum.GetNames(typeof(StatutSexe))); fonction.ChargerPaysComboBox(cmbPays, paysBLO.TousPays); fonction.ChargerCodePhoneComboBox(cmbCodeTelephone1, paysBLO.TousPays); fonction.ChargerCodePhoneComboBox(cmbCodeTelephone2, paysBLO.TousPays); gbEmploye.Text += employe.CodeEmploye; lblCodeEmploye.Text = employe.CodeEmploye; txbNumeroCNI.Text = employe.NumeroCNI; txbAdresse.Text = employe.Adresse; if (employe.DateNaissance != null) { dtDateNaissance.Value = employe.DateNaissance.GetValueOrDefault(); } txbLieuNaissance.Text = employe.LieuNaissance; txbNomComplet.Text = employe.NomComplet; cmbCodeTelephone1.Text = employe.NumeroTelephone1.Split(' ')[0]; txbNumero1.Text = employe.NumeroTelephone1.Split(' ')[1]; cmbCodeTelephone2.Text = employe.NumeroTelephone2.Split(' ')[0]; txbNumero2.Text = employe.NumeroTelephone2.Split(' ')[1]; if (employe.Pays.ToString() != "Indefini") { cmbPays.Text = employe.Pays.ToString(); } if (employe.Sexe.ToString() != null) { cmbSexe.Text = employe.Sexe.ToString(); } if (employe.Ville.ToString() != "Indefini") { cmbVille.Text = employe.Ville.ToString(); } pbEmploye.Image = (employe.PhotoProfil != string.Empty) ? Image.FromFile(employe.PhotoProfil) : pbEmploye.InitialImage; if (employe.PhotoProfil != string.Empty) { pbEmploye.ImageLocation = employe.PhotoProfil; } else { pbEmploye.Image = pbEmploye.InitialImage; } }