Overview
The Canchas Deportivas application uses SQL Server as its database management system. The database is namedDB_canchasdeportivas and contains tables for managing users, clients, courts (canchas), and reservations.
Database Tables
Usuarios (Users)
Stores system user accounts with authentication credentials.| Column | Type | Description |
|---|---|---|
| IdUsuario | int | Primary key, auto-increment |
| Nombre | nvarchar | Username for authentication |
| Clave | nvarchar | Password (hashed) |
| Estado | bit | Active status (true/false) |
CE_usuarios
Clientes (Clients)
Stores client information for making reservations.| Column | Type | Description |
|---|---|---|
| IdCliente | int | Primary key, auto-increment |
| Nombre | nvarchar | Client full name |
| Telefono | nvarchar | Contact phone number |
| Correo | nvarchar | Email address |
| Estado | bit | Active status (true/false) |
CE_Clientes
Canchas (Courts)
Stores sports court information with pricing.| Column | Type | Description |
|---|---|---|
| IdCancha | int | Primary key, auto-increment |
| Nombre | nvarchar | Court name |
| Tipo | nvarchar | Type of court (e.g., futbol, basketball) |
| PrecioPorHora | decimal | Hourly rental price |
| Estado | nvarchar | Court status |
CE_Canchas
Reservas (Reservations)
Stores court reservations with time slots.| Column | Type | Description |
|---|---|---|
| IdReserva | int | Primary key, auto-increment |
| IdCancha | int | Foreign key to Canchas table |
| IdCliente | int | Foreign key to Clientes table |
| IdUsuario | int | Foreign key to Usuarios table |
| FechaReserva | datetime | Reservation date |
| HoraInicio | time | Start time |
| HoraFin | time | End time |
| Comentario | nvarchar | Additional notes |
| Estado | bit | Active status (true/false) |
CE_Reservas
Relationships
- Reservas has foreign key relationships to:
- Canchas (IdCancha) - One court can have many reservations
- Clientes (IdCliente) - One client can make many reservations
- Usuarios (IdUsuario) - One user can create many reservations
Entity Relationships Diagram
Data Access Layer
The application uses a three-tier architecture with dedicated data access classes:CD_Usuarios- User data operationsCD_Clientes- Client data operationsCD_Canchas- Court data operationsCD_Reservas- Reservation data operationsCD_TiposReservas- Reservation types operations
CD_conexion for database connectivity.