private void BtConfirmer_Click_1(object sender, EventArgs e) { Stagiaire s = new Stagiaire(); s.Id = 1; s.Nom = NomLab.Text; s.Prenom = PrenomLab.Text; s.DateNaissance = DateTime.Parse(DateNaissanceLab.Text); if (SexeLab.Text == "Male") { s.Sexe = true; } else { s.Sexe = false; } s.Cin = CinLab.Text; s.Groupe = new GroupeBAO().FindByName(GroupeLab.Text); s.Email = EmailLab.Text; s.Telephone = TelephoneLab.Text; s.Adresse = AdresseLab.Text; s.Etat = 0; s.ProfilImage = @Url; StagiaireBAO.Add(s); this.Dispose(); Formu.Dispose(); }
public static new void Add(Stagiaire s) { if (s.Nom != "") { new StagiaireDAO().Add(s); } }
private void stagiaireDataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == 3) { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; new StagiaireBAO().UpdateStat(s.Id); this.Actualiser(); } if (e.ColumnIndex == 4) { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; FormUpdateStagiaires f = new FormUpdateStagiaires(); f.Update(s); f.ShowDialog(); this.Actualiser(); } if (e.ColumnIndex == 5) { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; new StagiaireBAO().Delete(s.Id); this.Actualiser(); } Stagiaire x = (Stagiaire)stagiaireBindingSource.Current; pictureBox1.Image = Image.FromFile(x.ProfilImage); Nom.Text = x.Nom; prenom.Text = x.Prenom; Filiere.Text = x.Filiere.Titre; } catch (Exception) { } }
private void BtValide_Click_1(object sender, EventArgs e) { Stagiaire s = new Stagiaire(); s.Nom = nomTextBox.Text; s.Prenom = PrenomTextBox.Text; s.ProfilImage = Url; s.Telephone = telephoneTextBox.Text; if (sexeRadioButton.Checked) { s.Sexe = true; } else { s.Sexe = false; } s.Cin = CinTextBox.Text; s.DateNaissance = dateNaissanceDateTimePicker.Value; s.Email = emailTextBox.Text; s.Adresse = adresseTextBox.Text; s.Filiere = (Filiere)FilierecomboBox.SelectedItem; FormStagiairesConfirmerInscription f = new FormStagiairesConfirmerInscription(); f.Update(s); f.Formu = this; f.Show(); this.Hide(); }
private void BtValide_Click(object sender, EventArgs e) { Stagiaire s = new Stagiaire(); s.Id = id; s.Nom = nomTextBox.Text; s.Prenom = PrenomTextBox.Text; s.DateNaissance = dateNaissanceDateTimePicker.Value; s.Cin = CinTextBox.Text; if (sexeRadioButton.Checked == true) { s.Sexe = true; } else { s.Sexe = false; } s.Groupe = new GroupeBAO().FindByName(groupeComboBox.Text); s.Email = emailTextBox.Text; s.Telephone = telephoneTextBox.Text; s.Adresse = adresseTextBox.Text; s.Etat = 0; s.ProfilImage = @Url; new StagiaireBAO().Update(s); this.Dispose(); }
private void LastRow_Click(object sender, EventArgs e) { stagiaireBindingSource.Position = stagiaireBindingSource.Count; try { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; pictureBox1.Image = Image.FromFile(s.ProfilImage); Nom.Text = s.Nom; prenom.Text = s.Prenom; Filiere.Text = s.Filiere.Titre; } catch (Exception) { } }
private void PriviousRow_Click(object sender, EventArgs e) { stagiaireBindingSource.Position = stagiaireBindingSource.Position - 1; try { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; pictureBox1.Image = Image.FromFile(s.ProfilImage); Nom.Text = s.Nom; prenom.Text = s.Prenom; Groupe.Text = s.Groupe.Nom; } catch (Exception) { } }
private void FormGestionInscription_Load(object sender, EventArgs e) { this.Actualiser(); try { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; pictureBox1.Image = Image.FromFile(s.ProfilImage); Nom.Text = s.Nom; prenom.Text = s.Prenom; Groupe.Text = s.Groupe.Nom; } catch (Exception) { } }
private void FormGestionInscription_Load(object sender, EventArgs e) { this.Actualiser(); try { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; pictureBox1.Image = Image.FromFile(s.ProfilImage); Nom.Text = s.Nom; prenom.Text = s.Prenom; Filiere.Text = s.Filiere.Titre; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void stagiaireDataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 3) { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; FormUpdateStagiaires f = new FormUpdateStagiaires(); f.Update(s); f.ShowDialog(); this.Actualiser(); } if (e.ColumnIndex == 4) { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; new StagiaireBAO().Delete(s.Id); this.Actualiser(); } }
public void Actualiser() { stagiaireBindingSource.DataSource = null; stagiaireBindingSource.DataSource = new StagiaireBAO().Select(); try { Stagiaire s = (Stagiaire)stagiaireBindingSource.Current; pictureBox1.Image = Image.FromFile(s.ProfilImage); Nom.Text = s.Nom; Prenom.Text = s.Prenom; filiere1.Text = s.Filiere.Titre; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void Update(Stagiaire s) { id = s.Id; Url = s.ProfilImage; pictureBox1.Image = Image.FromFile(s.ProfilImage); nomTextBox.Text = s.Nom; PrenomTextBox.Text = s.Prenom; dateNaissanceDateTimePicker.Value = s.DateNaissance; CinTextBox.Text = s.Cin; emailTextBox.Text = s.Email; telephoneTextBox.Text = s.Telephone; adresseTextBox.Text = s.Adresse; if (s.Sexe == true) { sexeRadioButton.Checked = true; } else { SexeRadioButton2.Checked = true; } }
public void Update(Stagiaire s) { pictureBox1.Image = Image.FromFile(s.ProfilImage); NomLab.Text = s.Nom; PrenomLab.Text = s.Prenom; DateNaissanceLab.Text = s.DateNaissance.ToString(); if (s.Sexe) { SexeLab.Text = "Male"; } else { SexeLab.Text = "Femalle"; } CinLab.Text = s.Cin; FiliereLab.Text = s.Filiere.Titre; EmailLab.Text = s.Email; TelephoneLab.Text = s.Telephone; AdresseLab.Text = s.Adresse; this.Url = s.ProfilImage; }