public DataTable GetTableTitck(DateTime DateTimeTitck_S, DateTime DateTimeTitck_E) { OleDbParameter[] ps = new OleDbParameter[] { new OleDbParameter("@DateTimeTitck_S", DateTimeTitck_S.ToShortDateString()), new OleDbParameter("@DateTimeTitck_E", DateTimeTitck_E.ToShortDateString()) }; DataTable dataTable = OLEDBHelp.GetTable("select [ZhongJiangID] as 订单号,[ZhongJiangTitck] as 奖票,[ChuangGuan] as 串关,[ZhongJiangMoney] as 奖金,[ZhongJianTime] as 创建时间,[PlayGame] as 玩法,[BeiShu] as 倍数,[RongCuo] as 已容错 from ZhongJiangTable where [ZhongJianTime]>=@DateTimeTitck_S and [ZhongJianTime]<=@DateTimeTitck_E order by [ZhongJianTime] desc", ps); return(dataTable); }
private void GetZhongJianTitck(List <Dictionary <string, string> > lis, string chuanGuanShu, SuanJiangClass suanJiangClass) { double titckMoney = 1; int zj = 0; int mzj = 0; for (int i = 0; i < lis.Count; i++) { foreach (var item in lis[i].Keys) { string ssc = string.Empty; lis[i].TryGetValue(item.ToString(), out ssc); if (ssc != "No") { double xxv = double.Parse(ssc); titckMoney = titckMoney * xxv; zj++; } else { mzj++; } } } int rccs = -1; rccs = int.Parse(new selectData().SelectStrZJ(chuanGuanShu));//得到容错次数 if (mzj <= rccs) { if (!(OLEDBHelp.GetReader("select TOP 1 * from ZhongJiangTable where [ZhongJiangID]='" + suanJiangClass.BuyTitckID + "'").HasRows)) { double bs = titckMoney * int.Parse(suanJiangClass.Multiple) * 2.00; OleDbParameter[] ps = new OleDbParameter[] { new OleDbParameter("@ZhongJiangID", suanJiangClass.BuyTitckID), new OleDbParameter("@ZhongJiangTitck", suanJiangClass.TouZhuValue), new OleDbParameter("@ChuangGuan", chuanGuanShu), new OleDbParameter("@ZhongJiangMoney", bs.ToString()), new OleDbParameter("@ZhongJianTime", suanJiangClass.CreateTime.ToString()), new OleDbParameter("@BeiShu", suanJiangClass.Multiple), new OleDbParameter("@PlayGame", suanJiangClass.PlayType), new OleDbParameter("@RongCuo", mzj.ToString()) }; int sb = OLEDBHelp.GetExecute("insert into ZhongJiangTable([ZhongJiangID],[ZhongJiangTitck],[ChuangGuan],[ZhongJiangMoney],[ZhongJianTime],[BeiShu],[PlayGame],[RongCuo]) values(@ZhongJiangID,@ZhongJiangTitck,@ChuangGuan,@ZhongJiangMoney,@ZhongJianTime,@BeiShu,@PlayGame,@RongCuo)", ps); } } //string ssx = zj + "|" + mzj; }
/// <summary> /// 读取数据 /// </summary> /// <param name="DateTimeTitck_S"></param> /// <param name="DateTimeTitck_E"></param> /// <returns></returns> public void SelectDate(DateTime DateTimeTitck_S, DateTime DateTimeTitck_E) { DataTable dataTable = new DataTable(); try { OleDbParameter[] ps = new OleDbParameter[] { new OleDbParameter("@DateTimeTitck_S", DateTimeTitck_S.ToShortDateString()), new OleDbParameter("@DateTimeTitck_E", DateTimeTitck_E.ToShortDateString()) }; dataTable = OLEDBHelp.GetTable("select [BuyTitckID] as 订单号,[PlayType] as 玩法,[Multiple] as 倍数,[TouZhu] as 投注内容,[TouZhuValue] as 投注赔率,[CreateTime] as 创建时间 from TouZhuTitck where [CreateTime]>=@DateTimeTitck_S and [CreateTime]<=@DateTimeTitck_E order by [CreateTime] desc", ps); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { SuanJiangClass suanJiangClass = new SuanJiangClass(); suanJiangClass.BuyTitckID = dataTable.Rows[i]["订单号"].ToString(); suanJiangClass.PlayType = dataTable.Rows[i]["玩法"].ToString(); suanJiangClass.Multiple = dataTable.Rows[i]["倍数"].ToString(); suanJiangClass.TouZhu = dataTable.Rows[i]["投注内容"].ToString(); suanJiangClass.TouZhuValue = dataTable.Rows[i]["投注赔率"].ToString(); suanJiangClass.CreateTime = DateTime.Parse(dataTable.Rows[i]["创建时间"].ToString()); switch (suanJiangClass.PlayType) { case "9001": ChuLiValue9001(suanJiangClass); break; case "9002": ChuLiValue9002(suanJiangClass); break; case "9003": ChuLiValue9003(suanJiangClass); break; case "9004": ChuLiValue9004(suanJiangClass); break; case "9005": ChuLiValue9005(suanJiangClass); break; case "9006": ChuLiValue9006(suanJiangClass); break; } } } } catch (Exception error) { Log.WriteLog(error, "Error"); } }