private void EditSavePage() { int ManageId = new BCW.User.Manage().IsManageLogin(); if (Utils.GetTopDomain().Contains("tuhao") || Utils.GetTopDomain().Contains("th")) { if (ManageId != 1 && ManageId != 2) { Utils.Error("权限不足", ""); } } else if (Utils.GetTopDomain().Contains("kb288.net")) { if (ManageId != 1 && ManageId != 3 && ManageId != 4 && ManageId != 5) { Utils.Error("权限不足", ""); } } else { if (ManageId != 1 && ManageId != 9) { Utils.Error("权限不足", ""); } } int id = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "ID错误")); int WinNum = int.Parse(Utils.GetRequest("WinNum", "post", 2, @"^[0-9]\d*$", "开出数字填写错误")); DateTime BeginTime = Utils.ParseTime(Utils.GetRequest("BeginTime", "post", 2, DT.RegexTime, "开盘时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + "")); DateTime EndTime = Utils.ParseTime(Utils.GetRequest("EndTime", "post", 2, DT.RegexTime, "开奖时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + "")); if (!new BCW.BLL.Game.Horselist().Exists(id)) { Utils.Error("不存在的记录", ""); } //记录日志 if (Utils.GetDomain().Contains("kubao") || Utils.GetDomain().Contains("tuhao") || Utils.GetDomain().Contains("th") || Utils.GetDomain().Contains("kb288")) { String sLogFilePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "/logstr/" + DateTime.Now.ToString("MM-dd") + ".txt"; LogHelper.Write(sLogFilePath, "操作管理员:" + ManageId + "号/编辑跑马期数:" + id + "|是否预设:" + WinNum + ""); } BCW.Model.Game.Horselist model = new BCW.Model.Game.Horselist(); model.ID = id; model.WinNum = WinNum; model.BeginTime = BeginTime; model.EndTime = EndTime; new BCW.BLL.Game.Horselist().Update(model); Utils.Success("编辑第" + id + "局", "编辑第" + id + "局成功..", Utils.getUrl("horse.aspx?act=edit&id=" + id + "&backurl=" + Utils.getPage(0) + ""), "1"); }
/// <summary> /// 更新本期记录 /// </summary> public void Update2(BCW.Model.Game.Horselist model) { dal.Update2(model); }
/// <summary> /// 跑马自动游戏程序 /// </summary> /// <param name="HorseId">局数ID</param> /// <param name="dt">截止时间</param> private void ChangePalyHorse() { BCW.Model.Game.Horselist horse = null; new BCW.User.Game.Horse().HorsePage(); horse = new BCW.BLL.Game.Horselist().GetHorselist(); int HorseId = horse.ID; long Sec = DT.DateDiff(horse.EndTime, DateTime.Now, 4); if (HorseId > 0) { int UsIDNum = new BCW.BLL.Game.Horsepay().GetCount(HorseId);//当期下注ID数 //如果小于15个则自在不同秒数中自动出动1个ID来下注 if (UsIDNum < 5) { bool IsPlay = false; Sec = 480 - Sec; int ZD = 0; if (Sec > 5 && Sec <= 30 && Utils.ParseInt(ub.GetSub("HorseZD1", xmlPath)) == 0) { IsPlay = true; ZD = 1; } if (Sec > 30 && Sec <= 60 && Utils.ParseInt(ub.GetSub("HorseZD2", xmlPath)) == 0) { IsPlay = true; ZD = 2; } else if (Sec > 60 && Sec <= 90 && Utils.ParseInt(ub.GetSub("HorseZD3", xmlPath)) == 0) { IsPlay = true; ZD = 3; } else if (Sec > 90 && Sec <= 120 && Utils.ParseInt(ub.GetSub("HorseZD4", xmlPath)) == 0) { IsPlay = true; ZD = 4; } else if (Sec > 120 && Sec <= 150 && Utils.ParseInt(ub.GetSub("HorseZD5", xmlPath)) == 0) { IsPlay = true; ZD = 5; } else if (Sec > 150 && Sec <= 180 && Utils.ParseInt(ub.GetSub("HorseZD6", xmlPath)) == 0) { IsPlay = true; ZD = 6; } else if (Sec > 180 && Sec <= 210 && Utils.ParseInt(ub.GetSub("HorseZD7", xmlPath)) == 0) { IsPlay = true; ZD = 7; } else if (Sec > 210 && Sec <= 240 && Utils.ParseInt(ub.GetSub("HorseZD8", xmlPath)) == 0) { IsPlay = true; ZD = 8; } else if (Sec > 240 && Sec <= 270 && Utils.ParseInt(ub.GetSub("HorseZD9", xmlPath)) == 0) { IsPlay = true; ZD = 9; } else if (Sec > 270 && Sec <= 300 && Utils.ParseInt(ub.GetSub("HorseZD10", xmlPath)) == 0) { IsPlay = true; ZD = 10; } else if (Sec > 300 && Sec <= 330 && Utils.ParseInt(ub.GetSub("HorseZD11", xmlPath)) == 0) { IsPlay = true; ZD = 11; } else if (Sec > 330 && Sec <= 360 && Utils.ParseInt(ub.GetSub("HorseZD12", xmlPath)) == 0) { IsPlay = true; ZD = 12; } else if (Sec > 360 && Sec <= 390 && Utils.ParseInt(ub.GetSub("HorseZD13", xmlPath)) == 0) { IsPlay = true; ZD = 13; } else if (Sec > 390 && Sec <= 420 && Utils.ParseInt(ub.GetSub("HorseZD14", xmlPath)) == 0) { IsPlay = true; ZD = 14; } else if (Sec > 420 && Sec <= 450 && Utils.ParseInt(ub.GetSub("HorseZD15", xmlPath)) == 0) { IsPlay = true; ZD = 15; } if (IsPlay) { //更新某分钟已出动过 ub xml = new ub(); xml.ReloadSub(xmlPath); //加载配置 xml.dss["HorseZD" + ZD + ""] = 1; System.IO.File.WriteAllText(HttpContext.Current.Server.MapPath(xmlPath), xml.Post(xml.dss), System.Text.Encoding.UTF8); //进行自动下注 PlayHorse(HorseId); } } } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Game.Horselist model) { return(dal.Add(model)); }