Пример #1
0
        public static List <OpenLottery> GetOpenLottery(int type, long DataPeriods, bool getOne)
        {
            List <OpenLottery> dList = null;

            try
            {
                if (getOne)
                {
                    KFBoCaiDbManager.SelectOpenLottery(type, string.Format(" AND `DataPeriods`={0}", DataPeriods), out dList);
                }
                else if (0 == type)
                {
                    if (1 == (int)DataPeriods)
                    {
                        return(KFBoCaiCaiDaXiao.GetInstance().GetOpenHistory());
                    }
                    if (2 == (int)DataPeriods)
                    {
                        return(KFBoCaiCaiShuzi.GetInstance().GetOpenHistory());
                    }
                }
                else
                {
                    KFBoCaiDbManager.SelectOpenLottery(type, string.Format(" AND `DataPeriods`>{0}", DataPeriods), out dList);
                }
            }
            catch (Exception ex)
            {
                LogManager.WriteException(ex.Message);
            }
            return(dList);
        }
Пример #2
0
 public void ThreadUpdate(object state)
 {
     try
     {
         for (;;)
         {
             KFBoCaiCaiDaXiao.GetInstance().UpData(false);
             KFBoCaiCaiShuzi.GetInstance().UpData(false);
             Thread.Sleep(50);
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteExceptionUseCache(ex.ToString());
     }
 }
Пример #3
0
 public void ThreadProc(object state)
 {
     try
     {
         for (;;)
         {
             KFBoCaiCaiDaXiao.GetInstance().Thread();
             KFBoCaiCaiShuzi.GetInstance().Thread();
             Thread.Sleep(1000);
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteExceptionUseCache(ex.ToString());
     }
 }
Пример #4
0
 public void StartUp()
 {
     try
     {
         KFBoCaiCaiDaXiao.GetInstance().InitData();
         KFBoCaiCaiShuzi.GetInstance().InitData();
         this.BackgroundThread = new Thread(new ParameterizedThreadStart(this.ThreadProc));
         this.BackgroundThread.IsBackground = true;
         this.BackgroundThread.Start();
         this.BackgroundUpdate = new Thread(new ParameterizedThreadStart(this.ThreadUpdate));
         this.BackgroundUpdate.IsBackground = true;
         this.BackgroundUpdate.Start();
     }
     catch (Exception ex)
     {
         LogManager.WriteException(ex.Message);
     }
 }
Пример #5
0
 public static bool IsCanBuy(int type, string buyValue, int buyNum, long DataPeriods)
 {
     try
     {
         if (1 == type)
         {
             return(KFBoCaiCaiDaXiao.GetInstance().IsCanBuy(buyValue, buyNum, DataPeriods));
         }
         if (2 == type)
         {
             return(KFBoCaiCaiShuzi.GetInstance().IsCanBuy(buyValue, buyNum, DataPeriods));
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteException(ex.Message);
     }
     return(false);
 }
Пример #6
0
 public static List <KFBoCaoHistoryData> GetWinHistory(int type)
 {
     try
     {
         if (1 == type)
         {
             return(KFBoCaiCaiDaXiao.GetInstance().GetWinHistory());
         }
         if (2 == type)
         {
             return(KFBoCaiCaiShuzi.GetInstance().GetWinHistory());
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteException(ex.Message);
     }
     return(null);
 }
Пример #7
0
 public static KFStageData GetKFStageData(int type)
 {
     try
     {
         if (1 == type)
         {
             return(KFBoCaiCaiDaXiao.GetInstance().GetKFStageData());
         }
         if (2 == type)
         {
             return(KFBoCaiCaiShuzi.GetInstance().GetKFStageData());
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteException(ex.Message);
     }
     return(null);
 }
Пример #8
0
 public static bool BuyBoCai(KFBuyBocaiData data)
 {
     try
     {
         if (1 == data.BocaiType)
         {
             return(KFBoCaiCaiDaXiao.GetInstance().BuyBoCai(data));
         }
         if (2 == data.BocaiType)
         {
             return(KFBoCaiCaiShuzi.GetInstance().BuyBoCai(data));
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteException(ex.Message);
     }
     return(false);
 }