예제 #1
0
파일: LoginForm.cs 프로젝트: melfallas/SILO
        private void showSalePointName()
        {
            LPS_LotteryPointSale posInstance = ParameterService.getSystemSalePoint();

            if (posInstance != null)
            {
                this.posNameLabel.Text = "SUCURSAL " + posInstance.LPS_DisplayName;
            }
        }
예제 #2
0
        public static string getPosConfirmMessage(AUS_ApplicationUser pAppUser, LPS_LotteryPointSale pSalePoint)
        {
            string message = "";

            message += POS_CONFIRM_MESSAGE1 + pAppUser.AUS_Username.ToUpper() + "\n";
            message += POS_CONFIRM_MESSAGE2;
            message += "Sucursal #" + pSalePoint.LPS_Id + " - " + pSalePoint.LPS_DisplayName + "\n\n";
            message += POS_CONFIRM_MESSAGE3;
            return(message);
        }
예제 #3
0
        // Método para imprimir la lista de los números premiados y ganadores
        public void printPrizeTicket(LTD_LotteryDraw pDraw, string[] pWinningNumberArray, bool pSendToPrint, bool pShowInPanel)
        {
            // Configurar impresión para Ticket de Venta
            TicketPrinter ticketPrinter = new TicketPrinter();
            PrizeTicket   prizeTicket   = new PrizeTicket();

            prizeTicket.companyName = UtilityService.getCompanyName();
            prizeTicket.title       = "NÚMEROS PREMIADOS";
            // Obtener datos del punto de venta
            LPS_LotteryPointSale pointSale = UtilityService.getPointSale();

            prizeTicket.pointSaleName = pointSale.LPS_DisplayName;
            prizeTicket.drawDate      = pDraw.LTD_CreateDate;
            // Obtener datos de tipo de sorteo
            LotteryDrawTypeRepository drawTypeRepo = new LotteryDrawTypeRepository();
            LDT_LotteryDrawType       drawType     = drawTypeRepo.getById(pDraw.LDT_LotteryDrawType);

            prizeTicket.drawTypeCode = drawType.LDT_Code;
            // Llenar datos del número de lista
            prizeTicket.createDate = DateTime.Now;
            // Obtener datos de los premios
            PrizeFactorService     prizeFactorService = new PrizeFactorService();
            LPF_LotteryPrizeFactor prizeFactor        = prizeFactorService.getByGroup(drawType.LDT_Id);

            if (prizeFactor != null)
            {
                prizeTicket.prizeFactorArray[0] = prizeFactor.LPF_FirtsPrizeFactor;
                prizeTicket.prizeFactorArray[1] = prizeFactor.LPF_SecondPrizeFactor;
                prizeTicket.prizeFactorArray[2] = prizeFactor.LPF_ThirdPrizeFactor;
            }
            // Obtener listado de información de ganadores
            LotteryListRepository listRepository = new LotteryListRepository();

            prizeTicket.listWinningInfo = listRepository.getWinningNumbersList(pDraw, pWinningNumberArray);
            prizeTicket.winnerNumbers   = pWinningNumberArray;
            ticketPrinter.prizeTicket   = prizeTicket;
            // Obtener nombre de impresora y enviar impresión
            string printerName = UtilityService.getTicketPrinterName();

            ticketPrinter.printPrizeTicket(printerName, pSendToPrint);
            // Almacenar importe de premio para el sorteo
            DrawBalanceService drawBalanceService = new DrawBalanceService();

            drawBalanceService.saveBalance(pDraw.LDT_LotteryDrawType, pDraw.LTD_CreateDate, 0, ticketPrinter.prizeImport);
            if (pShowInPanel)
            {
                //Console.Write(ticketPrinter.ticketStringText);
                MessageBox.Show(ticketPrinter.ticketStringText);
            }
        }
예제 #4
0
        // Método para imprimir un ticket de venta de una lista
        public void printList(LTL_LotteryList pNumberList, int pTicketType = 0)
        {
            // Configurar impresión para Ticket de Venta
            SaleTicket saleTicket = new SaleTicket(pTicketType);

            saleTicket.companyName = UtilityService.getCompanyName();
            // Obtener datos del punto de venta
            LPS_LotteryPointSale pointSale = UtilityService.getPointSale();

            saleTicket.pointSaleName = pointSale.LPS_DisplayName;
            // Obtener usuario vendedor
            saleTicket.userName = SystemSession.username;
            // Obtener datos del sorteo
            LotteryDrawRepository drawRepo   = new LotteryDrawRepository();
            LTD_LotteryDraw       drawObject = drawRepo.getById(pNumberList.LTD_LotteryDraw);

            saleTicket.drawDate = drawObject.LTD_CreateDate;
            // Obtener datos de tipo de sorteo
            this.drawTypeRepo = new LotteryDrawTypeRepository();
            LDT_LotteryDrawType drawType = drawTypeRepo.getById(drawObject.LDT_LotteryDrawType);

            saleTicket.drawTypeCode = drawType.LDT_Code;
            // Obtener datos de los premios
            PrizeFactorService     prizeFactorService = new PrizeFactorService();
            LPF_LotteryPrizeFactor prizeFactor        = prizeFactorService.getByGroup(drawType.LDT_Id);

            if (prizeFactor != null)
            {
                saleTicket.prizeFactorArray[0] = prizeFactor.LPF_FirtsPrizeFactor;
                saleTicket.prizeFactorArray[1] = prizeFactor.LPF_SecondPrizeFactor;
                saleTicket.prizeFactorArray[2] = prizeFactor.LPF_ThirdPrizeFactor;
            }
            // Llenar datos del número de lista
            saleTicket.createDate   = DateTime.Now;
            saleTicket.ticketId     = pNumberList.LTL_Id;
            saleTicket.globalId     = pointSale.LPS_Id + "" + saleTicket.ticketId;
            saleTicket.customerName = pNumberList.LTL_CustomerName;
            // Obtener detalle de la lista procesada
            this.listRepo = new LotteryListRepository();
            saleTicket.listNumberDetail = listRepo.getTupleListDetail(pNumberList.LTL_Id);
            // Crear instancia de impresora y asignar el ticket
            TicketPrinter ticketPrinter = new TicketPrinter();

            ticketPrinter.saleTicket = saleTicket;
            // Obtener nombre de impresora y enviar impresión
            string printerName = UtilityService.getTicketPrinterName();

            ticketPrinter.printLotterySaleTicket(printerName);
        }
예제 #5
0
        public static LPS_LotteryPointSale getSystemSalePoint()
        {
            LPS_LotteryPointSale pointSaleInstance = null;
            string localParam = getSalePointParamValue();

            if (localParam.Trim() != "")
            {
                LotteryPointSaleRepository posRepository = new LotteryPointSaleRepository();
                // TODO: Validar si es número
                long posId = Convert.ToInt64(localParam);
                pointSaleInstance = posRepository.getById(posId);
            }

            return(pointSaleInstance);
        }
예제 #6
0
        public object generateSimpleListObject(LTL_LotteryList pListObject,
                                               long pListStatus = SystemConstants.LIST_STATUS_CREATED,
                                               long pSyncStatus = SystemConstants.SYNC_STATUS_COMPLETED
                                               )
        {
            LotteryDrawRepository      lotteryDrawRepository = new LotteryDrawRepository();
            LTD_LotteryDraw            draw      = lotteryDrawRepository.getById(pListObject.LTD_LotteryDraw);
            LotteryPointSaleRepository saleRepo  = new LotteryPointSaleRepository();
            LPS_LotteryPointSale       pointSale = saleRepo.getById(pListObject.LPS_LotteryPointSale);
            // Crear el objeto JSON
            var jsonObject = new
            {
                listNumber        = pListObject.LTL_Id,
                lotteryPointSale  = pointSale.LPS_Id,
                lotteryDraw       = pListObject.LTD_LotteryDraw,
                lotteryListStatus = pListStatus,
                synchronyStatus   = pSyncStatus,
                customerName      = pListObject.LTL_CustomerName,
                createDate        = pListObject.LTL_CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
            };

            return(jsonObject);
        }
예제 #7
0
        public object generateListObject(LTL_LotteryList pListObject)
        {
            LotteryDrawRepository      lotteryDrawRepository = new LotteryDrawRepository();
            LTD_LotteryDraw            draw      = lotteryDrawRepository.getById(pListObject.LTD_LotteryDraw);
            LotteryPointSaleRepository saleRepo  = new LotteryPointSaleRepository();
            LPS_LotteryPointSale       pointSale = saleRepo.getById(pListObject.LPS_LotteryPointSale);
            // Crear el objeto JSON
            var jsonObject = new
            {
                listNumber       = pListObject.LTL_Id,
                lotteryPointSale = new
                {
                    id              = pointSale.LPS_Id,
                    code            = pointSale.LPS_Code,
                    synchronyStatus = new
                    {
                        code        = "SC",
                        displayName = "Sincronizado",
                        description = "Sincronización completa",
                        id          = 3
                    },
                    displayName = pointSale.LPS_DisplayName,
                    description = pointSale.LPS_Description,
                    company     = new
                    {
                        code        = "TR",
                        displayName = "TIEMPOS RIVERA",
                        description = "Tiempos Rivera",
                        id          = 1,
                        createDate  = pointSale.LPS_CreateDate.ToString("yyyy-MM-dd HH:mm:ss")
                    },
                    createDate = pointSale.LPS_CreateDate.ToString("yyyy-MM-dd HH:mm:ss")
                },
                lotteryDraw = new
                {
                    id = pListObject.LTD_LotteryDraw,
                    lotteryDrawType   = draw.LDT_LotteryDrawType,
                    lotteryDrawStatus = draw.LDS_LotteryDrawStatus,
                    createDate        = draw.LTD_CreateDate
                },
                lotteryListStatus = new
                {
                    id          = 2,
                    code        = "R",
                    displayName = "Borrada",
                    description = "Borrada"
                },
                synchronyStatus = new
                {
                    id          = 3,
                    code        = "SC",
                    displayName = "Sincronización completa",
                    description = "Sincronización completa"
                },
                customerName = pListObject.LTL_CustomerName,
                createDate   = pListObject.LTL_CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
            }
            ;

            return(jsonObject);
        }