Example #1
0
 public void saveListDetail(ref LND_ListNumberDetail pList)
 {
     using (var context = new SILOEntities())
     {
         context.LND_ListNumberDetail.Add(pList);
         context.SaveChanges();
     }
 }
Example #2
0
 public void saveList(ref LTL_LotteryList pList)
 {
     using (var context = new SILOEntities())
     {
         context.LTL_LotteryList.Add(pList);
         context.SaveChanges();
     }
 }
Example #3
0
 public void save(ref LTD_LotteryDraw pDraw)
 {
     using (var context = new SILOEntities())
     {
         //LTD_LotteryDraw matchingDraw = context.LTD_LotteryDraw.Find(pDraw.LTD_Id);
         LTD_LotteryDraw matchingDraw = this.getByTypeAndDate(pDraw.LDT_LotteryDrawType, pDraw.LTD_CreateDate);
         if (matchingDraw != null)
         {
             matchingDraw = context.LTD_LotteryDraw.Find(matchingDraw.LTD_Id);
             matchingDraw.LDS_LotteryDrawStatus = pDraw.LDS_LotteryDrawStatus;
             context.SaveChanges();
             pDraw = matchingDraw;
         }
         else
         {
             context.LTD_LotteryDraw.Add(pDraw);
             context.SaveChanges();
         }
     }
 }
        public void saveProhibitedNumbers(int[] pProhibitedArray)
        {
            LNR_LotteryNumber number = null;

            using (var context = new SILOEntities())
            {
                // Determina cual es 1 y cual es 0 en el array de prohibidos y lo guarda en la tabla
                for (int i = 0; i < 100; i++)
                {
                    int positionArray = (i == 0 ? 100 : i);
                    number = context.LNR_LotteryNumber.Find(positionArray);
                    // Actualizar número y estado de sincronización solo si varió el valor
                    if (number.LNR_IsProhibited != pProhibitedArray[i])
                    {
                        number.LNR_IsProhibited    = pProhibitedArray[i];
                        number.SYS_SynchronyStatus = SystemConstants.SYNC_STATUS_PENDING_TO_SERVER;
                    }
                }
                context.SaveChanges();
            }
        }