private void FrmAILE_Load(object sender, EventArgs e) { m_EmployeeAILE = new Employeeaile(); // load AILE criteria combobox Ailecriteria aile = new Ailecriteria(); cboCritereAILE.DataSource = aile.GetList().Tables[0]; cboCritereAILE.DisplayMember = "ailecriteria"; cboCritereAILE.ValueMember = "ailecriteriaid"; // load Combobox TEAM Pworkgroup pworkgrp = new Pworkgroup(); cboEquipe.DataSource = pworkgrp.GetListByType((int)Pworkgroup.IEType.IE_T_Team).Tables[0]; cboEquipe.DisplayMember = "wkgname"; cboEquipe.ValueMember = "wkgid"; // get employee name for display Pemployee oPemployee = new Pemployee(); oPemployee.loadEmployee(m_EmplID); txtEmploye.Text = oPemployee.LName + " " + oPemployee.FName; // check open mode if (OpenMode == (int)IEOpenMode.IE_OM_Edit || OpenMode == (int)IEOpenMode.IE_OM_View) { m_EmployeeAILE.loadEmployeeAILE(m_EmployeeAileID); txtDateDebut.Value = m_EmployeeAILE.StartDate; txtDateFin.Value = m_EmployeeAILE.EndDate; txtMotif.Text = m_EmployeeAILE.Motif; txtTaux.Text = m_EmployeeAILE.Taux.ToString(); cboEquipe.SelectedValue = m_EmployeeAILE.WkgID; cboCritereAILE.SelectedValue = m_EmployeeAILE.AileCriteriaID; } if (OpenMode == (int)IEOpenMode.IE_OM_Add) { cmdSauver.Text = "Ajouter"; this.Text = "Ajout d'une nouvelle configuration AILE"; } }
private void cmdSupprimerAILE_Click(object sender, EventArgs e) { if (grdAILE.SelectedRows.Count != 1) { return; } int selectedEmployeeAileID = Convert.ToInt32(grdAILE["employeeAILEid", grdAILE.SelectedRows[0].Index].Value); int selectedWkgID = Convert.ToInt32(grdAILE["wkgid", grdAILE.SelectedRows[0].Index].Value); Employeeaile oEmployeeAILE = new Employeeaile(); oEmployeeAILE.loadEmployeeAILE(selectedEmployeeAileID); oEmployeeAILE.Delete(); MessageBox.Show("Configuration AILE supprimée avec succès !", "Team Editor"); // reload gridAILE LoadGridAILE(); }