Exemple #1
0
 public void addControls()
 {
     //LotteryListControl lotteryListControl = new LotteryListControl();
     lotteryListControl          = new LotteryListControl();
     lotteryListControl.TabIndex = 0;
     lotteryListControl.Focus();
     //lotteryListControl.resetCurrentCell();
     this.listInstanceMainPanel.Controls.Add(lotteryListControl);
     this.listInstanceMainPanel.Focus();
 }
Exemple #2
0
        private void focusList()
        {
            this.listInstanceMainPanel.Focus();
            LotteryListControl listControl = this.getCurrentListControl();

            if (listControl != null)
            {
                listControl.Focus();
            }
        }
Exemple #3
0
        private LotteryListControl getCurrentListControl()
        {
            LotteryListControl list = null;

            if (this.listInstanceMainPanel.Controls.Count > 0)
            {
                list = this.listInstanceMainPanel.Controls.OfType <LotteryListControl>().First();
            }
            else
            {
                //MessageBox.Show("ERROR: Desplegando la instancia");
            }
            return(list);
        }
Exemple #4
0
        public void createList()
        {
            this.appMediator.setAppTopMost(true);
            this.setEnabledButtonsAndMenu(false);
            // Cerrar y liberar memoria de formulario de selección si no es nulo
            if (this.listSelectorFormParent != null)
            {
                this.listSelectorFormParent.Dispose();
            }
            // Si existe un option menu abierto, cerrarlo
            if (this.mainOptionMenu != null)
            {
                this.mainOptionMenu.Hide();
            }
            // Guardar la lista de manera local
            LotteryListControl          listControl           = this.listInstanceMainPanel.Controls.OfType <LotteryListControl>().First();
            List <LND_ListNumberDetail> savedNumberDetailList = this.saveList(listControl);

            // Imprimir solamente si la impresora está habilitada
            if (UtilityService.printerEnabled())
            {
                ticketPrintService.printList(this.list);
            }
            // ***Actualizar NumberBox si no es nula
            if (this.numberBoxFormParent != null)
            {
                //this.numberBoxFormParent.updateNumberBox(this.drawType.LDT_Id);
            }
            // Sincronizar con el servidor, solamente si los servicios están habilitados
            if (UtilityService.realTimeSyncEnabled())
            {
                this.sendListNumberToServer(savedNumberDetailList);
            }
            // TODO: Cambiar todos los registros de QR a pendiente / Creo que ya no se necesita

            this.Dispose();
            // Actualizar BoxNumber y mostrar en pantalla resultado de la venta
            //this.appMediator.updateBoxNumber(this.drawType.LDT_Id);
            this.appMediator.setBoxNumberGroup(0);
            this.appMediator.displayNumberBox(this.drawDate, this.drawType.LDT_Id, true);
            this.appMediator.setAppTopMost(false);
            // Limpiar y reestablecer el ListControl
            //this.resetFormList();
            //this.focusList();
        }
Exemple #5
0
        private void processMenuRequest(/*KeyEventArgs pEvent*/)
        {
            // Actualizar la estructura de lista antes de desplegar menú de opciones
            LotteryListControl listControl = this.getCurrentListControl();

            if (listControl != null)
            {
                listControl.getList().EndEdit();
                if (this.mainOptionMenu != null)
                {
                    this.mainOptionMenu.Dispose();
                }
                // Desplegar menú de opciones
                this.mainOptionMenu = new MainOptionMenu(this.appMediator, this);
                mainOptionMenu.ShowDialog(this);
                //pEvent.SuppressKeyPress = true;
            }
        }
Exemple #6
0
        public void processList()
        {
            LotteryListControl listControl = this.getCurrentListControl();

            // Validar si la lista tiene datos
            if (listControl.loteryList.tupleList.Count == 0)
            {
                this.setEnabledButtonsAndMenu(true);
                MessageBox.Show("La lista no tiene datos");
                //this.togglePrintListButton();
            }
            else
            {
                //this.mainOptionMenu.Dispose();
                ListNameForm listNameForm = new ListNameForm(this);
                listNameForm.ShowDialog();
            }
        }
Exemple #7
0
        private List <LND_ListNumberDetail> saveList(LotteryListControl pListControl)
        {
            LotteryDrawRepository lotteryDrawRepository = new LotteryDrawRepository();
            // Crear y guardar nuevo sorteo
            LTD_LotteryDraw drawToSave = new LTD_LotteryDraw();

            drawToSave.LTD_CreateDate        = this.drawDate;
            drawToSave.LDT_LotteryDrawType   = this.drawType.LDT_Id;
            drawToSave.LDS_LotteryDrawStatus = SystemConstants.DRAW_STATUS_OPENED;
            lotteryDrawRepository.save(ref drawToSave);
            // Crear y guardar nueva lista
            LTL_LotteryList listToSave = new LTL_LotteryList();

            listToSave.LPS_LotteryPointSale = UtilityService.getPointSale().LPS_Id;
            listToSave.LTD_LotteryDraw      = drawToSave.LTD_Id;
            listToSave.LTL_CustomerName     = this.customerName;
            this.printDate                   = DateTime.Now;
            listToSave.LTL_CreateDate        = this.printDate;
            listToSave.LLS_LotteryListStatus = SystemConstants.LIST_STATUS_CREATED;
            listToSave.SYS_SynchronyStatus   = SystemConstants.SYNC_STATUS_PENDING_TO_SERVER;
            lotteryDrawRepository.saveList(ref listToSave);
            this.list = listToSave;
            // Crear colección y guardar a nivel local detalle de números de la lista
            List <LND_ListNumberDetail> numberDetailCollection = new List <LND_ListNumberDetail>();
            LotteryNumberRepository     numberRepository       = new LotteryNumberRepository();

            foreach (var register in pListControl.loteryList.tupleList)
            {
                LND_ListNumberDetail newListNumberDetail = new LND_ListNumberDetail();
                newListNumberDetail.LTL_LotteryList   = listToSave.LTL_Id;
                newListNumberDetail.LND_Id            = register.Key;
                newListNumberDetail.LNR_LotteryNumber = numberRepository.getByNumberCode(register.Value.number).LNR_Id;
                newListNumberDetail.LND_SaleImport    = register.Value.import;
                lotteryDrawRepository.saveListDetail(ref newListNumberDetail);
                numberDetailCollection.Add(newListNumberDetail);
            }
            // Almacenar la colección de números generada
            //this.numberDetail = numberDetailCollection;
            return(numberDetailCollection);
        }