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.Dicelist().Exists(id)) { Utils.Error("不存在的记录", ""); } //记录日志 String sLogFilePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "/logstr/" + DateTime.Now.ToString("MM-dd") + ".txt"; LogHelper.Write(sLogFilePath, "操作管理员:" + ManageId + "号/编辑挖宝期数:" + id + "|是否预设:" + WinNum + "," + Utils.GetDomain()); BCW.Model.Game.Dicelist model = new BCW.Model.Game.Dicelist(); model.ID = id; model.WinNum = WinNum; model.BeginTime = BeginTime; model.EndTime = EndTime; new BCW.BLL.Game.Dicelist().Update(model); Utils.Success("编辑第" + id + "局", "编辑第" + id + "局成功..", Utils.getUrl("dice.aspx?act=edit&id=" + id + "&backurl=" + Utils.getPage(0) + ""), "1"); }
/// <summary> /// 更新本期记录 /// </summary> public void Update2(BCW.Model.Game.Dicelist model) { dal.Update2(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Game.Dicelist model) { return(dal.Add(model)); }
/// <summary> /// 挖宝自动游戏程序 /// </summary> /// <param name="DiceId">局数ID</param> /// <param name="dt">截止时间</param> private void ChangePalyDice() { BCW.Model.Game.Dicelist dice = null; new BCW.User.Game.Dice().DicePage(); dice = new BCW.BLL.Game.Dicelist().GetDicelist(); int DiceId = dice.ID; long Sec = DT.DateDiff(dice.EndTime, DateTime.Now, 4); if (DiceId > 0) { int UsIDNum = new BCW.BLL.Game.Dicepay().GetCount(DiceId);//当期下注ID数 //如果小于15个则自在不同秒数中自动出动1个ID来下注 if (UsIDNum < 5) { bool IsPlay = false; Sec = 360 - Sec; int ZD = 0; if (Sec > 5 && Sec <= 30 && ub.GetSub("DiceZD1", xmlPath) == "0") { IsPlay = true; ZD = 1; } if (Sec > 30 && Sec <= 60 && ub.GetSub("DiceZD2", xmlPath) == "0") { IsPlay = true; ZD = 2; } else if (Sec > 60 && Sec <= 90 && ub.GetSub("DiceZD3", xmlPath) == "0") { IsPlay = true; ZD = 3; } else if (Sec > 90 && Sec <= 120 && ub.GetSub("DiceZD4", xmlPath) == "0") { IsPlay = true; ZD = 4; } else if (Sec > 120 && Sec <= 150 && ub.GetSub("DiceZD5", xmlPath) == "0") { IsPlay = true; ZD = 5; } else if (Sec > 150 && Sec <= 180 && ub.GetSub("DiceZD6", xmlPath) == "0") { IsPlay = true; ZD = 6; } else if (Sec > 180 && Sec <= 210 && ub.GetSub("DiceZD7", xmlPath) == "0") { IsPlay = true; ZD = 7; } else if (Sec > 210 && Sec <= 240 && ub.GetSub("DiceZD8", xmlPath) == "0") { IsPlay = true; ZD = 8; } else if (Sec > 240 && Sec <= 270 && ub.GetSub("DiceZD9", xmlPath) == "0") { IsPlay = true; ZD = 9; } else if (Sec > 270 && Sec <= 300 && ub.GetSub("DiceZD10", xmlPath) == "0") { IsPlay = true; ZD = 10; } else if (Sec > 300 && Sec <= 330 && ub.GetSub("DiceZD11", xmlPath) == "0") { IsPlay = true; ZD = 11; } else if (Sec > 330 && Sec <= 355 && ub.GetSub("DiceZD12", xmlPath) == "0") { IsPlay = true; ZD = 12; } if (IsPlay) { //更新某分钟已出动过 ub xml = new ub(); xml.ReloadSub(xmlPath); //加载配置 xml.dss["DiceZD" + ZD + ""] = 1; System.IO.File.WriteAllText(HttpContext.Current.Server.MapPath(xmlPath), xml.Post(xml.dss), System.Text.Encoding.UTF8); //进行自动下注 PlayDice(DiceId); } } } }