Exemplo n.º 1
0
        public void OnPost()
        {
            RenterRepository renterRepository = new RenterRepository();

            Message = renterRepository.InsertRenter(Renter);
            Renters = renterRepository.GetRenters();
        }
Exemplo n.º 2
0
        public RentersModel()
        {
            RenterRepository renterRepository = new RenterRepository();
            RentalRepository rentalRepository = new RentalRepository();

            Renters = renterRepository.GetRenters();
            Rentals = rentalRepository.GetAllRentals();

            foreach (Rental rental in Rentals)
            {
                rental.Renter.Rentals = rentalRepository.GetRentalsFor(rental.Renter.Id);
            }

            foreach (Renter renter in Renters)
            {
                renter.Rentals = rentalRepository.GetRentalsFor(renter.Id);
            }
        }
Exemplo n.º 3
0
        public RentersModel()
        {
            RenterRepository renterRepository = new RenterRepository();

            Renters = renterRepository.GetRenters();
            List <RenterLevel> RenterLevelList = new List <RenterLevel>()
            {
                RenterLevel.Starter, RenterLevel.Normal, RenterLevel.TopRenter
            };

            RenterLevels = new List <Renter>();
            foreach (RenterLevel renterLevel in RenterLevelList)
            {
                RenterLevels.Add(new Renter()
                {
                    RenterLevel = renterLevel
                });
            }
            Heading = "Oversigt over lånere";
        }
 public RentersModel()
 {
     Renters = RenterRepository.GetRenters();
 }