private void fillFieldsWithProjet(cProjet projet) { txtCodeProjet.Text = projet.codeProjet; txtNomProjet.Text = projet.nomProjet; ListItem lst = new ListItem(); if (projet.chefProjet != null) { Employe chefProjet = CtrlEmploye.getEmployeById(projet.chefProjet); lst.Text = chefProjet.prenomEmploye + " " + chefProjet.nomEmploye; txtChefProjet.SelectedIndex = txtChefProjet.Items.IndexOf(lst); } else { lst = new ListItem(); lst.Text = "Aucun"; txtChefProjet.SelectedIndex = txtChefProjet.Items.IndexOf(lst); } if (projet.dateCreation != null) { txtDateCreationProjet.Text = ((DateTime)projet.dateCreation).ToShortDateString(); } if (projet.dateLivraison != null) { txtDateLivraisonProjet.Text = ((DateTime)projet.dateLivraison).ToShortDateString(); } if (projet.VersionJeu != null) { lst = new ListItem(); lst.Text = projet.VersionJeu.cJeu.nomJeu; txtJeuProjet.SelectedIndex = txtJeuProjet.Items.IndexOf(lst); lst = new ListItem(); lst.Text = projet.VersionJeu.nomVersionJeu; txtVersionJeuProjet.Items.Add(lst); txtVersionJeuProjet.SelectedIndex = txtVersionJeuProjet.Items.IndexOf(lst); } else { lst = new ListItem(); lst.Text = "Aucun"; txtJeuProjet.SelectedIndex = txtChefProjet.Items.IndexOf(lst); } rtxtDescriptionProjet.Text = projet.descProjet; rtxtObjectifProjet.Text = projet.objProjet; rtxtDiversProjet.Text = projet.divProjet; }
private void fillDataGridViewCasTest(cProjet projet) { if (projet.CasTest.Count != 0) { //Nombre de page pour la table des cas de tests double page = (double)projet.CasTest.Count / 5; int nbPage = Convert.ToInt16(Math.Ceiling(page)); //Savoir sil faut afficher plus d'une page dans la table if (nbPage < 2) { dataGridPagination.Visible = false; fillTableCasTest(0, projet.CasTest.ToList(), 1); } else { //Plus de 5 cas de test donc plusieur page de cas test //Index pour la liste des cas test indexTableCasTest = Convert.ToInt16(Request.QueryString["index"]); //Pagination visible dataGridPagination.Visible = true; //Emplissage de la table fillTableCasTest(indexTableCasTest, projet.CasTest.ToList(), nbPage); } } else { showEmptyDataGrid(); } }