/// <summary>
        /// Récupère la liste des commentaires sur la liste d'une personne pour un événement donné
        /// </summary>
        /// <param name="evt"></param>
        /// <param name="personneListe"></param>
        /// <returns></returns>
        public List <Commentaire> chargerCommentaires(Evenement evt, Personne personneListe)
        {
            Commentaires comm = new Commentaires();

            List <Commentaire> listeRetour = new List <Commentaire>();

            DataTable comments = new DataTable();

            comments = comm.getCommentairesByPersonneListe(personneListe.id_personne, evt.id_evenement);

            if (comments != null)
            {
                for (int i = 0; i < comments.Rows.Count; i++)
                {
                    Commentaire unComm = new Commentaire();
                    unComm.commentaire   = StringUtils.replaceSautDeLignePourHTML(comments.Rows[i].ItemArray.GetValue(0).ToString());
                    unComm.id_auteur     = int.Parse(comments.Rows[i].ItemArray.GetValue(1).ToString());
                    unComm.ecrit_par     = comments.Rows[i].ItemArray.GetValue(2).ToString();
                    unComm.date_creation = DateTime.Parse(comments.Rows[i].ItemArray.GetValue(3).ToString());
                    if (comments.Rows[i].ItemArray.GetValue(4) != null && "" != comments.Rows[i].ItemArray.GetValue(4).ToString())
                    {
                        unComm.date_modification = DateTime.Parse(comments.Rows[i].ItemArray.GetValue(4).ToString());
                    }
                    unComm.deleted = Boolean.Parse(comments.Rows[i].ItemArray.GetValue(5).ToString());;

                    listeRetour.Add(unComm);
                }
            }

            return(listeRetour);
        }
예제 #2
0
        protected void chargerCommentaires()
        {
            Commentaires comm = new Commentaires();

            DataTable nbComm = new DataTable();

            nbComm = comm.getNbCommentairesByListe(int.Parse(listePersonnes.SelectedItem.Value));

            lbl_nbCommentaires.Text = nbComm.Rows[0].ItemArray.GetValue(0).ToString() + " commentaires : ";

            DataTable comments = new DataTable();

            comments = comm.getCommentairesByPersonneListe(int.Parse(listePersonnes.SelectedItem.Value));

            gridView_Commentaires.DataSource = comments;
            gridView_Commentaires.DataBind();
        }
예제 #3
0
        protected void chargerCommentaires()
        {
            Commentaires comm = new Commentaires();

            String id_evenement = ViewState["evenementId"].ToString();

            DataTable nbComm = new DataTable();

            nbComm = comm.getNbCommentairesByListe(int.Parse(listeParticipantAyantListe.SelectedItem.Value), int.Parse(id_evenement));

            lbl_nbCommentaires.Text = nbComm.Rows[0].ItemArray.GetValue(0).ToString() + " commentaires : ";

            DataTable comments = new DataTable();

            comments = comm.getCommentairesByPersonneListe(int.Parse(listeParticipantAyantListe.SelectedItem.Value), int.Parse(id_evenement));

            gridView_Commentaires.DataSource = comments;
            gridView_Commentaires.DataBind();
        }