private void listeOffres_SelectedIndexChanged(object sender, EventArgs e) { txtCommentaire.Clear(); libNote.Hide(); txtBonusMalus.Clear(); string value = listeOffres.SelectedItem.ToString(); string id = ""; bool stop = false; foreach (Char c in value) { if (c != '-' && !stop) { id += c; } else { stop = true; } } this.idOffre = int.Parse(id); tableauEvaluation.Rows.Clear(); foreach (KeyValuePair <string, int> kvp in DAOCritere.GetCritereCoeff(idOffre)) { tableauEvaluation.Rows.Add(kvp.Key, kvp.Value); } listeCandidats.Items.Clear(); foreach (Candidature candidature in DAOEvaluation.GetCandidature(idOffre)) { listeCandidats.Items.Add(candidature.GetIdCand().ToString() + "-" + candidature.GetNom() + candidature.GetPrenom()); } //beuge à modifier listeCandidats.SelectedIndex = 0; }
private void bttnSupprimer_Click(object sender, EventArgs e) { //on récupère l'index de l'offre int index = this.OffreCritere.CurrentRow.Index; DAOCritere.SupprimerCritere(OffreCritere.CurrentRow.Cells["Critères"].Value.ToString(), int.Parse(listBoxOffreID.Items[listBoxOffre.SelectedIndex].ToString())); }
private void buttonModifier_Click(object sender, EventArgs e) { groupBoxModifierCritere.Visible = true; foreach (KeyValuePair <string, int> c in DAOCritere.ModifierCritere(OffreCritere.CurrentRow.Cells["Critères"].Value.ToString(), idOffre)) { textBoxNom.Text = c.Key; textBoxCoeff.Text = c.Value.ToString(); } }
private void buttonAjouter_Click(object sender, EventArgs e) { string libelle = txtNom.Text; string coeffText = txtCoeff.Text; int coeff; if (coeffText != "" && libelle != "") { coeff = int.Parse(coeffText); Critere unCritere = new Critere(libelle); Associer uneAssociation = new Associer(coeff); DAOCritere.AjoutCritere(unCritere, uneAssociation, idOffre); Valider.Visible = true; Valider.Text = "Envoyé !"; } else { MessageBox.Show("Vous devez completer tout les champs !"); } this.Close(); }
private void buttonModifierCritere_Click_1(object sender, EventArgs e) { string coeffText = textBoxCoeff.Text; int coeff; if (coeffText != "") { try { coeff = int.Parse(coeffText); DAOCritere.ModifCoeff(textBoxNom.Text, int.Parse(textBoxCoeff.Text)); groupBoxModifierCritere.Visible = false; } catch { MessageBox.Show("Le coefficient doit être un numérique !"); } } else { MessageBox.Show("Vous devez completer tout les champs !"); } }
private void listBoxOffre_SelectedIndexChanged(object sender, EventArgs e) { OffreCritere.Rows.Clear(); string value = listBoxOffre.SelectedItem.ToString(); string id = ""; bool stop = false; foreach (Char c in value) { if (c != '-' && !stop) { id += c; } else { stop = true; } } this.idOffre = int.Parse(id); foreach (Critere c in DAOCritere.GetLesCriteresByOffre(idOffre)) { OffreCritere.Rows.Add(c.GetLibelle()); } }