public CObjetDonneeAIdNumerique GetElementLieRole(string strCodeRole) { string strCode = strCodeRole.ToUpper(); foreach (CRelationEntreeAgenda_ElementAAgenda rel in RelationsElementsAgenda) { CRoleSurEntreeAgenda role = rel.RelationTypeEntree_TypeElement.Role; if (role != null && role.Code.ToUpper() == strCode) { return(rel.ElementLie); } } return(null); }
/// ///////////////////////////////////////////////////////////// public CVisuEntreeAgenda[] GetVisusBetween(CObjetDonneeAIdNumerique elementLie, CRoleSurEntreeAgenda role, DateTime dtDebut, DateTime dtFin, bool bAvecDesactivations) { ArrayList lst = new ArrayList(); CPlanificationTache planif = PlanificationCyclique; TimeSpan sp = DateFin - DateDebut; if (SansHoraire) { sp = new TimeSpan((int)sp.TotalDays, 0, 0, 0, 0); } CListeObjetsDonnees liste = Desactivations; if (planif != null) { DateTime dt = planif.GetNextOccurence(DateDebut, true); DateTime dtLimite = dtFin; if (DateFinCyclique != null && (DateTime)DateFinCyclique < dtFin) { dtLimite = DateFinCyclique; } while (dt < dtLimite) { if (bAvecDesactivations) { liste.Filtre = new CFiltreData(CDesctivationEntreeAgendaCyclique.c_champDate + ">=@1 and " + CDesctivationEntreeAgendaCyclique.c_champDate + "<@2", dt.Date, dt.Date.AddDays(1)); } if (dt >= dtDebut && (!bAvecDesactivations || liste.Count == 0)) { lst.Add(new CVisuEntreeAgenda(this, role, elementLie, dt, dt.Add(sp))); } dt = planif.GetNextOccurence(dt, false); } } return((CVisuEntreeAgenda[])lst.ToArray(typeof(CVisuEntreeAgenda))); }