public void UpdateExistingSquashVenue(SquashVenue squashVenue)
        {
            var _existingSquashVenue = GetSquashVenueById(squashVenue.SquashVenueId);

            _existingSquashVenue.Name            = squashVenue.Name;
            _existingSquashVenue.CourtsAvailable = squashVenue.CourtsAvailable;

            _context.SaveChanges();
        }
Exemplo n.º 2
0
        public SquashVenue SquashVenue()
        {
            SquashVenue sv = new SquashVenue();

            sv.SquashVenueId   = SquashVenueId;
            sv.Name            = Name;
            sv.CourtsAvailable = CourtsAvailable;

            return(sv);
        }
 public void UpdateSquashVenue(SquashVenue squashVenue)
 {
     if (squashVenue.SquashVenueId == 0)
     {
         CreateNewSquashVenue(squashVenue);
     }
     else
     {
         UpdateExistingSquashVenue(squashVenue);
     }
 }
        public void AddTournamentSquashVenue(int tournamentId, int squashVenueId)
        {
            Tournament            t  = _tournamentManagement.GetTournamentById(tournamentId);
            SquashVenue           sv = _squashVenueManagement.GetSquashVenueById(squashVenueId);
            TournamentSquashVenue tournamentSquashVenue = new TournamentSquashVenue()
            {
                Tournament  = t,
                SquashVenue = sv
            };

            _context.Add(tournamentSquashVenue);
            _context.SaveChanges();
        }
Exemplo n.º 5
0
 public SquashVenueVm(SquashVenue squashVenue)
 {
     SquashVenueId   = squashVenue.SquashVenueId;
     Name            = squashVenue.Name;
     CourtsAvailable = squashVenue.CourtsAvailable;
 }
 public void CreateNewSquashVenue(SquashVenue squashVenue)
 {
     _context.Add(squashVenue);
     _context.SaveChanges();
 }
        public SquashVenue GetSquashVenueById(int squashVenueId)
        {
            SquashVenue squashVenue = _context.SquashVenues.SingleOrDefault(s => s.SquashVenueId == squashVenueId);

            return(squashVenue);
        }