1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
   |  
//for each days ...
for (int i = 0; i < nbDays; i++)
        {
            //Création du UC PanelJournee
            ucPanelJournee pj;
            pj = ((ucPanelJournee)this.LoadControl("./ucPanelJournee.ascx"));
            string strId = "ucPanelJournee_" + i.ToString();
            pj.ID = strId;
            pj.EnableViewState = true;
 
            //Abonnement aux evenements
            pj.Attributes.Add("runat", "server");
            pj.click += new ucPanelJournee.monClickEvent(this.craDaySelected);
 
 
            //Mapping NHibernate : récupe des infos en BDD
            MappingResources.JourneeActivite currentJourneeActivite;
            ArrayList journeesActivites = journeeActiviteManager.findByEmployeAndByDate(this.userId, currentDate);
 
            //
            pj.JourneesActivites = journeesActivites;
 
 
            //Mise en page de l'UC créé
            if (iCell >= nbMaxCell)
            {
                tr = new TableRow();
                htmlTable.Rows.Add(tr);
                iRow++;
                iCell = 0;
            }
            tc = new TableCell();
            tc.ID = "tc" + i.ToString();
            htmlTable.Rows[iRow].Cells.Add(tc);
            tc.Controls.Add(pj);
            htmlTable.Rows[iRow].Cells.Add(tc);
            iCell++;
        } | 
Partager