private void validateToDisplayInstance(long pGroupId, DateTime pDrawDate) { SaleValidator saleValidator = new SaleValidator(); bool existingFactor = saleValidator.validatePrizeFactorAsync(pGroupId); if (existingFactor) { // Verificar si el sorteo está cerrado if (saleValidator.isClosingDraw(pGroupId, pDrawDate)) { // Warning: no se puede vender si el sorteo está cerrado ConcreteMessageService.displayDrawClosedMessage(); //this.appMediator.updateBoxNumber(0); this.updateNumberBox(pDrawDate, pGroupId); this.appMediator.setApplicationFocus(); } else { this.updateBoxAndDisplayListInstance(pGroupId); } } else { // Error: Factor de premio no especificado para el sorteo ConcreteMessageService.displayPrizeFactorNotFoundMessage(); this.appMediator.updateBoxNumber(0); this.appMediator.setApplicationFocus(); } }
public void validateToDisplayListScreen(long pGroupId, DateTime pDrawDate) { SaleValidator saleValidator = new SaleValidator(); bool existingFactor = saleValidator.validatePrizeFactorAsync(pGroupId); if (existingFactor) { bool needValidateOperation = this.type == SystemConstants.COPY_LIST_CODE || this.type == SystemConstants.ERASER_LIST_CODE; // Verificar si el sorteo está cerrado if (needValidateOperation && saleValidator.isClosingDraw(pGroupId, pDrawDate)) { // Error: no se puede operar si el sorteo está cerrado ConcreteMessageService.displayDrawClosedMessage(); this.appMediator.updateBoxNumber(0); this.appMediator.setApplicationFocus(); } else { this.displayScreenByType(pGroupId, pDrawDate); } } else { // Error: Factor de premio no especificado para el sorteo ConcreteMessageService.displayPrizeFactorNotFoundMessage(); this.appMediator.updateBoxNumber(0); this.appMediator.setApplicationFocus(); } }