private void ClickValider(object sender, EventArgs e) { string nom = this.window.tbNom.Text; string prenom = this.window.tbPrenom.Text; string qualification = this.window.tbQualification.Text; int anciennete = Convert.ToInt32(this.window.tbAncienneté.Text); float salaireInitial = Convert.ToInt32(this.window.tbSalaire.Text); collaborateur.NomCollabo = nom; collaborateur.PrenomCollabo = prenom; collaborateur.QualificationPrincipaleCourante = qualification; collaborateur.SalaireBrut = salaireInitial; collaborateur.Anciennete = anciennete; Collaborateurs.getCollaborateurs().AddCollaborateur(collaborateur); this.windowParent.dgv.Refresh(); this.window.Close(); }
private void initWindow() { this.window = new FrmList(); this.window.MdiParent = this.parent; this.window.Text = "Liste des Collaborateurs"; this.source.DataSource = Collaborateurs.getCollaborateurs().ListCollaborateur; this.initGrid(this.source); this.window.dgv.SelectionChanged += new EventHandler(selectionChanged); this.window.dgv.CellDoubleClick += new DataGridViewCellEventHandler(showDetail); this.window.buttonRight.Click += new EventHandler(showDetail); this.window.buttonCenter.Click += new EventHandler(showUpdate); this.window.buttonLeft.Click += new EventHandler(showAdd); this.window.buttonRight.Text = "Détail"; this.window.buttonCenter.Text = "Modifier"; this.window.buttonLeft.Text = "Ajouter"; this.window.Show(); }