Пример #1
0
        private async void eraseList(long pListId)
        {
            // Obtener la lista por el id
            ListService     listService = new ListService();
            LTL_LotteryList list        = listService.getById(pListId);

            // Modificar el estado y guardar localmente
            list.LLS_LotteryListStatus = SystemConstants.LIST_STATUS_CANCELED;
            list.SYS_SynchronyStatus   = SystemConstants.SYNC_STATUS_PENDING_TO_SERVER;
            listService.updateList(list);
            // Reversar la lista en el servidor
            SynchronizeService syncService = new SynchronizeService();
            await syncService.processReverseToServerAsync(list);

            // Acciones posteriores a la reversión
            this.Hide();
            MessageService.displayInfoMessage(GeneralConstants.SUCCESS_TRANSACTION_CANCELATION_MESSAGE, GeneralConstants.SUCCESS_TRANSACTION_CANCELATION_TITLE);
            LotteryDrawRepository     drawRepository     = new LotteryDrawRepository();
            LotteryDrawTypeRepository drawTypeRepository = new LotteryDrawTypeRepository();
            ListInstanceForm          listInstance       = new ListInstanceForm(
                this.appMediator,
                this,
                UtilityService.getPointSale(),
                drawTypeRepository.getById(drawRepository.getById(list.LTD_LotteryDraw).LDT_LotteryDrawType),
                DateTime.Today,
                listService.getListDetail(pListId)
                );

            listInstance.StartPosition = FormStartPosition.CenterParent;
            listInstance.ShowDialog();
            //listInstance.ShowDialog(this);
        }
Пример #2
0
 public void saveList(ref LTL_LotteryList pList)
 {
     using (var context = new SILOEntities())
     {
         context.LTL_LotteryList.Add(pList);
         context.SaveChanges();
     }
 }
Пример #3
0
        public long copy(LTL_LotteryList pList)
        {
            long actualStatus = pList.SYS_SynchronyStatus;

            this.LPS_LotteryPointSale  = pList.LPS_LotteryPointSale;
            this.LTD_LotteryDraw       = pList.LTD_LotteryDraw;
            this.LTL_CustomerName      = pList.LTL_CustomerName;
            this.LTL_CreateDate        = pList.LTL_CreateDate;
            this.LLS_LotteryListStatus = pList.LLS_LotteryListStatus;
            this.SYS_SynchronyStatus   = pList.SYS_SynchronyStatus;
            return(actualStatus);
        }
Пример #4
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);
        }