Overview
TheCN_Canchas class provides business logic operations for managing sports courts in the system. It acts as an intermediary between the presentation layer and the data layer (CD_Canchas), handling court-related business rules and operations.
Namespace: capa_negocio
Dependencies:
capa_entidad.CE_Canchas- Court entity modelcapa_dato.CD_Canchas- Data access layer for courts
Class Definition
Methods
ListarCanchas
Retrieves a list of all sports courts from the database.A list of all courts in the system
CD_Canchas.Listar() which executes the stored procedure SP_Canchas_List.
AgregarCancha
Adds a new sports court to the system.The court object containing:
Nombre(string) - Court nameTipo(string) - Court type (e.g., “Fútbol”, “Tenis”)PrecioPorHora(decimal) - Price per hour
CD_Canchas.AgregarCancha() which executes the stored procedure SP_Canchas_Insert with the following parameters:
@Nombre@Tipo@PrecioPorHora
Actualizar
Updates an existing sports court’s information.The court object with updated values:
IdCancha(int) - Court ID to updateNombre(string) - Updated court nameTipo(string) - Updated court typePrecioPorHora(decimal) - Updated price per hour
CD_Canchas.ActualizarCancha() which executes the stored procedure SP_Canchas_Update with parameters:
@IdCancha@Nombre@Tipo@PrecioPorHora
Eliminar
Deletes a sports court from the system.The ID of the court to delete
CD_Canchas.EliminarCancha() which executes the stored procedure SP_Canchas_Delete with parameter @Id.
Entity Model
TheCE_Canchas entity used by this business logic class:
Related Components
- CD_Canchas - Data access layer
- CE_Canchas - Entity model