private void GetTop5OpenResult(string notOpenIssue) { ILotteryIssueService lotteryIssueService = IoC.Resolve <ILotteryIssueService>(); var opens = lotteryIssueService.GetTop5OpendIssue(this.LotteryId); var nt = opens.Where(c => c.IssueCode == notOpenIssue).FirstOrDefault(); if (nt != null) { opens.Remove(nt); } StringBuilder builder = new StringBuilder(); foreach (var item in opens) { builder.Append("<ul>"); builder.Append("<li>" + item.IssueCode + "</li>"); builder.Append("<li class='haoma1'>"); if (!string.IsNullOrEmpty(item.Result)) { var openArray = item.Result.Split(','); foreach (var o in openArray) { builder.Append("<span>" + o + "</span>"); } } builder.Append("</li>"); builder.Append("</ul>"); } Top5OpenResult = builder.ToString(); }
private void GetTop5OpenResult(string notOpenIssue) { ILotteryIssueService lotteryIssueService = IoC.Resolve <ILotteryIssueService>(); var opens = lotteryIssueService.GetTop5OpendIssue(this.LotteryId); var nt = opens.Where(c => c.IssueCode == notOpenIssue).FirstOrDefault(); if (nt != null) { opens.Remove(nt); } StringBuilder builder = new StringBuilder(); foreach (var item in opens) { builder.Append("<li title=\"" + item.Result + "\">"); builder.Append("<span class=\"left\">" + item.IssueCode + "</span>"); builder.Append("<span class=\"right\">"); if (!string.IsNullOrEmpty(item.Result)) { var openArray = item.Result.Split(','); foreach (var o in openArray) { builder.Append("<i class=\"icon icon-num2 kjn0\" title=\"\">" + o + "</i>"); } } builder.Append("</span>"); builder.Append("</li>"); } //</span></li> Top5OpenResult = builder.ToString(); }
public MessageRequestManager(IMessageService messageService, IBetDetailService mbetDetailService, ILotteryIssueService lotteryIssueService) { this.mMessageService = messageService; this.mBetDetailService = mbetDetailService; this.mLotteryIssueService = lotteryIssueService; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string btimes = Request.QueryString["starttime"]; string etimes = Request.QueryString["endtime"]; DateTime?outBegin = null; DateTime?outEnd = null; DateTime begin; DateTime end; if (DateTime.TryParse(btimes, out begin)) { outBegin = begin; } if (DateTime.TryParse(etimes, out end)) { outEnd = end; } ILotteryIssueService issueService = IoC.Resolve <ILotteryIssueService>(); var result = issueService.GetHisIssue(21, 50, outBegin, outEnd).OrderBy(x => x.EndTime); this.rep.DataSource = result; this.rep.DataBind(); } }
/// <summary> /// 获取开奖结果 /// </summary> private string GetOpenResult(string issue) { ILotteryIssueService lotteryIssueService = IoC.Resolve <ILotteryIssueService>(); var item = lotteryIssueService.GetIssueOpenResult(issue, this.LotteryId); GetTop5OpenResult(issue); if (null != item) { return(item.Result); } return(string.Empty); }
public LotteryIssuesData() { notId.AddRange(fenfid); foreach (var ni in notId) { notIdStr += ni + ","; } notIdStr = notIdStr.Substring(0, notIdStr.Length - 1); var db = new DbContextFactory(); this.mLotteryIssueService = new LotteryIssueService(new Repo <LotteryIssue>(db)); this.mBuyTogetherService = new BuyTogetherService(new Repo <BuyTogether>(db)); }
/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpdate_Command(object sender, CommandEventArgs e) { if (e.CommandArgument == null) { JsAlert("修改失败!"); return; } lotteryId = Convert.ToInt32(txtLotteryId.Value); int lotteryIssueId = Convert.ToInt32(e.CommandArgument); string startTime = ""; string endTime = ""; string lotteryTime = ""; //获取修改行数据 bool flag = false; for (int i = 0; i < this.repList.Items.Count; i++) { LinkButton lbtn = (LinkButton)repList.Items[i].FindControl("btnUpdate"); if (lbtn != null) { int id = Convert.ToInt32(lbtn.CommandArgument); if (id == lotteryIssueId) { flag = true; startTime = ((TextBox)repList.Items[i].FindControl("txtStartTime")).Text; endTime = ((TextBox)repList.Items[i].FindControl("txtEndTime")).Text; lotteryTime = ((TextBox)repList.Items[i].FindControl("TxtLotteryTime")).Text; break; } } } //修改数据 if (flag) { ILotteryIssueService lotteryIssueService = IoC.Resolve <ILotteryIssueService>(); var item = lotteryIssueService.Get(lotteryIssueId); item.StartSaleTime = Convert.ToDateTime(item.StartTime.ToString("yyyy/MM/dd") + " " + startTime); item.EndSaleTime = Convert.ToDateTime(item.EndTime.Value.ToString("yyyy/MM/dd") + " " + endTime); item.EndTime = Convert.ToDateTime(item.LotteryTime.Value.ToString("yyyy/MM/dd") + " " + lotteryTime); lotteryIssueService.Save(); InitData(); JsAlert("修改成功!"); } }
public LotteryRequestManager(ILotteryTypeService lotteryTypeService, IPlayTypeService playTypeService, IPlayTypeRadioService playTypeRadioService, IPlayNumTypeService playNumTypeService, IPlayTypeRadiosBonusService playTypeRadiosBonusService, ILotteryIssueService lotteryIssueService ) { this.mLotteryTypeService = lotteryTypeService; this.mPlayTypeService = playTypeService; this.mPlayTypeRadioService = playTypeRadioService; this.mPlayTypeNumService = playNumTypeService; this.mPlayTypeRadiosBonusService = playTypeRadiosBonusService; this.mLotteryIssueService = lotteryIssueService; }
/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpdate_Command(object sender, CommandEventArgs e) { if (e.CommandArgument == null) { JsAlert("修改失败!"); return; } lotteryCode = txtLotteryCode.Value.ToString(); lotteryId = Convert.ToInt32(txtLotteryId.Value); int lotteryIssueId = Convert.ToInt32(e.CommandArgument); string issueCode = ""; string result = ""; //获取修改行数据 bool flag = false; for (int i = 0; i < this.repList.Items.Count; i++) { LinkButton lbtn = (LinkButton)repList.Items[i].FindControl("btnUpdate"); if (lbtn != null) { int id = Convert.ToInt32(lbtn.CommandArgument); if (id == lotteryIssueId) { flag = true; issueCode = ((Label)repList.Items[i].FindControl("txtIsscueCode")).Text.Trim(); result = ((TextBox)repList.Items[i].FindControl("txtResult")).Text.Trim(); break; } } } //修改数据 if (flag) { ILotteryIssueService lotteryIssueService = IoC.Resolve <ILotteryIssueService>(); if (lotteryIssueService.UpdateOpenResult(issueCode, result, DateTime.Now, lotteryId)) { InitData(); JsAlert("修改成功!"); } else { JsAlert("修改失败!"); } } }
/// <summary> /// 初始化数据 /// </summary> public void InitData() { //获取彩种列表 ILotteryTypeService lotteryTypeService = IoC.Resolve <ILotteryTypeService>(); lotteryTypeList = lotteryTypeService.GetAll().ToList(); //根据彩种获取玩法列表 if (lotteryTypeList != null && lotteryTypeList.Count > 0) { //默认加载第一个彩种 if (string.IsNullOrEmpty(lotteryCode)) { lotteryCode = lotteryTypeList[0].LotteryCode; } LotteryType lotteryType = lotteryTypeList.Where(m => m.LotteryCode == lotteryCode).FirstOrDefault(); if (lotteryType == null) { return; } string lotteryName = lotteryType.LotteryName; txtLotteryCode.Value = lotteryType.LotteryCode; txtLotteryId.Value = lotteryType.Id.ToString(); List <LotteryIssueModel> lotteryIssueModelList = new List <LotteryIssueModel>(); ILotteryIssueService lotteryIssueService = IoC.Resolve <ILotteryIssueService>(); List <LotteryIssue> lotteryIssueList = lotteryIssueService.GetNowDayIssue(lotteryType.Id).ToList().OrderBy(x => x.IssueCode).ToList(); if (lotteryIssueList != null && lotteryIssueList.Count > 0) { foreach (var item in lotteryIssueList) { LotteryIssueModel model = new LotteryIssueModel(); model.Id = item.Id; model.IssueCode = item.IssueCode; model.Result = item.Result; model.LotteryTime = item.LotteryTime; model.LotteryId = lotteryType.Id; model.LotteryName = lotteryName; lotteryIssueModelList.Add(model); } } this.repList.DataSource = lotteryIssueModelList; this.repList.DataBind(); } }
/// <summary> /// 初始化数据 /// </summary> public void InitData() { //获取彩种列表 ILotteryTypeService lotteryTypeService = IoC.Resolve <ILotteryTypeService>(); lotteryTypeList = lotteryTypeService.GetAll().ToList(); //根据彩种获取玩法列表 if (lotteryTypeList != null && lotteryTypeList.Count > 0) { //默认显示彩种 if (lotteryId == 0) { lotteryId = lotteryTypeList[0].Id; } string lotteryName = ""; LotteryType lotteryType = lotteryTypeList.Where(m => m.Id == lotteryId).FirstOrDefault(); if (lotteryType != null) { lotteryName = lotteryType.LotteryName; lotteryId = lotteryType.Id; } List <LotteryIssueModel> lotteryIssueModelList = new List <LotteryIssueModel>(); ILotteryIssueService lotteryIssueService = IoC.Resolve <ILotteryIssueService>(); List <LotteryIssue> lotteryIssueList = lotteryIssueService.GetNowDayIssue(lotteryId).ToList(); if (lotteryIssueList != null && lotteryIssueList.Count > 0) { foreach (var item in lotteryIssueList) { LotteryIssueModel model = new LotteryIssueModel(); model.Id = item.Id; model.IssueCode = item.IssueCode; model.StartTime = item.StartTime; model.EndTime = item.EndTime; model.LotteryTime = item.LotteryTime; model.EndSaleTime = item.EndSaleTime; model.LotteryId = lotteryId; model.LotteryName = lotteryName; lotteryIssueModelList.Add(model); } } this.repList.DataSource = lotteryIssueModelList; this.repList.DataBind(); } }
private RebateHelper mRebateHelper = null; //返点辅助 public BetDetailRequestManager(IBetDetailService betDetailService, ISysUserService sysUserService, ISysUserBalanceService sysUserBalanceService, ISysUserBalanceDetailService sysUserBalanceDetailService, ISysCatchNumService sysCatchNumService, ISysCatchNumIssueService sysCatchNumIssueService, ILotteryIssueService lotteryIssueService, IPlayTypeRadioService playTypeRadioService) { this.mBetDetailService = betDetailService; this.mSysUserService = sysUserService; this.mSysUserBalanceService = sysUserBalanceService; this.mSysUserBalanceDetailService = sysUserBalanceDetailService; this.mSysCatchNumService = sysCatchNumService; this.mSysCatchNumIssueService = sysCatchNumIssueService; this.mLotteryIssueService = lotteryIssueService; this.mPlayTypeRadioService = playTypeRadioService; this.mRebateHelper = new RebateHelper(this.mSysUserService, this.mSysUserBalanceService, this.mSysUserBalanceDetailService); }
public InitialRequestManager(ISysUserService sysUserService, ISysUserBalanceService sysUserBalanceService, ISysUserBalanceDetailService SysUserBalanceDetailService, INewsService newsService, IHotLotteryService hotLotteryService, IBannerService bannerService, IMarketService marketservice, ISysQuotaService sysQuotaService, ISysSettingService sysSettingService, ILockIpInfoService lockIpInfoService, ILotteryIssueService lotteryIssueService) { this.mSysUserService = sysUserService; this.mSysUserBalanceService = sysUserBalanceService; this.mSysUserBalanceDetailService = SysUserBalanceDetailService; this.mNewsService = newsService; this.mHotLotteryService = hotLotteryService; this.mBannerService = bannerService; this.mMarketService = marketservice; this.mSysQuotaService = sysQuotaService; this.mSysSettingService = sysSettingService; this.mLockIpInfoService = lockIpInfoService; this.mLotteryIssueService = lotteryIssueService; }
private void Inint() { int lid = 1; if (!int.TryParse(Request.QueryString["lotteryid"], out lid)) { Response.End(); return; } if (!int.TryParse(Request.QueryString["issuecount"], out topValue)) { topValue = 30; } string btimes = Request.QueryString["starttime"]; string etimes = Request.QueryString["endtime"]; DateTime?outBegin = null; DateTime?outEnd = null; DateTime begin; DateTime end; if (DateTime.TryParse(btimes, out begin)) { outBegin = begin; } if (DateTime.TryParse(etimes, out end)) { outEnd = end; } ILotteryIssueService issueService = IoC.Resolve <ILotteryIssueService>(); var result = issueService.GetHisIssue(lid, topValue, outBegin, outEnd).OrderBy(x => x.EndTime); StringBuilder builer = new StringBuilder(); //构建head int minNum = 0; int maxNum = 6; string testOpenResult = "0,1,2,3,4"; switch (lid) { case 22: //快三 minNum = 1; maxNum = 6; testOpenResult = "3,4,5"; isThree = "k3"; break; case 8: //上海时时乐 case 7: //福彩3d // case 9://排列3/5 minNum = 0; maxNum = 9; testOpenResult = "3,4,5"; isThree = "ssl"; break; case 20: //十一选5 case 19: case 18: case 17: case 6: minNum = 1; maxNum = 11; isThree = "11x5"; break; case 26: testOpenResult = "01,02,03,04,05,06,07,08,09,10"; minNum = 1; maxNum = 10; isThree = "pk10"; break; default: minNum = 0; maxNum = 9; isThree = "ssc"; break; } if (lid == 26) { this.BuilderPk10(builer, testOpenResult, result); this.ContentStr = builer.ToString(); return; } BuilderHead(builer, testOpenResult, minNum, maxNum); //头部 BuilderTitle(builer, testOpenResult, minNum, maxNum); //num List <ResultEntity> statResult = new List <ResultEntity>(); foreach (var res in result) { if (!string.IsNullOrEmpty(res.Result)) { var repResult = res.Result.Split(',').Select(x => Convert.ToInt32(x)).ToArray(); int resLen = repResult.Length; ResultEntity entity = new ResultEntity(); entity._1 = repResult[0]; entity._2 = repResult[1]; entity._3 = repResult[2]; if (resLen == 5) { //开奖数字为5位数 entity._4 = repResult[3]; entity._5 = repResult[4]; } else { //开奖数为3位数 entity._4 = -1; entity._5 = -1; } statResult.Add(entity); } BuilderContent(res.IssueCode, res.Result, builer, minNum, maxNum); } BuilderAvgNum(testOpenResult, minNum, maxNum, builer, statResult); //出现次数 BuilderTitle(builer, testOpenResult, minNum, maxNum, false); //num BuilderHead(builer, testOpenResult, minNum, maxNum, false); //头部 this.ContentStr = builer.ToString(); }
/// <summary> /// 获取当前期数 /// </summary> private void GetIssueCode() { ILotteryIssueService issueService = IoC.Resolve <ILotteryIssueService>(); var result = issueService.GetOccDayNoOpenLotteryIssue(this.LotteryId); if (result == null || result.Count() < 1) { Alert("获取基础数据失败,请刷新后重试!");//基础数据失败, return; } /**移除历史开奖数据,抓取最后一条有开奖结果的数据*/ var hisResult = result.Where(x => x.tp == 1).Reverse().ToList();//获取历史开奖数据 /****/ LotteryIssueDTO pre = hisResult.FirstOrDefault(); for (var i = 0; i < hisResult.Count; i++) { var his = hisResult[i]; if (pre == null || string.IsNullOrEmpty(pre.Result)) { if (!string.IsNullOrEmpty(his.Result)) { pre = his; } } result.Remove(his); } //获取上期开奖结果 this.OpenIssueCode = pre.IssueCode; this.OpenResult = pre.Result;// this.GetOpenResult(pre.IssueCode); // GetTop5OpenResult(this.OpenIssueCode); // result.Remove(pre);//移除掉已开奖数据 if (result.Count < 1) { Alert("获取期数基础信息失败,请刷新后重试!"); return; } var nowIssueInfo = result[0]; //为当前期 this.NowIssue = "{issue:'" + nowIssueInfo.IssueCode + "',scendtime:'" + nowIssueInfo.EndSaleTime.ToString("yyyy-MM-dd HH:mm:ss") + "',endtime:'" + nowIssueInfo.EndTime.ToString("yyyy-MM-dd HH:mm:ss") + "'}"; //{ issue: '20150615-108', endtime: '2015-06-15 22:59:30' }, //移除掉第一期 //result.Remove(nowIssueInfo); //接下来期数 StringBuilder builder = new StringBuilder(); foreach (var item in result) { builder.Append("{issue:'" + item.IssueCode + "',scendtime:'" + item.EndSaleTime.ToString("yyyy-MM-dd HH:mm:ss") + "',endtime:'" + item.EndTime.ToString("yyyy-MM-dd HH:mm:ss") + "'},"); } this.NextIssues = builder.ToString(); if (!string.IsNullOrEmpty(this.NextIssues)) { this.NextIssues = this.NextIssues.Substring(0, this.NextIssues.Length - 1); } else { this.NextIssues = this.NowIssue; } //获取下一天彩票期数 DateTime nextDay = DateTime.Now.AddDays(1); string nextDate = nextDay.ToString("yyyy/MM/dd"); string catchKey = nextDate + this.LotteryId; if (Cache[catchKey] == null) { DateTime beginDate = Convert.ToDateTime(nextDate + " 00:04:20"); DateTime endDate = Convert.ToDateTime(nextDay.AddDays(1).ToString("yyyy/MM/dd") + " 00:00:59"); var tomIssues = issueService.GetLotteryIssues(this.LotteryId, beginDate, endDate, -1); if (null != tomIssues && tomIssues.Count() > 0) { //明天 builder = new StringBuilder(); foreach (var item in tomIssues) { builder.Append("{issue:'" + item.IssueCode + "',scendtime:'" + item.EndSaleTime.Value.ToString("yyyy-MM-dd HH:mm:ss") + "',endtime:'" + item.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss") + "'},"); } string tomStr = builder.ToString(); if (!string.IsNullOrEmpty(tomStr)) { Cache[catchKey] = tomStr.Substring(0, tomStr.Length - 1); } } } NextDayIssues = Cache[catchKey] == null ? "" : Cache[catchKey].ToString(); }
public LotteryBasicRequestManager(ILotteryIssueService lotteryIssueService, IRankingsService rankingsService) { this.mLotteryIssueService = lotteryIssueService; this.mRankingsService = rankingsService; }
private void BuilderLhc() { string lhcContent = this.txtLhcQs.Text; if (string.IsNullOrEmpty(lhcContent)) { JsAlert("请填写六合彩期数!"); return; } bool isClear = chkCleal.Checked; string startIssue = this.txtStartIssue.Text; /** * <row opentime="2016-03-03 21:36:52" opencode="16,05,45,07,02,01+33" expect="2016026"/> * <row opentime="2016-03-01 21:39:23" opencode="30,21,11,16,19,33+31" expect="2016025"/> * <row opentime="2016-02-27 21:42:22" opencode="27,06,11,20,44,09+42" expect="2016024"/> * <row opentime="2016-02-25 21:35:00" opencode="03,47,22,45,24,06+07" expect="2016023"/> * <row opentime="2016-02-23 21:35:18" opencode="15,27,45,44,09,24+47" expect="2016022"/> */ ILotteryIssueService lotteryIssueService = IoC.Resolve <ILotteryIssueService>(); int begInIssueCode = 0; int lhcLotteryid = 21;//lhcs if (isClear && !int.TryParse(this.txtStartIssue.Text.Trim(), out begInIssueCode)) { JsAlert("请填写期数期数!"); } else if (!isClear) { var issueInfo = lotteryIssueService.GetLastIssue(lhcLotteryid); if (null != issueInfo) { begInIssueCode = Convert.ToInt32(issueInfo.IssueCode); } else { begInIssueCode = Convert.ToInt32(startIssue); } } if (isClear) { lotteryIssueService.ClearIssues(lhcLotteryid);//清除 } string[] array = lhcContent.Split(','); string openTimes = System.Configuration.ConfigurationManager.AppSettings["lhcOpenTime"]; //开奖时间 int endsaleTime = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["lhcSaleTime"]); //结束销售时间 分钟 string year = DateTime.Now.ToString("yyyy"); //当前年份 foreach (var item in array) { string ymd = string.Format(year + "- " + item); //年-月-日 DateTime openTime = DateTime.Parse(ymd + " " + openTimes); begInIssueCode++; //增加期数 lotteryIssueService.AddLotteryIssueCode(new LotteryIssue() { IssueCode = begInIssueCode.ToString(), LotteryId = lhcLotteryid, LotteryTime = openTime, EndTime = openTime, EndSaleTime = openTime.AddMinutes(-endsaleTime), OccDate = DateTime.Now, StartSaleTime = DateTime.Now, StartTime = DateTime.Now }); } }