Beispiel #1
0
        /// <summary>
        /// Ajout d'un Item dans la ListView
        /// </summary>
        /// <param name="itemEcole">object Ecole</param>
        public void addItemInLstView(Ecole itemEcole)
        {
            itemEcole.setSaison(this._saison, _prevSaison);
            string colDate;
            string colDatePrevious;
            if (!itemEcole.isSchedule) { colDate = ""; }
            else { colDate = itemEcole._planifEnCours.StartDate.ToString("yyyy-MM-dd"); }
            colDatePrevious = "";
            if (itemEcole._planifPrevious != null) { colDatePrevious = itemEcole._planifPrevious.StartDate.ToString("yyyy-MM-dd"); }

            string namePhoto;
            if (itemEcole._planifEnCours == null) { namePhoto = String.Empty; }
            else { namePhoto = p_applClass.Param.GetNamePhotoGrapheFromId(itemEcole._planifEnCours.IdPhotographe); }

            ListViewItem item = new ListViewItem(new[] { itemEcole.getFlag(), itemEcole.Libelle, itemEcole.Ville, colDate, namePhoto, itemEcole.IdEcole, colDatePrevious});
            item.Name = itemEcole.IdEcole;
            item.ToolTipText = itemEcole.Libelle;
            this.getColorFromScheduleStatus(itemEcole, ref item);
            lstToSchedule.Items.Add(item);
        }
Beispiel #2
0
        /// <summary>
        /// Mise à jour d'un Item dans la ListView
        /// </summary>
        /// <param name="_"></param>
        private void updateItemInLstView(Ecole itemEcole)
        {
            itemEcole.setSaison(this._saison, _prevSaison);
            ListViewItem itemLstView = lstToSchedule.Items[itemEcole.IdEcole];
            if (!itemEcole.isSchedule) { itemLstView.SubItems[colDate.Index].Text = String.Empty; }
            else { itemLstView.SubItems[colDate.Index].Text = itemEcole._planifEnCours.StartDate.ToString("yyyy-MM-dd"); }
            if (itemEcole._planifPrevious != null) { itemLstView.SubItems[colDatePrevious.Index].Text = itemEcole._planifPrevious.StartDate.ToString("yyyy-MM-dd"); }
            else { itemLstView.SubItems[colDatePrevious.Index].Text = String.Empty; }

            itemLstView.SubItems[colFlag.Index].Text = itemEcole.getFlag();
            this.getColorFromScheduleStatus(itemEcole, ref itemLstView);
            if (itemEcole._planifEnCours == null) { itemLstView.SubItems[colPhoto.Index].Text = String.Empty; }
            else { itemLstView.SubItems[colPhoto.Index].Text = p_applClass.Param.GetNamePhotoGrapheFromId(itemEcole._planifEnCours.IdPhotographe); }

            itemLstView.SubItems[colName.Index].Text = itemEcole.Libelle;
            itemLstView.SubItems[colVille.Index].Text = itemEcole.Ville;
        }