private void BindDataForIsuse() { if (this.ddlLottery.Items.Count >= 1) { DataTable dt = new Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and EndTime < GetDate() and isnull(WinLotteryNumber,'') =''", "EndTime"); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().FullName); } else { ControlExt.FillDropDownList(this.ddlIsuse, dt, "Name", "ID"); if (this.ddlIsuse.Items.Count > 0) { this.btnGO.Enabled = true; this.tbWinNumber.Enabled = true; } else { this.btnGO.Enabled = false; this.tbWinNumber.Enabled = false; this.tbWinNumber.Text = ""; } } } }
private void BindDataForIsuse() { if (this.ddlLottery.Items.Count >= 1) { DataTable dt = new Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and isOpened = 1", "EndTime desc"); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); } else { ControlExt.FillDropDownList(this.ddlIsuse, dt, "Name", "ID"); if (this.ddlIsuse.Items.Count > 0) { this.WinNumberOther.Visible = true; this.btnGO.Enabled = true; this.ddlIsuse_SelectedIndexChanged(this.ddlIsuse, new EventArgs()); } else { this.WinNumberOther.Visible = true; this.btnGO.Enabled = false; } } } }
public string GetData(int LotteryID) { string key = "Home_Room_Export"; DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); cacheAsDataTable = null; StringBuilder builder = new StringBuilder(); if (cacheAsDataTable == null) { cacheAsDataTable = new Tables.T_Isuses().Open("top 1000 Name, WinLotteryNumber, EndTime ", "LotteryID=" + LotteryID + " and IsOpened = 1 and IsNull(WinLotteryNumber,'')<>''", "EndTime Desc"); if ((cacheAsDataTable == null) || (cacheAsDataTable.Rows.Count == 0)) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); return(null); } cacheAsDataTable.Columns.Add("TempID", typeof(int)); for (int i = 0; i < cacheAsDataTable.Rows.Count; i++) { cacheAsDataTable.Rows[i]["TempID"] = i + 1; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0xe10); } builder.AppendLine("<table width=\"400\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"#DDDDDD\">"); foreach (DataRow row in cacheAsDataTable.Rows) { builder.AppendLine("<tr >").AppendLine("<td align=\"center\" bgcolor=\"#FFFFFF\" class=\"blue12\">").AppendLine(row["TempID"].ToString()).AppendLine("</td>").AppendLine("<td align=\"center\" bgcolor=\"#FFFFFF\" class=\"blue12\">").AppendLine(row["Name"].ToString()).AppendLine("</td>").AppendLine("<td align=\"center\" bgcolor=\"#FFFFFF\" class=\"hui12\">").AppendLine(row["WinLotteryNumber"].ToString()).AppendLine("</td>").AppendLine("</tr>"); } builder.AppendLine("</table>"); return(builder.ToString()); }
private void BindDataForIsuse() { if (this.ddlLottery.Items.Count >= 1) { DataTable dt = new Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and EndTime < GetDate() and isOpened = 1", "EndTime"); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", "Admin_InputOpenAffiche"); } else { ControlExt.FillDropDownList(this.ddlIsuse, dt, "Name", "ID"); if (this.ddlIsuse.Items.Count > 0) { this.btnOK.Enabled = true; this.tbOpenAffiche.ReadOnly = false; } else { this.btnOK.Enabled = false; this.tbOpenAffiche.ReadOnly = true; } this.BindData(); } } }
protected void ddlIsuse_SelectedIndexChanged(object sender, EventArgs e) { if (this.ddlLottery.Items.Count >= 1) { DataTable table = new Tables.T_Isuses().Open("WinLotteryNumber, isOpened", "[ID] = " + Utility.FilteSqlInfusion(this.ddlIsuse.SelectedValue), ""); if ((table == null) || (table.Rows.Count < 1)) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); } else { bool flag = _Convert.StrToBool(table.Rows[0]["isOpened"].ToString(), true); string str = table.Rows[0]["WinLotteryNumber"].ToString(); if (!flag) { this.btnGO.Enabled = false; PF.GoError(1, "此期还没有开奖,不能重构中奖描述。", base.GetType().BaseType.FullName); } else { this.tbWinNumber.Text = str; this.btnGO.Enabled = true; } } } }
private void BindData() { if (this.ddlLottery.Items.Count >= 1) { DataTable table = new Tables.T_Isuses().Open("", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and EndTime > GetDate()", "EndTime"); if (table == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); } else { this.g.DataSource = table; this.g.DataBind(); DataTable table2 = new Tables.T_Isuses().Open("top 1 [Name], StartTime, EndTime", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue), "EndTime desc"); if (table2 == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); } else if (table2.Rows.Count < 1) { this.labLastIsuseTip.Text = "此彩种还没有添加过任何期号。"; } else { this.labLastIsuseTip.Text = "已添加的最后期号:" + table2.Rows[0]["Name"].ToString() + ",开始时间:" + _Convert.StrToDateTime(table2.Rows[0]["StartTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss") + ",截止时间:" + _Convert.StrToDateTime(table2.Rows[0]["EndTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss") + "。"; } } } }
protected void ddlLottery_SelectedIndexChanged(object sender, EventArgs e) { DataTable dt = new Tables.T_Isuses().Open("ID,Name", "LotteryID=" + this.ddlLottery.SelectedValue + " and getdate()>StartTime", "EndTime desc"); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", "Admin_ChaseList"); } else { ControlExt.FillDropDownList(this.ddlIsuses, dt, "Name", "ID"); } }
private void GetSZPL3Miss() { string key = "Home_Room_Buy_GetSZPL3Miss"; this.lbMiss.Text = Shove._Web.Cache.GetCacheAsString(key, ""); if (this.lbMiss.Text == "") { DataTable table = new Tables.T_Isuses().Open("top 100 EndTime,WinLotteryNumber", "LotteryID = 63 and GETDATE()>EndTime and ISNULL(WinLotteryNumber,'')<>'' and IsOpened=1", "EndTime desc"); if (table == null) { new Log("System").Write(base.GetType().FullName + "数据库繁忙,请重试(GetSZPL3Miss)"); } else { int[,] numArray = new int[3, 10]; int num = 0; foreach (DataRow row in table.Select("", "EndTime asc")) { string str2 = row["WinLotteryNumber"].ToString(); if (str2.Length == 3) { for (int i = 0; i < str2.Length; i++) { int num4 = _Convert.StrToInt(str2.Substring(i, 1), 0); for (int j = 0; j < 10; j++) { if (j == num4) { numArray[i, j] = 0; } else { numArray[i, j]++; } } } } } foreach (DataRow row2 in table.Select("1=1", "EndTime desc")) { if (this.FilterRepeated(row2["WinLotteryNumber"].ToString()).Length == 2) { break; } num++; } this.lbMiss.Text = this.GetSZPL3Miss(numArray) + "|" + num.ToString(); Shove._Web.Cache.SetCache(key, this.lbMiss.Text, 600); } } }
private void BindDataForIsuse() { DataTable dt = new Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and StartTime < GetDate() and IsOpened = 0", "EndTime"); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", "Admin_PrintOutput"); } else { ControlExt.FillDropDownList(this.ddlIsuse, dt, "Name", "ID"); this.g.Visible = this.ddlIsuse.Items.Count > 0; } }
private void BindDataForIsuse() { if (this.ddlLottery.Items.Count >= 1) { DataTable dt = new Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and EndTime < GetDate() and isOpened = 0", "EndTime"); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", "Admin_OpenManual"); } else { ControlExt.FillDropDownList(this.ddlIsuse, dt, "Name", "ID"); if (this.ddlIsuse.Items.Count > 0) { this.ddlIsuse_SelectedIndexChanged(this.ddlIsuse, new EventArgs()); if (this.ddlIsuse.SelectedValue == "45") { this.Label1.Visible = false; this.tbWinLotteryNumber.Visible = false; this.lbTipLotteryNumber.Visible = false; this.tbWinLotteryNumber.Enabled = true; this.lbTipLotteryNumber.Visible = true; this.btnEnd.Enabled = true; this.tbOpenAffiche.ReadOnly = false; } else { this.Label1.Visible = true; this.tbWinLotteryNumber.Visible = true; this.lbTipLotteryNumber.Visible = true; this.tbWinLotteryNumber.Enabled = true; this.lbTipLotteryNumber.Visible = true; this.btnEnd.Enabled = true; this.tbOpenAffiche.ReadOnly = false; } } else { this.Label1.Visible = true; this.tbWinLotteryNumber.Visible = true; this.lbTipLotteryNumber.Visible = true; this.tbWinLotteryNumber.Enabled = false; this.lbTipLotteryNumber.Visible = false; this.btnEnd.Enabled = false; this.tbOpenAffiche.ReadOnly = true; } } } }
private void BindDataForIsuse() { if (this.ddlLottery.Items.Count >= 1) { DataTable dt = new Tables.T_Isuses().Open("", "StartTime < GetDate() and LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue), "EndTime desc"); if (dt == null) { PF.GoError(4, "数据库繁忙,请重试", "Admin_SchemeAtTop"); } else { this.ddlIsuse.Items.Clear(); ControlExt.FillDropDownList(this.ddlIsuse, dt, "Name", "ID"); } } }
private void BindDataForIsuse() { if (this.ddlLottery.Items.Count >= 1) { this.ddlIsuse.Items.Clear(); this.ddlIsuse.Items.Add(new ListItem("全部", "-1")); if (this.ddlLottery.SelectedValue != "-1") { DataTable table = new Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + _Convert.StrToInt(this.ddlLottery.SelectedValue, -1).ToString() + " and EndTime < GetDate()", "EndTime desc"); if (table != null) { foreach (DataRow row in table.Rows) { this.ddlIsuse.Items.Add(new ListItem(row["Name"].ToString(), row["ID"].ToString())); } } } } }
private DataTable GetWinNumber(int LotteryID, string LotteryCode) { string key = LotteryCode + "WinNumber" + LotteryID.ToString(); DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if ((cacheAsDataTable == null) || (cacheAsDataTable.Rows.Count == 0)) { cacheAsDataTable = new Tables.T_Isuses().Open("top 10 ID, Name, WinLotteryNumber, EndTime", "LotteryID=" + LotteryID + " and IsOpened = 1 and IsNull(WinLotteryNumber,'')<>''", "EndTime Desc"); if (cacheAsDataTable == null) { return(null); } if (cacheAsDataTable.Rows.Count > 0) { Shove._Web.Cache.SetCache(key, cacheAsDataTable, 600); } } return(cacheAsDataTable); }
public static DataTable GetWinNumber(int LotteryID) { DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(WinNumber + LotteryID.ToString()); if ((cacheAsDataTable == null) || (cacheAsDataTable.Rows.Count == 0)) { cacheAsDataTable = new Tables.T_Isuses().Open("top 100 Name, WinLotteryNumber, EndTime", "LotteryID=" + LotteryID + " and IsOpened = 1 and IsNull(WinLotteryNumber,'')<>''", "EndTime Desc"); if (cacheAsDataTable == null) { return(cacheAsDataTable); } cacheAsDataTable.Columns.Add("ID", typeof(int)); int num = 1; foreach (DataRow row in cacheAsDataTable.Rows) { row["ID"] = num; num++; row["WinLotteryNumber"] = FormatWinNumber(row["WinLotteryNumber"].ToString(), LotteryID); } Cache.SetCache(WinNumber + LotteryID.ToString(), cacheAsDataTable, ((LotteryID == 0x3e) || (LotteryID == 0x1d)) ? 120 : 0xe10); } return(cacheAsDataTable); }
private void IsuseOpenNotice(string Transmessage) { XmlDocument document = new XmlDocument(); XmlNodeList elementsByTagName = null; XmlNodeList list2 = null; XmlNodeList list3 = null; try { document.Load(new StringReader(Transmessage)); elementsByTagName = document.GetElementsByTagName("*"); list2 = document.GetElementsByTagName("bonusItem"); list3 = document.GetElementsByTagName("issue"); } catch { } if (elementsByTagName != null) { string winNumber = ""; for (int i = 0; i < elementsByTagName.Count; i++) { if ((elementsByTagName[i].Name.ToUpper() == "BODY") && (elementsByTagName[i].FirstChild.Name.ToUpper() == "BONUSNOTIFY")) { winNumber = elementsByTagName[i].FirstChild.Attributes["bonusNumber"].InnerText; } } if (list3 == null) { base.Response.End(); } else { string messageID = elementsByTagName[0].Attributes["id"].Value; string input = list3[0].Attributes["number"].Value; string lotteryName = list3[0].Attributes["gameName"].Value; int LotteryID = this.GetLotteryID(lotteryName); string str5 = this.GetWinNumber(LotteryID, winNumber); DataTable table = new Tables.T_Isuses().Open("", " [Name] = '" + Utility.FilteSqlInfusion(input) + "' and LotteryID = " + LotteryID.ToString() + " and IsOpened = 0", ""); if ((table == null) || (table.Rows.Count < 1)) { base.Response.End(); } else { string str = table.Rows[0]["ID"].ToString(); new Tables.T_Isuses { WinLotteryNumber = { Value = str5 }, OpenOperatorID = { Value = 1 } }.Update(" ID = " + str); int returnValue = 0; string returnDescription = ""; if (LotteryID == 0x3e) { DataTable table2 = new Tables.T_WinTypes().Open("", " LotteryID =" + LotteryID.ToString(), ""); if ((table2 != null) && (table2.Rows.Count > 0)) { double[] winMoneyList = new double[table2.Rows.Count * 2]; double num3 = 0.0; double num4 = 0.0; for (int j = 0; j < table2.Rows.Count; j++) { num3 = _Convert.StrToDouble(table2.Rows[j]["DefaultMoney"].ToString(), 0.0); num4 = _Convert.StrToDouble(table2.Rows[j]["DefaultMoneyNoWithTax"].ToString(), 0.0); winMoneyList[j * 2] = (num3 == 0.0) ? 1.0 : num4; winMoneyList[(j * 2) + 1] = (num4 == 0.0) ? 1.0 : num4; } DataTable table3 = new Tables.T_Schemes().Open("", "IsuseID = " + str + " and WinMoney = 0 and Buyed = 1 and BuyOperatorID = 132011", ""); string number = ""; Lottery.LotteryBase base2 = new Lottery()[LotteryID]; string description = ""; double winMoneyNoWithTax = 0.0; for (int k = 0; k < table3.Rows.Count; k++) { number = table3.Rows[k]["LotteryNumber"].ToString(); description = ""; winMoneyNoWithTax = 0.0; double num8 = base2.ComputeWin(number, str5.Trim(), ref description, ref winMoneyNoWithTax, int.Parse(table3.Rows[k]["PlayTypeID"].ToString()), winMoneyList); if (num8 > 0.0) { MSSQL.ExecuteNonQuery("update T_Schemes set PreWinMoney = @p1, PreWinMoneyNoWithTax = @p2, WinMoney = @p3, WinMoneyNoWithTax = @p4, WinDescription = @p5 where [ID] = " + table3.Rows[k]["ID"].ToString(), new MSSQL.Parameter[] { new MSSQL.Parameter("p1", SqlDbType.Money, 0, ParameterDirection.Input, num8 * _Convert.StrToInt(table3.Rows[k]["Multiple"].ToString(), 1)), new MSSQL.Parameter("p2", SqlDbType.Money, 0, ParameterDirection.Input, winMoneyNoWithTax * _Convert.StrToInt(table3.Rows[k]["Multiple"].ToString(), 1)), new MSSQL.Parameter("p3", SqlDbType.Money, 0, ParameterDirection.Input, num8 * _Convert.StrToInt(table3.Rows[k]["Multiple"].ToString(), 1)), new MSSQL.Parameter("p4", SqlDbType.Money, 0, ParameterDirection.Input, winMoneyNoWithTax * _Convert.StrToInt(table3.Rows[k]["Multiple"].ToString(), 1)), new MSSQL.Parameter("p5", SqlDbType.VarChar, 0, ParameterDirection.Input, description) }); } } } } string bonusXML = "<Schemes>"; string agentBonusXML = "<Schemes>"; if ((list2 != null) && (list2.Count > 0)) { string s = Transmessage.Substring(Transmessage.IndexOf("<bonusNotify"), Transmessage.LastIndexOf("</body>") - Transmessage.IndexOf("<bonusNotify")); DataSet set = new DataSet(); try { set.ReadXml(new StringReader(s)); } catch (Exception exception) { new Log(@"ElectronTicket\HPSD").Write("电子票开奖,第 " + input + " 期解析开奖数据错误:" + exception.Message); base.Response.End(); return; } if ((set == null) || (set.Tables.Count < 3)) { new Log(@"ElectronTicket\HPSD").Write("电子票开奖,第 " + input + " 期开奖数据格式不符合要求。"); base.Response.End(); return; } DataTable source = set.Tables[2]; DataTable table5 = MSSQL.Select("SELECT SchemeID, AgentID, SchemesMultiple as Multiple, Identifiers FROM V_ElectronTicketAgentSchemesSendToCenter WHERE (IsuseID = " + str + ") UNION ALL SELECT SchemeID, 0 AS AgentID, SchemesMultiple as Multiple, Identifiers FROM V_SchemesSendToCenter WHERE (IsuseID = " + str + ")", new MSSQL.Parameter[0]); if (table5 == null) { new Log(@"ElectronTicket\HPSD").Write("电子票开奖,第 " + input + " 期,读取本地方案错误。"); base.Response.End(); return; } try { foreach (var type in from NewDt in (from NewDt in (from NewDtTickets in source.AsEnumerable() join NewdtScheme in table5.AsEnumerable() on NewDtTickets.Field <string>("ticketID") equals NewdtScheme.Field <string>("Identifiers") //Sum<Package>((Func<Package, double>) (pkg => pkg.Weight)); select new { ID = NewdtScheme.Field <long>("SchemeID"), AgentID = NewdtScheme.Field <long>("AgentID"), Multiple = NewdtScheme.Field <int>("Multiple"), Bonus = _Convert.StrToDouble(NewDtTickets.Field <string>("money"), 0.0), BonusLevel = NewDtTickets.Field <string>("bonusLevel") }).AsQueryable() group NewDt by new { ID = NewDt.ID, BonusLevel = NewDt.BonusLevel, AgentID = NewDt.AgentID, Multiple = NewDt.Multiple } into gg select new { ID = gg.Key.ID, AgentID = gg.Key.AgentID, Multiple = gg.Key.Multiple, Bonus = gg.Sum(NewDt => NewDt.Bonus), BonusLevel = this.GetWinDescription(LotteryID, gg.Key.BonusLevel) }).AsQueryable() group NewDt by new { ID = NewDt.ID, Multiple = NewDt.Multiple, AgentID = NewDt.AgentID } into t_dtSchemes select new { SchemeID = t_dtSchemes.Key.ID, AgentID = t_dtSchemes.Key.AgentID, Multiple = t_dtSchemes.Key.Multiple, Bonus = t_dtSchemes.Sum(NewDt => NewDt.Bonus), BonusLevel = "中奖金额:" + t_dtSchemes.Sum(NewDt => NewDt.Bonus).ToString() + ((t_dtSchemes.Key.Multiple != 1) ? ("(" + t_dtSchemes.Key.Multiple.ToString() + "倍)") : "") }) { string str13; if (type.AgentID == 0L) { str13 = bonusXML; bonusXML = str13 + "<Scheme SchemeID=\"" + type.SchemeID.ToString() + "\" WinMoney=\"" + type.Bonus.ToString() + "\" WinDescription=\"" + type.BonusLevel + "\" />"; } else { str13 = agentBonusXML; agentBonusXML = str13 + "<Scheme SchemeID=\"" + type.SchemeID.ToString() + "\" WinMoney=\"" + type.Bonus.ToString() + "\" WinDescription=\"" + type.BonusLevel + "\" />"; } } } catch (Exception exception2) { new Log(@"ElectronTicket\HPSD").Write("电子票开奖,第 " + input + " 期详细中奖数据解析错误:" + exception2.Message); base.Response.End(); return; } } bonusXML = bonusXML + "</Schemes>"; agentBonusXML = agentBonusXML + "</Schemes>"; table = new Tables.T_Isuses().Open("", "[ID] = " + str + " and IsOpened = 0", ""); if ((table == null) || (table.Rows.Count < 1)) { base.Response.End(); } else { DataSet ds = null; int num11 = 0; int num12 = -1; while ((num12 < 0) && (num11 < 5)) { returnValue = 0; returnDescription = ""; num12 = Procedures.P_ElectronTicketWin(ref ds, _Convert.StrToLong(str, 0L), bonusXML, agentBonusXML, ref returnValue, ref returnDescription); if (num12 < 0) { string[] strArray = new string[] { "电子票第 ", (num11 + 1).ToString(), " 次派奖出现错误(IsuseOpenNotice) 期号为: ", input, ",彩种为: ", LotteryID.ToString() }; new Log(@"ElectronTicket\HPSD").Write(string.Concat(strArray)); num11++; if (num11 < 5) { Thread.Sleep(0x2710); } } } if (returnValue < 0) { new Log(@"ElectronTicket\HPSD").Write("电子票派奖出现错误(IsuseOpenNotice) 期号为: " + input + ",彩种为: " + LotteryID.ToString() + ",错误:" + returnDescription); base.Response.End(); } else { DataTable table6 = new Tables.T_WinTypes().Open("", " LotteryID =" + LotteryID.ToString(), ""); if ((table6 != null) && (table6.Rows.Count > 0)) { double[] numArray2 = new double[table6.Rows.Count * 2]; double num14 = 0.0; double num15 = 0.0; for (int m = 0; m < table6.Rows.Count; m++) { num14 = _Convert.StrToDouble(table6.Rows[m]["DefaultMoney"].ToString(), 0.0); num15 = _Convert.StrToDouble(table6.Rows[m]["DefaultMoneyNoWithTax"].ToString(), 0.0); numArray2[m * 2] = (num14 == 0.0) ? 1.0 : num15; numArray2[(m * 2) + 1] = (num15 == 0.0) ? 1.0 : num15; } DataTable table7 = new Views.V_Schemes().Open("LotteryNumber, PlayTypeID, SiteID, ID, Multiple", " IsuseID = " + str + " and WinMoney = 0 and Buyed = 0", ""); string str14 = ""; Lottery.LotteryBase base3 = new Lottery()[LotteryID]; string str15 = ""; double num17 = 0.0; for (int n = 0; n < table7.Rows.Count; n++) { str14 = table7.Rows[n]["LotteryNumber"].ToString(); str15 = ""; num17 = 0.0; double winMoney = base3.ComputeWin(str14, str5.Trim(), ref str15, ref num17, int.Parse(table7.Rows[n]["PlayTypeID"].ToString()), numArray2); if ((winMoney > 0.0) && (Procedures.P_ChaseTaskStopWhenWin(_Convert.StrToLong(table7.Rows[n]["SiteID"].ToString(), 0L), _Convert.StrToLong(table7.Rows[n]["ID"].ToString(), 0L), winMoney, ref returnValue, ref returnDescription) < 0)) { new Log(@"ElectronTicket\HPSD").Write("执行电子票--判断是否停止追号的时候出现错误"); } } } PF.SendWinNotification(ds); messageID = elementsByTagName[0].Attributes["id"].Value; this.ReNotice(messageID, "508"); } } } } } }
protected void btnAdd_Click(object sender, EventArgs e) { string name = ""; try { name = Utility.FilteSqlInfusion(this.tbIsuse.Text.Trim()); } catch { } if (name == "") { JavaScript.Alert(this.Page, "期号不能为空!"); } else { DataTable table = new Tables.T_Isuses().Open("[ID]", "[Name] = '" + name + "' and LotteryID = " + Utility.FilteSqlInfusion(this.tbLotteryID.Text), ""); if (table == null) { PF.GoError(4, "数据库繁忙,请重试", "Admin_IsuseAdd"); } else if (table.Rows.Count > 0) { JavaScript.Alert(this.Page, "期号已经存在,请不要输入重名期号!"); } else { object obj2 = PF.ValidLotteryTime(this.tbStartTime.Text); if (obj2 == null) { JavaScript.Alert(this.Page, "开始时间格式输入错误!"); } else { DateTime startTime = (DateTime)obj2; obj2 = PF.ValidLotteryTime(this.tbEndTime.Text); if (obj2 == null) { JavaScript.Alert(this.Page, "截止时间格式输入错误!"); } else { DateTime endTime = (DateTime)obj2; if (endTime <= startTime) { JavaScript.Alert(this.Page, "截止时间应该在开始时间之后!"); } else { string additionasXml = ""; if ((((((this.tbLotteryID.Text != "1") || (this.BuildAdditionasXmlForSFC(ref additionasXml) >= 0)) && ((this.tbLotteryID.Text != "2") || (this.BuildAdditionasXmlForJQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "15") || (this.BuildAdditionasXmlForLCBQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "19") || (this.BuildAdditionasXmlForLCDC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "45") || (this.BuildAdditionasXmlForZCDC(ref additionasXml) >= 0))) { int lotteryID = int.Parse(this.tbLotteryID.Text); long isuseID = -1L; string returnDescription = ""; int num3 = Procedures.P_IsuseAdd(lotteryID, name, startTime, endTime, additionasXml, ref isuseID, ref returnDescription); if (num3 < 0) { PF.GoError(4, "数据库繁忙,请重试", "Admin_IsuseAdd"); } else if (isuseID < 0L) { PF.GoError(1, returnDescription, "Admin_IsuseAdd"); } else if (new Tables.T_TotalMoney { IsuseID = { Value = isuseID }, TotalMoney = { Value = this.tbMoney.Text } }.Insert() < 0L) { JavaScript.Alert(this.Page, "添加奖池奖金失败!"); } else { if ((this.cbAutoNext10Isuse.Visible && this.cbAutoNext10Isuse.Checked) && (additionasXml == "")) { string str4 = name.Substring(0, name.Length - 3); int num4 = _Convert.StrToInt(name.Substring(name.Length - 3, 3), 0); for (int i = 1; i <= 9; i++) { num4++; string str5 = str4 + num4.ToString().PadLeft(3, '0'); startTime = startTime.AddDays(1.0); endTime = endTime.AddDays(1.0); Procedures.P_IsuseAdd(lotteryID, str5, startTime, endTime, "", ref isuseID, ref returnDescription); if (num3 < 0) { break; } } } Shove._Web.Cache.ClearCache("LotteryCalendar"); Shove._Web.Cache.ClearCache(DataCache.IsusesInfo + this.tbLotteryID.Text.Trim()); base.Response.Redirect("Isuse.aspx?LotteryID=" + this.tbLotteryID.Text, true); } } } } } } } }
private void BindDataForType() { int num = 7; try { num = int.Parse(this.ViewState["Home_Lottery_Shssl_Play_Type"].ToString()); } catch { num = 7; } if ((num < 1) || (num > 7)) { PF.GoError(1, "参数错误", base.GetType().FullName); } else { DataTable table = new Tables.T_Isuses().Open("top 1 ID", "StartTime < Getdate() and LotteryID=" + this.HidLotteryID.Value, " EndTime desc"); if (table == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().FullName); } else if (table.Rows.Count != 0) { string str = table.Rows[0]["ID"].ToString(); string str2 = string.Concat(new object[] { "SiteID = ", base._Site.ID, " and IsuseID = ", str, " and LotteryID = ", this.HidLotteryID.Value }); string key = ""; switch (num) { case 1: key = "select SchemeNumber, InitiateName, Level, Money, PlayTypeName, Schedule, ID, InitiateUserID, QuashStatus, PlayTypeID, Buyed, SecrecyLevel, EndTime, IsOpened, LotteryNumber, IsuseName from V_Schemes with (nolock) where " + str2 + " and [Money] >= 1000 order by QuashStatus, AtTopStatus desc, ReSchedule desc, [Money] desc"; break; case 2: key = "select SchemeNumber, InitiateName, Level, Money, PlayTypeName, Schedule, ID, InitiateUserID, QuashStatus, PlayTypeID, Buyed, SecrecyLevel, EndTime, IsOpened, LotteryNumber, IsuseName from V_Schemes with (nolock) where " + str2 + " and [Money] < 1000 order by QuashStatus, AtTopStatus desc, ReSchedule desc, [Money] desc"; break; case 3: key = "select SchemeNumber, InitiateName, Level, Money, PlayTypeName, Schedule, ID, InitiateUserID, QuashStatus, PlayTypeID, Buyed, SecrecyLevel, EndTime, IsOpened, LotteryNumber, IsuseName from V_Schemes with (nolock) where " + str2 + " and Share = BuyedShare order by QuashStatus, AtTopStatus desc, ReSchedule desc, [Money] desc"; break; case 4: key = "select SchemeNumber, InitiateName, Level, Money, PlayTypeName, Schedule, ID, InitiateUserID, QuashStatus, PlayTypeID, Buyed, SecrecyLevel, EndTime, IsOpened, LotteryNumber, IsuseName from V_Schemes with (nolock) where " + str2 + " and Share > BuyedShare order by QuashStatus, AtTopStatus desc, ReSchedule desc, [Money] desc"; break; case 5: key = "select SchemeNumber, InitiateName, Level, Money, PlayTypeName, Schedule, ID, InitiateUserID, QuashStatus, PlayTypeID, Buyed, SecrecyLevel, EndTime, IsOpened, LotteryNumber, IsuseName from V_Schemes with (nolock) where " + str2 + " and (QuashStatus <> 0) order by AtTopStatus desc, ReSchedule desc, [Money] desc"; break; case 6: key = "select SchemeNumber, InitiateName, Level, Money, PlayTypeName, Schedule, ID, InitiateUserID, QuashStatus, PlayTypeID, Buyed, SecrecyLevel, EndTime, IsOpened, LotteryNumber, IsuseName from V_Schemes with (nolock) where " + str2 + " and AssureMoney > 0 order by QuashStatus, AtTopStatus desc, ReSchedule desc, [Money] desc"; break; case 7: key = "select SchemeNumber, InitiateName, Level, Money, PlayTypeName, Schedule, ID, InitiateUserID, QuashStatus, PlayTypeID, Buyed, SecrecyLevel, EndTime, IsOpened, LotteryNumber, IsuseName from V_Schemes with (nolock) where " + str2 + " order by QuashStatus, AtTopStatus desc, ReSchedule desc, [Money] desc"; break; } DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { cacheAsDataTable = MSSQL.Select(key, new MSSQL.Parameter[0]); if (cacheAsDataTable == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().FullName); return; } Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60); } PF.DataGridBindData(this.g, cacheAsDataTable, this.gPager); this.gPager.Visible = true; } } }
protected void btnAdd_Click(object sender, EventArgs e) { DateTime time; try { time = DateTime.Parse(this.tbDate.Text); } catch { JavaScript.Alert(this.Page, "开始日期输入错误。"); return; } int num = _Convert.StrToInt(this.tbDays.Text, 0); if (num >= 1) { if (num > 10) { JavaScript.Alert(this.Page, "高频彩种一次最多只能增加10天。"); } else { int lotteryID = int.Parse(this.tbLotteryID.Text); if (lotteryID == 0x1c) { string str = Functions.F_GetLotteryIntervalType(lotteryID); int num3 = int.Parse(str.Substring(1, str.IndexOf(";") - 1)); string str2 = str.Substring(str.IndexOf(";") + 1, 8); int.Parse(str.Substring(str.LastIndexOf(";") + 1)); for (int i = 0; i < num; i++) { DataTable table; string str3 = time.Date.ToShortDateString(); table = table = new Tables.T_Isuses().Open("[ID]", "StartTime between '" + str3 + " 02:00:00' and '" + str3 + " 23:59:59' and LotteryID = " + Utility.FilteSqlInfusion(this.tbLotteryID.Text), ""); if (table == null) { PF.GoError(4, "数据库繁忙,请重试", "Admin_IsuseAddForKeno"); return; } if (table.Rows.Count > 0) { time = time.AddDays(1.0); } else { DateTime startTime = DateTime.Parse(time.Date.ToShortDateString() + " 0:0:0"); DateTime endTime = startTime.AddMinutes(5.0); string name = time.Year.ToString() + time.Month.ToString().PadLeft(2, '0') + time.Day.ToString().PadLeft(2, '0') + "-001"; long isuseID = 0L; string returnDescription = ""; if (Procedures.P_IsuseAdd(lotteryID, name, startTime, endTime, "", ref isuseID, ref returnDescription) < 0) { PF.GoError(4, "数据库繁忙,请重试", "Admin_IsuseAddForKeno"); return; } if (isuseID < 0L) { PF.GoError(1, returnDescription, "Admin_IsuseAddForKeno"); return; } for (int j = 2; j <= 0x17; j++) { startTime = endTime; endTime = endTime.AddMinutes(5.0); name = name = time.Year.ToString() + time.Month.ToString().PadLeft(2, '0') + time.Day.ToString().PadLeft(2, '0') + "-" + j.ToString().PadLeft(3, '0'); if (Procedures.P_IsuseAdd(lotteryID, name, startTime, endTime, "", ref isuseID, ref returnDescription) < 0) { break; } } startTime = DateTime.Parse(time.Date.ToShortDateString() + " 01:55:00"); endTime = DateTime.Parse(time.Date.ToShortDateString() + " " + str2); name = time.Year.ToString() + time.Month.ToString().PadLeft(2, '0') + time.Day.ToString().PadLeft(2, '0') + "-024"; if (Procedures.P_IsuseAdd(lotteryID, name, startTime, endTime, "", ref isuseID, ref returnDescription) < 0) { PF.GoError(4, "数据库繁忙,请重试", "Admin_IsuseAddForKeno"); return; } for (int k = 0x19; k <= 0x60; k++) { startTime = endTime; endTime = endTime.AddMinutes((double)num3); name = name = time.Year.ToString() + time.Month.ToString().PadLeft(2, '0') + time.Day.ToString().PadLeft(2, '0') + "-" + k.ToString().PadLeft(3, '0'); if (Procedures.P_IsuseAdd(lotteryID, name, startTime, endTime, "", ref isuseID, ref returnDescription) < 0) { break; } } if (lotteryID == 0x1c) { for (int m = 0x61; m <= 120; m++) { startTime = endTime; endTime = endTime.AddMinutes(5.0); name = this.ConvertIsuseName(lotteryID, time.Year.ToString() + time.Month.ToString().PadLeft(2, '0') + time.Day.ToString().PadLeft(2, '0') + "-" + m.ToString().PadLeft(3, '0')); if (Procedures.P_IsuseAdd(lotteryID, name, startTime, endTime, "", ref isuseID, ref returnDescription) < 0) { break; } } } time = time.AddDays(1.0); } } } else { string str6 = Functions.F_GetLotteryIntervalType(lotteryID); int num25 = int.Parse(str6.Substring(1, str6.IndexOf(";") - 1)); string str7 = str6.Substring(str6.IndexOf(";") + 1, 8); int num26 = int.Parse(str6.Substring(str6.LastIndexOf(";") + 1)); for (int n = 0; n < num; n++) { string str8 = time.Date.ToShortDateString(); DataTable table2 = new Tables.T_Isuses().Open("[ID]", "StartTime between '" + str8 + " 0:0:0' and '" + str8 + " 23:59:59' and LotteryID = " + Utility.FilteSqlInfusion(this.tbLotteryID.Text), ""); if (table2 == null) { PF.GoError(4, "数据库繁忙,请重试", "Admin_IsuseAddForKeno"); return; } if (table2.Rows.Count > 0) { time = time.AddDays(1.0); } else { DateTime time10 = DateTime.Parse(time.Date.ToShortDateString() + " 0:0:0"); DateTime time12 = DateTime.Parse(time.Date.ToShortDateString() + " " + str7); string str9 = this.ConvertIsuseName(lotteryID, time.Year.ToString() + time.Month.ToString().PadLeft(2, '0') + time.Day.ToString().PadLeft(2, '0') + "01"); long num29 = -1L; string str10 = ""; if (Procedures.P_IsuseAdd(lotteryID, str9, time10, time12, "", ref num29, ref str10) < 0) { PF.GoError(4, "数据库繁忙,请重试", "Admin_IsuseAddForKeno"); return; } if (num29 < 0L) { PF.GoError(1, str10, "Admin_IsuseAddForKeno"); return; } for (int num31 = 2; num31 <= num26; num31++) { time10 = time12; time12 = time12.AddMinutes((double)num25); str9 = this.ConvertIsuseName(lotteryID, time.Year.ToString() + time.Month.ToString().PadLeft(2, '0') + time.Day.ToString().PadLeft(2, '0') + num31.ToString().PadLeft(2, '0')); if (Procedures.P_IsuseAdd(lotteryID, str9, time10, time12, "", ref num29, ref str10) < 0) { break; } } time = time.AddDays(1.0); } } } base.Response.Redirect("Isuse.aspx?LotteryID=" + this.tbLotteryID.Text, true); } } else { JavaScript.Alert(this.Page, "请输入要连续增加的天数。"); } }
private void IsuseNotice(string TransMessage) { XmlDocument document = new XmlDocument(); XmlNodeList elementsByTagName = null; XmlNodeList list2 = null; try { document.Load(new StringReader(TransMessage)); elementsByTagName = document.GetElementsByTagName("*"); list2 = document.GetElementsByTagName("issue"); } catch { } if (elementsByTagName == null) { base.Response.End(); } else { Tables.T_Isuses isuses = new Tables.T_Isuses(); for (int i = 0; i < elementsByTagName.Count; i++) { if ((elementsByTagName[i].Name.ToUpper() == "BODY") && (elementsByTagName[i].FirstChild.Name.ToUpper() == "ISSUENOTIFY")) { for (int j = 0; j < list2.Count; j++) { string str = list2[j].Attributes["number"].Value; string lotteryName = list2[j].Attributes["gameName"].Value; string str3 = list2[j].Attributes["status"].Value; string s = list2[j].Attributes["startTime"].Value; string str5 = list2[j].Attributes["stopTime"].Value; int lotteryID = this.GetLotteryID(lotteryName); string winNumber = ""; try { winNumber = this.GetWinNumber(lotteryID, list2[j].Attributes["bonusCode"].Value); } catch { } if ((lotteryID >= 0) && !string.IsNullOrEmpty(str)) { if (isuses.GetCount("LotteryID = " + lotteryID.ToString() + " and [Name] = '" + Utility.FilteSqlInfusion(str) + "'") < 1L) { DateTime now = DateTime.Now; DateTime endTime = DateTime.Now; try { now = DateTime.Parse(s); endTime = DateTime.Parse(str5); } catch { goto Label_0611; } long isuseID = -1L; string returnDescription = ""; if ((Procedures.P_IsuseAdd(lotteryID, str, now, endTime, "", ref isuseID, ref returnDescription) < 0) || (isuseID < 0L)) { goto Label_0611; } } DataTable table = isuses.Open("ID, State, WinLotteryNumber", "LotteryID = " + lotteryID.ToString() + " and [Name] = '" + Utility.FilteSqlInfusion(str) + "'", ""); if ((table != null) && (table.Rows.Count >= 1)) { if (str3 == "4") { int returnValue = 0; string returnDescptrion = ""; if (Procedures.P_ElectronTicketAgentSchemeQuash(_Convert.StrToLong(table.Rows[0]["ID"].ToString(), 0L), ref returnValue, ref returnDescptrion) < 0) { new Log(@"ElectronTicket\HPSH").Write("电子票方案撤单错误_P_ElectronTicketAgentSchemeQuash"); goto Label_0611; } } bool flag = false; if (table.Rows[0]["State"].ToString() != str3) { isuses.State.Value = str3; isuses.StateUpdateTime.Value = DateTime.Now; flag = true; } if (!string.IsNullOrEmpty(winNumber) && (table.Rows[0]["WinLotteryNumber"].ToString() != winNumber)) { isuses.WinLotteryNumber.Value = winNumber; flag = true; if (lotteryID == 0x1d) { DataTable table2 = new Tables.T_WinTypes().Open("", "LotteryID =" + lotteryID.ToString(), ""); double[] winMoneyList = new double[table2.Rows.Count * 2]; for (int k = 0; k < table2.Rows.Count; k++) { winMoneyList[k * 2] = _Convert.StrToDouble(table2.Rows[k]["DefaultMoney"].ToString(), 1.0); winMoneyList[(k * 2) + 1] = _Convert.StrToDouble(table2.Rows[k]["DefaultMoneyNoWithTax"].ToString(), 1.0); } DataTable table3 = new Tables.T_ChaseTaskDetails().Open("", "IsuseID=" + table.Rows[0]["ID"].ToString() + " and SchemeID IS NOT NULL", ""); for (int m = 0; m < table3.Rows.Count; m++) { string number = table3.Rows[m]["LotteryNumber"].ToString(); string description = ""; double winMoneyNoWithTax = 0.0; double winMoney = new Lottery()[lotteryID].ComputeWin(number, winNumber, ref description, ref winMoneyNoWithTax, int.Parse(table3.Rows[m]["PlayTypeID"].ToString()), winMoneyList); if (winMoney >= 1.0) { int num10 = 0; string str11 = ""; if (Procedures.P_ChaseTaskStopWhenWin(_Convert.StrToLong(table3.Rows[m]["SiteID"].ToString(), 1L), _Convert.StrToLong(table3.Rows[m]["SchemeID"].ToString(), 0L), winMoney, ref num10, ref str11) < 0) { new Log(@"ElectronTicket\HPSH").Write("电子票撤销追号错误_P_ChaseTaskStopWhenWin。"); } } } } } if (flag) { isuses.Update("LotteryID = " + lotteryID.ToString() + " and [Name] = '" + Utility.FilteSqlInfusion(str) + "'"); } } Label_0611 :; } } } } string messageID = elementsByTagName[0].Attributes["id"].Value; this.ReNotice(messageID, "501"); } }
private void BindData() { DataTable table = new Tables.T_Isuses().Open("", "[ID]=" + Utility.FilteSqlInfusion(this.tbIsuseID.Text), ""); if ((table == null) || (table.Rows.Count < 1)) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); } else { this.tbIsuse.Text = table.Rows[0]["Name"].ToString(); this.tbStartTime.Text = _Convert.StrToDateTime(table.Rows[0]["StartTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss"); this.tbEndTime.Text = _Convert.StrToDateTime(table.Rows[0]["EndTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss"); if (this.tbLotteryID.Text == "1") { table = new Tables.T_IsuseForSFC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]"); if ((table == null) || (table.Rows.Count < 14)) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); return; } for (int i = 0; i < 14; i++) { int num2 = i + 1; TextBox box = (TextBox)this.FindControl("tbSFC" + num2.ToString()); int num3 = i + 1; TextBox box2 = (TextBox)this.FindControl("tbSFC" + num3.ToString() + "_1"); int num4 = i + 1; TextBox box3 = (TextBox)this.FindControl("tbSFC" + num4.ToString() + "_2"); box.Text = table.Rows[i]["HostTeam"].ToString(); box2.Text = table.Rows[i]["QuestTeam"].ToString(); box3.Text = table.Rows[i]["DateTime"].ToString(); } } if (this.tbLotteryID.Text == "2") { table = new Tables.T_IsuseForJQC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]"); if ((table == null) || (table.Rows.Count < 8)) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); return; } for (int j = 0; j < 8; j++) { int num6 = j + 1; TextBox box4 = (TextBox)this.FindControl("tbJQC" + num6.ToString()); int num7 = j + 1; TextBox box5 = (TextBox)this.FindControl("tbJQC" + num7.ToString() + "_2"); box4.Text = table.Rows[j]["Team"].ToString(); box5.Text = table.Rows[j]["DateTime"].ToString(); } } if (this.tbLotteryID.Text == "15") { table = new Tables.T_IsuseForLCBQC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]"); if ((table == null) || (table.Rows.Count < 6)) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); return; } for (int k = 0; k < 6; k++) { int num9 = k + 1; TextBox box6 = (TextBox)this.FindControl("tbLCBQC" + num9.ToString()); int num10 = k + 1; TextBox box7 = (TextBox)this.FindControl("tbLCBQC" + num10.ToString() + "_1"); int num11 = k + 1; TextBox box8 = (TextBox)this.FindControl("tbLCBQC" + num11.ToString() + "_2"); box6.Text = table.Rows[k]["HostTeam"].ToString(); box7.Text = table.Rows[k]["QuestTeam"].ToString(); box8.Text = table.Rows[k]["DateTime"].ToString(); } } if (this.tbLotteryID.Text == "19") { table = new Tables.T_IsuseForLCDC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]"); if ((table == null) || (table.Rows.Count < 1)) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); return; } for (int m = 0; m < 1; m++) { int num13 = m + 1; TextBox box9 = (TextBox)this.FindControl("tbLCDC" + num13.ToString()); int num14 = m + 1; TextBox box10 = (TextBox)this.FindControl("tbLCDC" + num14.ToString() + "_1"); int num15 = m + 1; TextBox box11 = (TextBox)this.FindControl("tbLCDC" + num15.ToString() + "_2"); box9.Text = table.Rows[m]["HostTeam"].ToString(); box10.Text = table.Rows[m]["QuestTeam"].ToString(); box11.Text = table.Rows[m]["DateTime"].ToString(); } } if (this.tbLotteryID.Text == "45") { table = new Tables.T_IsuseForZCDC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]"); if ((table == null) || (table.Rows.Count < 1)) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); return; } this.DataListZCDC.DataSource = table.DefaultView; this.DataListZCDC.DataBind(); } DataTable table2 = new Tables.T_TestNumber().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), ""); DataTable table3 = new Tables.T_TotalMoney().Open("", "IsuseID= " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), ""); if (table2 == null) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); } else if (table3 == null) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); } else { if (table2.Rows.Count > 0) { this.tbTestNumber.Text = table2.Rows[0]["TestNumber"].ToString(); this.hidID.Value = table2.Rows[0]["ID"].ToString(); } if (table3.Rows.Count > 0) { this.tbMoney.Text = table3.Rows[0]["TotalMoney"].ToString(); this.moneyID.Value = table3.Rows[0]["ID"].ToString(); } } } }
protected void btnEdit_Click(object sender, EventArgs e) { string name = ""; try { name = Utility.FilteSqlInfusion(this.tbIsuse.Text.Trim()); } catch { } if (name == "") { JavaScript.Alert(this.Page, "期号不能为空!"); } else { DataTable table = new Tables.T_Isuses().Open("[ID]", "[Name]='" + name + "' and LotteryID=" + Utility.FilteSqlInfusion(this.tbLotteryID.Text) + " and [ID] <> " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), ""); if (table == null) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); } else if (table.Rows.Count > 0) { JavaScript.Alert(this.Page, "期号已经存在,请不要输入重名期号!"); } else { object obj2 = PF.ValidLotteryTime(this.tbStartTime.Text); if (obj2 == null) { JavaScript.Alert(this.Page, "开始时间格式输入错误!"); } else { DateTime startTime = (DateTime)obj2; obj2 = PF.ValidLotteryTime(this.tbEndTime.Text); if (obj2 == null) { JavaScript.Alert(this.Page, "截止时间格式输入错误!"); } else { DateTime endTime = (DateTime)obj2; if (endTime <= startTime) { JavaScript.Alert(this.Page, "截止时间应该在开始时间之后!"); } else { string additionasXml = ""; if ((((((this.tbLotteryID.Text != "1") || (this.BuildAdditionasXmlForSFC(ref additionasXml) >= 0)) && ((this.tbLotteryID.Text != "2") || (this.BuildAdditionasXmlForJQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "15") || (this.BuildAdditionasXmlForLCBQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "19") || (this.BuildAdditionasXmlForLCDC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "45") || (this.BuildAdditionasXmlForZCDC(ref additionasXml) >= 0))) { long isuseID = long.Parse(this.tbIsuseID.Text); int returnValue = -1; string returnDescription = ""; if (Procedures.P_IsuseEdit(isuseID, name, startTime, endTime, additionasXml, ref returnValue, ref returnDescription) < 0) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); } else if (returnValue < 0) { PF.GoError(1, returnDescription, this.Page.GetType().BaseType.FullName); } else { base.Response.Redirect("Isuse2.aspx?LotteryID=" + this.tbLotteryID.Text, true); } } } } } } } }
private void IsuseOpenNotice(string Transmessage) { XmlDocument document = new XmlDocument(); XmlNodeList elementsByTagName = null; XmlNodeList list2 = null; XmlNodeList list3 = null; try { document.Load(new StringReader(Transmessage)); elementsByTagName = document.GetElementsByTagName("*"); list2 = document.GetElementsByTagName("bonusItem"); list3 = document.GetElementsByTagName("issue"); } catch { } if (elementsByTagName != null) { string winNumber = ""; for (int i = 0; i < elementsByTagName.Count; i++) { if ((elementsByTagName[i].Name.ToUpper() == "BODY") && (elementsByTagName[i].FirstChild.Name.ToUpper() == "BONUSNOTIFY")) { winNumber = elementsByTagName[i].FirstChild.Attributes["bonusNumber"].InnerText; } } if (list3 == null) { base.Response.End(); } else { string messageID = elementsByTagName[0].Attributes["id"].Value; string input = list3[0].Attributes["number"].Value; string lotteryName = list3[0].Attributes["gameName"].Value; int LotteryID = this.GetLotteryID(lotteryName); string str5 = this.GetWinNumber(LotteryID, winNumber); DataTable table = new Tables.T_Isuses().Open("", " [Name] = '" + Utility.FilteSqlInfusion(input) + "' and LotteryID = " + LotteryID.ToString() + " and IsOpened = 0", ""); if ((table == null) || (table.Rows.Count < 1)) { base.Response.End(); } else { string str = table.Rows[0]["ID"].ToString(); new Tables.T_Isuses { WinLotteryNumber = { Value = str5 }, OpenOperatorID = { Value = 1 } }.Update(" ID = " + str); string bonusXML = "<Schemes>"; string agentBonusXML = "<Schemes>"; if ((list2 != null) && (list2.Count > 0)) { string s = Transmessage.Substring(Transmessage.IndexOf("<bonusNotify"), Transmessage.LastIndexOf("</body>") - Transmessage.IndexOf("<bonusNotify")); DataSet set = new DataSet(); try { set.ReadXml(new StringReader(s)); } catch (Exception exception) { new Log(@"ElectronTicket\HPSH").Write("电子票开奖,第 " + input + " 期解析开奖数据错误:" + exception.Message); base.Response.End(); return; } if ((set == null) || (set.Tables.Count < 3)) { new Log(@"ElectronTicket\HPSH").Write("电子票开奖,第 " + input + " 期开奖数据格式不符合要求。"); base.Response.End(); return; } DataTable source = set.Tables[2]; DataTable table3 = MSSQL.Select("SELECT SchemeID, AgentID, SchemesMultiple as Multiple, Identifiers FROM V_ElectronTicketAgentSchemesSendToCenter WHERE (IsuseID = " + str + ") UNION ALL SELECT SchemeID, 0 AS AgentID, SchemesMultiple as Multiple, Identifiers FROM V_SchemesSendToCenter WHERE (IsuseID = " + str + ")", new MSSQL.Parameter[0]); if (table3 == null) { new Log(@"ElectronTicket\HPSH").Write("电子票开奖,第 " + input + " 期,读取本地方案错误。"); base.Response.End(); return; } try { foreach (var type in from NewDt in (from NewDt in (from NewDtTickets in source.AsEnumerable() join NewdtScheme in table3.AsEnumerable() on NewDtTickets.Field <string>("ticketID") equals NewdtScheme.Field <string>("Identifiers") select new { ID = NewdtScheme.Field <long>("SchemeID"), AgentID = NewdtScheme.Field <long>("AgentID"), Multiple = NewdtScheme.Field <int>("Multiple"), Bonus = _Convert.StrToDouble(NewDtTickets.Field <string>("money"), 0.0), BonusLevel = NewDtTickets.Field <string>("bonusLevel"), Size = _Convert.StrToInt(NewDtTickets.Field <string>("size"), 1) }).AsQueryable() group NewDt by new { NewDt.ID, NewDt.BonusLevel, NewDt.AgentID, NewDt.Multiple } into gg select new { ID = gg.Key.ID, AgentID = gg.Key.AgentID, Multiple = gg.Key.Multiple, Bonus = gg.Sum(NewDt => NewDt.Bonus), BonusLevel = this.GetSchemeWinDescription(gg.Key.BonusLevel, LotteryID, gg.Sum(NewDt => NewDt.Size) / gg.Key.Multiple) }).AsQueryable() group NewDt by new { ID = NewDt.ID, Multiple = NewDt.Multiple, AgentID = NewDt.AgentID } into t_dtSchemes select new { SchemeID = t_dtSchemes.Key.ID, AgentID = t_dtSchemes.Key.AgentID, Multiple = t_dtSchemes.Key.Multiple, Bonus = t_dtSchemes.Sum(NewDt => NewDt.Bonus), BonusLevel = t_dtSchemes.Merge(NewDt => NewDt.BonusLevel) + ((t_dtSchemes.Key.Multiple != 1) ? ("(" + t_dtSchemes.Key.Multiple.ToString() + "倍)") : "") }) { string str10; if (type.AgentID == 0L) { str10 = bonusXML; bonusXML = str10 + "<Scheme SchemeID=\"" + type.SchemeID.ToString() + "\" WinMoney=\"" + type.Bonus.ToString() + "\" WinDescription=\"" + type.BonusLevel + "\" />"; } else { str10 = agentBonusXML; agentBonusXML = str10 + "<Scheme SchemeID=\"" + type.SchemeID.ToString() + "\" WinMoney=\"" + type.Bonus.ToString() + "\" WinDescription=\"" + type.BonusLevel + "\" />"; } } } catch (Exception exception2) { new Log(@"ElectronTicket\HPSH").Write("电子票开奖,第 " + input + " 期详细中奖数据解析错误:" + exception2.Message); base.Response.End(); return; } } bonusXML = bonusXML + "</Schemes>"; agentBonusXML = agentBonusXML + "</Schemes>"; table = new Tables.T_Isuses().Open("", "[ID] = " + str + " and IsOpened = 0", ""); if ((table == null) || (table.Rows.Count < 1)) { base.Response.End(); } else { int returnValue = 0; string returnDescription = ""; DataSet ds = null; int num5 = 0; int num6 = -1; string appSettingsString = WebConfig.GetAppSettingsString("ConnectionString"); if (appSettingsString.StartsWith("0x78AD")) { appSettingsString = Encrypt.Decrypt3DES(PF.GetCallCert(), appSettingsString.Substring(6), PF.DesKey); } SqlConnection conn = MSSQL.CreateDataConnection(appSettingsString + ";Connect Timeout=150;"); if (conn != null) { while ((num6 < 0) && (num5 < 5)) { returnValue = 0; returnDescription = ""; num6 = this.P_ElectronTicketWin(conn, ref ds, _Convert.StrToLong(str, 0L), bonusXML, agentBonusXML, ref returnValue, ref returnDescription); if (num6 < 0) { string[] strArray = new string[] { "电子票第 ", (num5 + 1).ToString(), " 次派奖出现错误(IsuseOpenNotice) 期号为: ", input, ",彩种为: ", LotteryID.ToString() }; new Log(@"ElectronTicket\HPSH").Write(string.Concat(strArray)); num5++; if (num5 < 5) { Thread.Sleep(0x2710); } } } if (returnValue < 0) { new Log(@"ElectronTicket\HPSH").Write("电子票派奖出现错误(IsuseOpenNotice) 期号为: " + input + ",彩种为: " + LotteryID.ToString() + ",错误:" + returnDescription); base.Response.End(); } else { PF.SendWinNotification(ds); DataTable table4 = new Tables.T_WinTypes().Open("", " LotteryID =" + LotteryID.ToString(), ""); if ((table4 != null) && (table4.Rows.Count > 0)) { double[] winMoneyList = new double[table4.Rows.Count * 2]; double num8 = 0.0; double num9 = 0.0; for (int j = 0; j < table4.Rows.Count; j++) { num8 = _Convert.StrToDouble(table4.Rows[j]["DefaultMoney"].ToString(), 0.0); num9 = _Convert.StrToDouble(table4.Rows[j]["DefaultMoneyNoWithTax"].ToString(), 0.0); winMoneyList[j * 2] = (num8 == 0.0) ? 1.0 : num9; winMoneyList[(j * 2) + 1] = (num9 == 0.0) ? 1.0 : num9; } DataTable table5 = new Views.V_Schemes().Open("", " IsuseName = '" + Utility.FilteSqlInfusion(input) + "' and LotteryID = " + LotteryID.ToString() + " and WinMoney = 0 and Buyed = 0 and ID in ( select ID from V_ChaseTaskDetails where IsuseName = '" + Utility.FilteSqlInfusion(input) + "' and LotteryID = " + LotteryID.ToString() + ")", ""); string number = ""; Lottery.LotteryBase base2 = new Lottery()[LotteryID]; string description = ""; double winMoneyNoWithTax = 0.0; for (int k = 0; k < table5.Rows.Count; k++) { number = table5.Rows[k]["LotteryNumber"].ToString(); description = ""; winMoneyNoWithTax = 0.0; double winMoney = base2.ComputeWin(number, str5.Trim(), ref description, ref winMoneyNoWithTax, int.Parse(table5.Rows[k]["PlayTypeID"].ToString()), winMoneyList); if ((winMoney > 0.0) && (Procedures.P_ChaseTaskStopWhenWin(_Convert.StrToLong(table5.Rows[k]["SiteID"].ToString(), 0L), _Convert.StrToLong(table5.Rows[k]["ID"].ToString(), 0L), winMoney, ref returnValue, ref returnDescription) < 0)) { new Log(@"ElectronTicket\HPSH").Write("执行电子票--判断是否停止追号的时候出现错误"); } } } messageID = elementsByTagName[0].Attributes["id"].Value; this.ReNotice(messageID, "508"); } } else { base.Response.End(); } } } } } }
public string BindHotAndCoolAndMiss(int sscBuyType) { string key = "Lottery_Buy_SSC_BindHotAndCoolAndMiss"; DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key); if (cacheAsDataTable == null) { cacheAsDataTable = new Tables.T_Isuses().Open("Top 100 WinLotteryNumber", "LotteryID=61 and IsOpened = 1 and WinLotteryNumber <> ''", "[EndTime] desc"); Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60); } string str2 = string.Empty; if (sscBuyType == 0) { int[] numArray = new int[] { 100, 100, 100, 100 }; int[] numArray2 = new int[] { 100, 100, 100, 100 }; for (int m = 0; m < cacheAsDataTable.Rows.Count; m++) { string str3 = cacheAsDataTable.Rows[m]["WinLotteryNumber"].ToString().Trim(); if (str3.Length == 5) { int num2 = int.Parse(str3.Substring(3, 1)); int num3 = int.Parse(str3.Substring(4, 1)); if (num2 > 4) { if (numArray[0] == 100) { numArray[0] = m; } } else if (numArray[1] == 100) { numArray[1] = m; } if (num3 > 4) { if (numArray2[0] == 100) { numArray2[0] = m; } } else if (numArray2[1] == 100) { numArray2[1] = m; } if ((num2 % 2) == 1) { if (numArray[2] == 100) { numArray[2] = m; } } else if (numArray[3] == 100) { numArray[3] = m; } if ((num3 % 2) == 1) { if (numArray2[2] == 100) { numArray2[2] = m; } } else if (numArray2[3] == 100) { numArray2[3] = m; } } } return(string.Concat(new object[] { numArray[0], ";", numArray[1], ";", numArray[2], ";", numArray[3], ";", numArray2[0], ";", numArray2[1], ";", numArray2[2], ";", numArray2[3] })); } int[] numArray3 = new int[50]; for (int i = 0; i < numArray3.Length; i++) { numArray3[i] = 100; } for (int j = 0; j < cacheAsDataTable.Rows.Count; j++) { string str4 = cacheAsDataTable.Rows[j]["WinLotteryNumber"].ToString().Trim(); if (str4.Length == 5) { int num6 = int.Parse(str4.Substring(0, 1)); int num7 = int.Parse(str4.Substring(1, 1)); int num8 = int.Parse(str4.Substring(2, 1)); int num9 = int.Parse(str4.Substring(3, 1)); int num10 = int.Parse(str4.Substring(4, 1)); for (int n = 0; n <= 9; n++) { if ((num6 == n) && (numArray3[n] == 100)) { numArray3[n] = j; } if ((num7 == n) && (numArray3[10 + n] == 100)) { numArray3[10 + n] = j; } if ((num8 == n) && (numArray3[20 + n] == 100)) { numArray3[20 + n] = j; } if ((num9 == n) && (numArray3[30 + n] == 100)) { numArray3[30 + n] = j; } if ((num10 == n) && (numArray3[40 + n] == 100)) { numArray3[40 + n] = j; } } } } for (int k = 0; k < (sscBuyType * 10); k++) { if (k == ((sscBuyType * 10) - 1)) { str2 = str2 + numArray3[((5 - sscBuyType) * 10) + k]; } else { str2 = str2 + numArray3[((5 - sscBuyType) * 10) + k] + ";"; } } return(str2); }
protected void btnEdit_Click(object sender, EventArgs e) { string name = ""; try { name = Utility.FilteSqlInfusion(this.tbIsuse.Text.Trim()); } catch { } if (name == "") { JavaScript.Alert(this.Page, "期号不能为空!"); } else { DataTable table = new Tables.T_Isuses().Open("[ID]", "[Name]='" + name + "' and LotteryID=" + Utility.FilteSqlInfusion(this.tbLotteryID.Text) + " and [ID] <> " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), ""); if (table == null) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); } else if (table.Rows.Count > 0) { JavaScript.Alert(this.Page, "期号已经存在,请不要输入重名期号!"); } else { object obj2 = PF.ValidLotteryTime(this.tbStartTime.Text); if (obj2 == null) { JavaScript.Alert(this.Page, "开始时间格式输入错误!"); } else { DateTime startTime = (DateTime)obj2; obj2 = PF.ValidLotteryTime(this.tbEndTime.Text); if (obj2 == null) { JavaScript.Alert(this.Page, "截止时间格式输入错误!"); } else { DateTime endTime = (DateTime)obj2; if (endTime <= startTime) { JavaScript.Alert(this.Page, "截止时间应该在开始时间之后!"); } else { string additionasXml = ""; if ((((((this.tbLotteryID.Text != "1") || (this.BuildAdditionasXmlForSFC(ref additionasXml) >= 0)) && ((this.tbLotteryID.Text != "2") || (this.BuildAdditionasXmlForJQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "15") || (this.BuildAdditionasXmlForLCBQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "19") || (this.BuildAdditionasXmlForLCDC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "45") || (this.BuildAdditionasXmlForZCDC(ref additionasXml) >= 0))) { long isuseID = long.Parse(this.tbIsuseID.Text); int returnValue = -1; string returnDescription = ""; if (Procedures.P_IsuseEdit(isuseID, name, startTime, endTime, additionasXml, ref returnValue, ref returnDescription) < 0) { PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); } else if (returnValue < 0) { PF.GoError(1, returnDescription, this.Page.GetType().BaseType.FullName); } else { if (this.tbTestNumber.Text.Trim() != "") { Tables.T_TestNumber number = new Tables.T_TestNumber { TestNumber = { Value = this.tbTestNumber.Text.Trim() }, IsuseID = { Value = isuseID.ToString() } }; if (_Convert.StrToLong(this.hidID.Value, 0L) > 0L) { number.Update("ID=" + this.hidID.Value); } else { number.Insert(); } } if (this.tbMoney.Text.Trim() != "") { Tables.T_TotalMoney money = new Tables.T_TotalMoney { TotalMoney = { Value = this.tbMoney.Text.Trim() }, IsuseID = { Value = this.tbIsuseID.Text } }; if (_Convert.StrToLong(this.moneyID.Value, 0L) > 0L) { money.Update("ID=" + this.moneyID.Value); } else { money.Insert(); } } Shove._Web.Cache.ClearCache("LotteryCalendar"); Shove._Web.Cache.ClearCache(DataCache.IsusesInfo + this.tbLotteryID.Text.Trim()); base.Response.Redirect("Isuse.aspx?LotteryID=" + this.tbLotteryID.Text, true); } } } } } } } }
private void BonusQuery(string TransMessage) { XmlDocument document = new XmlDocument(); document.Load(new StringReader(TransMessage)); XmlNodeList elementsByTagName = document.GetElementsByTagName("*"); string winNumber = ""; string input = ""; string gameName = ""; if (elementsByTagName != null) { for (int i = 0; i < elementsByTagName.Count; i++) { if (elementsByTagName[i].Name.ToUpper() == "BONUSQUERYRESULT") { winNumber = elementsByTagName[i].Attributes["bonusNumber"].Value.Replace(",", ""); } if (elementsByTagName[i].Name.ToUpper() == "ISSUE") { input = elementsByTagName[i].Attributes["number"].Value; gameName = elementsByTagName[i].Attributes["gameName"].Value; } } int lotteryID = this.GetLotteryID(gameName); if (lotteryID >= 0) { DataTable table = new Tables.T_Isuses().Open("top 1 *", "LotteryID = " + lotteryID.ToString() + " and [Name] = '" + Utility.FilteSqlInfusion(input) + "' and isOpened = 0 and EndTime < GetDate()", ""); if (table == null) { new Log(@"ElectronTicket\HPCQ").Write("恒朋-重庆电子票网关自动开奖错误,彩种:" + gameName + ",期号:" + input); } else if (table.Rows.Count >= 1) { DataTable table2 = new Tables.T_WinTypes().Open("DefaultMoney, DefaultMoneyNoWithTax", "LotteryID = " + lotteryID.ToString(), "[Order]"); if (table2 == null) { new Log(@"ElectronTicket\HPCQ").Write("恒朋-重庆电子票网关自动开奖错误,彩种:" + gameName + ",期号:" + input); } else { double[] winMoneyList = new double[table2.Rows.Count * 2]; for (int j = 0; j < table2.Rows.Count; j++) { winMoneyList[j * 2] = _Convert.StrToDouble(table2.Rows[j][0].ToString(), 0.0); winMoneyList[(j * 2) + 1] = _Convert.StrToDouble(table2.Rows[j][1].ToString(), 0.0); } DataTable table3 = new Tables.T_Schemes().Open("", "IsuseID = " + table.Rows[0]["ID"].ToString() + " and isOpened = 0", ""); if (table3 == null) { new Log(@"ElectronTicket\HPCQ").Write("恒朋-重庆电子票网关自动开奖错误,彩种:" + gameName + ",期号:" + input); } else { if (table3.Rows.Count > 0) { for (int k = 0; k < table3.Rows.Count; k++) { string number = table3.Rows[k]["LotteryNumber"].ToString(); string description = ""; double winMoneyNoWithTax = 0.0; double num6 = new Lottery()[lotteryID].ComputeWin(number, winNumber, ref description, ref winMoneyNoWithTax, int.Parse(table3.Rows[k]["PlayTypeID"].ToString()), winMoneyList); MSSQL.ExecuteNonQuery("update T_Schemes set PreWinMoney = @p1, PreWinMoneyNoWithTax = @p2, EditWinMoney = @p3, EditWinMoneyNoWithTax = @p4, WinDescription = @p5 where [ID] = " + table3.Rows[k]["ID"].ToString(), new MSSQL.Parameter[] { new MSSQL.Parameter("p1", SqlDbType.Money, 0, ParameterDirection.Input, num6 * _Convert.StrToInt(table3.Rows[k]["Multiple"].ToString(), 1)), new MSSQL.Parameter("p2", SqlDbType.Money, 0, ParameterDirection.Input, winMoneyNoWithTax * _Convert.StrToInt(table3.Rows[k]["Multiple"].ToString(), 1)), new MSSQL.Parameter("p3", SqlDbType.Money, 0, ParameterDirection.Input, num6 * _Convert.StrToInt(table3.Rows[k]["Multiple"].ToString(), 1)), new MSSQL.Parameter("p4", SqlDbType.Money, 0, ParameterDirection.Input, winMoneyNoWithTax * _Convert.StrToInt(table3.Rows[k]["Multiple"].ToString(), 1)), new MSSQL.Parameter("p5", SqlDbType.VarChar, 0, ParameterDirection.Input, description) }); } } DataSet ds = null; PF.SendWinNotification(ds); } } } } } }