public void experience_proc() { Class_experience ce = new Class_experience(); ce.date_debut = dateTimePicker_exp_debut.Value; ce.date_fin = dateTimePicker_exp_fin.Value; ce.enCours = metroCheckBox_enCours_exp_add.Checked; ce.poste = metroTextBox_Poste.Text; ce.Service = metroTextBox_service.Text; ce.entreprise = metroTextBox_entreprise.Text; ce.secteur_activite = metroTextBox_secteur_activite.Text; ce.ville = metroTextBox_ville.Text; ce.type = metroComboBox_type_experience.SelectedItem.ToString(); Program.new_candidat_to_add.ses_experiences.Add(ce); }
public void afficher_experience() { foreach (int i in experience_ids) { Class_experience exp = Class_Database_app.get_experience_by_id(i); string experience = exp.entreprise + "\t" + exp.poste + "\t" + exp.secteur_activite + "\n"; experience += exp.ville + "\t" + exp.type + "\t" + exp.Service + "\n"; if (exp.enCours) { experience += exp.date_debut.ToString() + " \t enCours \n"; } else { experience += exp.date_debut.ToString() + "\t" + exp.date_fin.ToString() + "\n"; } richTextBox_experience.Text += experience; } }
public static Class_experience get_experience_by_id(int id) { Class_experience experience = new Class_experience(); try { if (connection_x.State != ConnectionState.Open) { connection_x.Open(); } string query = "select x.DateDebut,x.DateFin,x.Encours,x.entreprise,x.Poste,x.secteur_activite,x.Service_,x.type_,x.ville from experience x where x.ID_experience = "; query += id.ToString(); SqlCommand command3 = new SqlCommand(query, connection_x); SqlDataReader reader = command3.ExecuteReader(); while (reader.Read()) { experience.date_debut = (DateTime)reader[0]; experience.date_fin = (DateTime)reader[1]; int x = (int)reader[2]; if (x == 0) { experience.enCours = false; } else { experience.enCours = true; } experience.entreprise = reader[3].ToString(); experience.poste = reader[4].ToString(); experience.secteur_activite = reader[5].ToString(); experience.Service = reader[6].ToString(); experience.type = reader[7].ToString(); experience.ville = reader[8].ToString(); } connection_x.Close(); } catch (Exception t) { MessageBox.Show(t.ToString()); } return(experience); }