protected void btnGO_Click(object sender, EventArgs e) { this.tbWinNumber.Text = _Convert.ToDBC(this.tbWinNumber.Text.Trim().Replace(" ", " ")).Trim(); if (!new Lottery()[int.Parse(this.ddlLottery.SelectedValue)].AnalyseWinNumber(this.tbWinNumber.Text)) { JavaScript.Alert(this.Page, "开奖号码不正确!"); } else { double[] winMoneyList = new double[this.g.Rows.Count * 2]; for (int i = 0; i < this.g.Rows.Count; i++) { winMoneyList[i * 2] = _Convert.StrToDouble(((TextBox)this.g.Rows[i].Cells[1].FindControl("tbMoney")).Text, 0.0); winMoneyList[(i * 2) + 1] = _Convert.StrToDouble(((TextBox)this.g.Rows[i].Cells[2].FindControl("tbMoneyNoWithTax")).Text, 0.0); if (winMoneyList[i * 2] < 0.0) { JavaScript.Alert(this.Page, "第 " + ((i + 1)).ToString() + " 项奖金输入错误!"); return; } } Tables.T_Schemes schemes = new Tables.T_Schemes(); DataTable table = schemes.Open("", "IsuseID = " + this.ddlIsuse.SelectedValue + " and isOpened = 1", ""); if (table == null) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); } else { for (int j = 0; j < table.Rows.Count; j++) { string number = table.Rows[j]["LotteryNumber"].ToString(); string description = ""; double winMoneyNoWithTax = 0.0; double num5 = new Lottery()[int.Parse(this.ddlLottery.SelectedValue)].ComputeWin(number, this.tbWinNumber.Text.Trim(), ref description, ref winMoneyNoWithTax, int.Parse(table.Rows[j]["PlayTypeID"].ToString()), winMoneyList); int num6 = _Convert.StrToInt(table.Rows[j]["Multiple"].ToString(), 1); schemes.PreWinMoney.Value = num5 * num6; schemes.PreWinMoneyNoWithTax.Value = num5 * num6; schemes.WinDescription.Value = description; schemes.Update("[ID] = " + table.Rows[j]["ID"].ToString()); } JavaScript.Alert(this.Page, "重构中奖描述成功。"); } } }
protected void btnGO_Click(object sender, System.EventArgs e) { tbWinNumber.Text = Shove._Convert.ToDBC(tbWinNumber.Text.Trim().Replace(" ", " ")).Trim(); if (!new SLS.Lottery()[int.Parse(ddlLottery.SelectedValue)].AnalyseWinNumber(tbWinNumber.Text)) { Shove._Web.JavaScript.Alert(this.Page, "开奖号码不正确!"); return; } double[] WinMoneyList = new double[g.Rows.Count * 2]; for (int i = 0; i < g.Rows.Count; i++) { WinMoneyList[i * 2] = Shove._Convert.StrToDouble(((TextBox)g.Rows[i].Cells[1].FindControl("tbMoney")).Text, 0); WinMoneyList[i * 2 + 1] = Shove._Convert.StrToDouble(((TextBox)g.Rows[i].Cells[2].FindControl("tbMoneyNoWithTax")).Text, 0); if (WinMoneyList[i * 2] < 0) { Shove._Web.JavaScript.Alert(this.Page, "第 " + (i + 1).ToString() + " 项奖金输入错误!"); return; } } DAL.Tables.T_Schemes T_Schemes = new DAL.Tables.T_Schemes(); DataTable dt = T_Schemes.Open("", "IsuseID = " + ddlIsuse.SelectedValue + " and isOpened = 1", ""); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName); return; } for (int i = 0; i < dt.Rows.Count; i++) { string LotteryNumber = dt.Rows[i]["LotteryNumber"].ToString(); string Description = ""; double WinMoneyNoWithTax = 0; double WinMoney = new SLS.Lottery()[int.Parse(ddlLottery.SelectedValue)].ComputeWin(LotteryNumber, tbWinNumber.Text.Trim(), ref Description, ref WinMoneyNoWithTax, int.Parse(dt.Rows[i]["PlayTypeID"].ToString()), WinMoneyList); int Multiple = Shove._Convert.StrToInt(dt.Rows[i]["Multiple"].ToString(), 1); T_Schemes.WinDescription.Value = Description; T_Schemes.Update("[ID] = " + dt.Rows[i]["ID"].ToString()); } //tbWinNumber.Text = ""; Shove._Web.JavaScript.Alert(this.Page, "重构中奖描述成功。"); }