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); }
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()); } }
public void ThreadProc(object state) { try { for (;;) { KFBoCaiCaiDaXiao.GetInstance().Thread(); KFBoCaiCaiShuzi.GetInstance().Thread(); Thread.Sleep(1000); } } catch (Exception ex) { LogManager.WriteExceptionUseCache(ex.ToString()); } }
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); } }
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); }
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); }
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); }
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); }