Exemplo n.º 1
0
 public SortieController()
 {
     this.sortieParSemaineRepository = new SortieParSemaineRepository(new ExcursionContext());
     this.periodeRepository          = new PeriodeRepository(new ExcursionContext());
     this.prixRepository             = new PrixRepository(new ExcursionContext());
     this.excursionRepository        = new ExcursionRepository(new ExcursionContext());
     this.typeExcRepository          = new TypeExcRepository(new ExcursionContext());
     this.jourRepository             = new JourRepository(new ExcursionContext());
 }
Exemplo n.º 2
0
 public ExcursionController()
 {
     this.zoneRepository           = new ZoneRepository(new ExcursionContext());
     this.excursionRepository      = new ExcursionRepository(new ExcursionContext());
     this.userRepository           = new UserRepository(new ExcursionContext());
     this.periodeRepository        = new PeriodeRepository(new ExcursionContext());
     this.prixRepository           = new PrixRepository(new ExcursionContext());
     this.excursionThemeRepository = new ExcursionThemeRepository(new ExcursionContext());
     this.themeRepository          = new ThemeRepository(new ExcursionContext());
 }
Exemplo n.º 3
0
        public void EnsurePeriodenExist_Should_Create_New_Entries_If_Not_Exist()
        {
            // Arrange
            using var context = new CompetentieAppFrontendContext(_options);
            var repository = new PeriodeRepository(context);

            // Act
            var result = repository.EnsurePeriodenExist(new List <Periode>
            {
                new Periode
                {
                    PeriodeNummer = 5
                }
            });

            // Assert
            Assert.IsTrue(result.Any(id => id == 5));
        }
Exemplo n.º 4
0
        public void EnsurePeriodenExist_Should_Return_Typeof_IEnumerable_Of_Long()
        {
            // Arrange
            using var context = new CompetentieAppFrontendContext(_options);
            var repository = new PeriodeRepository(context);

            // Act
            var result = repository.EnsurePeriodenExist(new List <Periode>
            {
                new Periode
                {
                    PeriodeNummer = 1
                }
            });

            // Assert
            Assert.IsInstanceOfType(result, typeof(IEnumerable <long>));
        }
        public ActionResult ReadPeriodes()
        {
            IList <PeriodeModels> models = new List <PeriodeModels>();

            using (PeriodeRepository repository = new PeriodeRepository())
            {
                IQueryable <Periods> c = repository.All();

                models = repository.All().Select(x => new PeriodeModels
                {
                    id     = x.Id,
                    begin  = x.Begin,
                    end    = x.End,
                    yearId = x.Year_Id,
                    year   = x.Years.Year
                }).ToList();
            }
            return(View(models));
        }
        public ActionResult ReadPeriode(Guid id)
        {
            PeriodeModels model;

            using (PeriodeRepository repository = new PeriodeRepository())
            {
                Periods p = repository.GetPeriodById(id);
                IQueryable <Evaluations> e = repository.GetEvaluationsByPeriodId(id);
                model = new PeriodeModels
                {
                    id          = p.Id,
                    begin       = p.Begin,
                    end         = p.End,
                    yearId      = p.Year_Id,
                    year        = p.Years.Year,
                    evaluations = getListEvaluations(e)
                };
            }
            return(View(model));
        }
Exemplo n.º 7
0
 public PeriodeController()
 {
     this.periodeRepository = new PeriodeRepository(new ExcursionContext());
 }