Get Started in Minutes
This guide will help you set up and run the Canchas Deportivas booking system quickly. You’ll have a working application running locally with all core features operational.Prerequisites: Ensure you have .NET 8.0 SDK, SQL Server, and Visual Studio 2022 (or VS Code) installed on your machine.
Quick Setup
Restore Dependencies
Navigate to the solution directory and restore NuGet packages:The solution includes these packages:
Microsoft.Data.SqlClient(v6.1.2) - SQL Server data accessMicrosoft.VisualStudio.Web.CodeGeneration.Design(v8.0.7) - Code generation tools
Configure Database Connection
Update the connection string in
/source/capa_dato/CD_conexion.cs:capa_dato/CD_conexion.cs
Create Required Stored Procedures
The application uses stored procedures for data operations. Create the essential ones:
You’ll need to create similar stored procedures for Canchas and Clientes tables. See the Installation Guide for the complete set.
Build and Run
Build the presentation layer project and run the application:The application will start on
http://localhost:5000 (or the port specified in launchSettings.json).Understanding the Application Flow
Once running, here’s how the application works:View Reservations
Navigate to
/Reservas/ListarReservas to see all bookings with client names, field details, and time slotsCreate Booking
Use
/Reservas/InsertarReservas to create new reservations with dropdowns for clients and fieldsSearch Functionality
Use
/Reservas/BuscarReservaNombre to filter reservations by client nameManage Fields
Access
/Canchas to view and manage sports field configurationsKey Code Snippets
Here’s how the reservation controller lists bookings:capa_presentacion/Controllers/ReservasController.cs
capa_dato/CD_Reservas.cs
Common Issues and Solutions
Connection String Error
Connection String Error
If you see connection errors, verify:
- SQL Server is running
- Server name in connection string is correct
- Windows Authentication is enabled or use SQL Server authentication
- Firewall allows connections to SQL Server
Stored Procedure Not Found
Stored Procedure Not Found
Ensure all stored procedures are created in the correct database:You should see: SP_Reservas_List, SP_Reservas_Insert, SP_Reservas_Update, SP_Reservas_Delete
Build Errors
Build Errors
Make sure you have .NET 8.0 SDK installed:Should return 8.0.x or higher.
Port Already in Use
Port Already in Use
If port 5000 is occupied, modify the port in
Properties/launchSettings.json or let Kestrel assign a random port.Next Steps
Complete Installation
Set up all stored procedures, configure authentication, and production settings
Architecture Guide
Learn about the three-tier architecture and how components interact
API Reference
Explore all controllers, models, and data access methods
Database Setup
Configure your database and stored procedures
You now have a working Canchas Deportivas installation! Explore the application and check out the detailed guides for more advanced configurations.