public static InsertionTv CreateInsertionTv(PlanTV planTV, int numQuart, SupportTV supportTv,DateTime date) { var insertionTv = new InsertionTv() { Date = date,NumeroQuartHeure = numQuart,SupportTv = supportTv}; if (planTV.InsertionTvs == null) planTV.InsertionTvs = new List<InsertionTv>(); planTV.InsertionTvs.Add(insertionTv); return insertionTv; }
public float Get_Couv(IRepositoryVague<POCO.Donnees.Vague, Guid> vagueRepository, List<InsertionViewTv> insertionViewTvs, List<InsertionViewPr> insertionViewPrs, List<InsertionViewRd> insertionViewRds, Filter filter, POCO.Donnees.Vague vague) { var insertions=new List<InsertionTv>(); foreach (var insertionViewTv in insertionViewTvs) { var insertion = new InsertionTv(); insertion.Date = insertionViewTv.Start; int quart = int.Parse(((int)insertionViewTv.Start.TimeOfDay.TotalMinutes / 15).ToString()); quart = (quart + 76) % 96; var jour = (int)insertionViewTv.Start.DayOfWeek; jour = ((jour) % 7) + 1; insertion.NumeroQuartHeure = quart; insertion.SupportTv = insertionViewTv.SupportTv; insertions.Add(insertion); } var planTV = new PlanTV(){ Name = "test", InsertionTvs = insertions, id = Guid.NewGuid() }; var criterionTvSupport = new Criterion("planTv", planTV, CriteriaOperator.Equal); var criterionSignlalitiques = new Criterion("Signalitique", planTV.GetSignalitique(filter,vague), CriteriaOperator.Equal); var QueryTv = new Query(); QueryTv.Add(criterionTvSupport); QueryTv.Add(criterionSignlalitiques); var indicateur=vagueRepository.GetIndicateurRadioTele(QueryTv, vague); return indicateur.Gouverture; }
private static XpoInsertionTV MapInsertionTV(InsertionTv insertiontv, UnitOfWork uow) { var xpoInsertionTv = new XpoInsertionTV(uow); xpoInsertionTv.Date = insertiontv.Date; xpoInsertionTv.NumeroQuartHeure = insertiontv.NumeroQuartHeure; xpoInsertionTv.Oid = Guid.NewGuid(); xpoInsertionTv.SupportTV = uow.GetObjectByKey<XpoSupportTV>(insertiontv.SupportTv.id); if (insertiontv.Signalitique != null) foreach (var signalitique in insertiontv.Signalitique) { xpoInsertionTv.Signalitiques.Add(MapSignalitique(signalitique, uow)); } return xpoInsertionTv; }