/// <summary> /// 充值成功后,绑定数据 /// </summary> /// <param name="BuyID"></param> private void BindDataForAliBuy(long BuyID) { DataTable dt = new DAL.Tables.T_AlipayBuyTemp().Open("", "ID=" + BuyID.ToString(), ""); if (dt == null || dt.Rows.Count == 0) { return; } DataRow dr = dt.Rows[0]; string HidIsuseID = dr["IsuseID"].ToString(); string playType = dr["PlayTypeID"].ToString(); bool IsChase = Shove._Convert.StrToBool(dr["IsChase"].ToString(), false); bool IsCoBuy = Shove._Convert.StrToBool(dr["IsCoBuy"].ToString(), false); string tb_Share = dr["Share"].ToString(); string tb_BuyShare = dr["BuyShare"].ToString(); string tb_AssureShare = dr["AssureShare"].ToString(); string tb_OpenUserList = dr["OpenUsers"].ToString(); string tb_Title = dr["Title"].ToString(); string tb_Description = dr["Description"].ToString(); string tbAutoStopAtWinMoney = dr["StopwhenwinMoney"].ToString(); string tbSecrecyLevel = dr["SecrecyLevel"].ToString(); string tb_LotteryNumber = dr["LotteryNumber"].ToString(); string tb_hide_SumMoney = dr["SumMoney"].ToString(); string tb_hide_AssureMoney = dr["AssureMoney"].ToString(); string HidLotteryID = dr["LotteryID"].ToString(); string tb_Multiple = dr["Multiple"].ToString(); string AdditionasXml = dr["AdditionasXml"].ToString(); if (tb_Multiple == "") { tb_Multiple = "1"; } double SumMoney = 0; int Share = 0; int BuyShare = 0; double AssureMoney = 0; int Multiple = 0; short SecrecyLevel = 0; int PlayTypeID = 0; int LotteryID = 0; long IsuseID = 0; double AutoStopAtWinMoney = 0; try { SumMoney = double.Parse(tb_hide_SumMoney); Share = int.Parse(tb_Share); BuyShare = int.Parse(tb_BuyShare); AssureMoney = double.Parse(tb_hide_AssureMoney); Multiple = int.Parse(tb_Multiple); SecrecyLevel = short.Parse(tbSecrecyLevel); PlayTypeID = int.Parse(playType); LotteryID = int.Parse(HidLotteryID); IsuseID = long.Parse(HidIsuseID); AutoStopAtWinMoney = double.Parse(tbAutoStopAtWinMoney); } catch { } if ((BuyShare == Share) && (AssureMoney == 0)) { Share = 1; BuyShare = 1; } double BuyMoney = BuyShare * (SumMoney / Share) + AssureMoney; if (IsChase) { BuyMoney = double.Parse(tb_hide_SumMoney); } string LotteryNumber = tb_LotteryNumber; if (LotteryNumber[LotteryNumber.Length - 1] == '\n') { LotteryNumber = LotteryNumber.Substring(0, LotteryNumber.Length - 1); } StringBuilder sb = new StringBuilder(); sb.AppendLine("<script type='text/javascript' defer='defer'>"); sb.Append("$Id('playType").Append(PlayTypeID.ToString()).AppendLine("').checked = true;"); sb.AppendLine("clickPlayType('" + PlayTypeID.ToString() + "');"); sb.AppendLine("function BindDataForFromAli(){"); //追号 if (IsChase) { XmlDocument xml = new XmlDocument(); xml.LoadXml(AdditionasXml); XmlNodeList xnl = xml.ChildNodes[0].ChildNodes; foreach (XmlNode xn in xnl) { sb.Append("$Id('times").Append(xn.Attributes["IsuseID"].Value).Append("').value = '").Append(xn.Attributes["Multiple"].Value).AppendLine("';"); sb.Append("$Id('money").Append(xn.Attributes["IsuseID"].Value).Append("').value = '").Append(xn.Attributes["Money"].Value).AppendLine("';"); sb.Append("$Id('check").Append(xn.Attributes["IsuseID"].Value).AppendLine("').checked = true;"); sb.Append("$Id('times").Append(xn.Attributes["IsuseID"].Value).AppendLine("').disabled = '';"); } } LotteryNumber = LotteryNumber.Replace("\r", ""); int LotteryNum = 0; string Number = ""; foreach (string lotteryNumber in LotteryNumber.Split('\n')) { LotteryNum += new SLS.Lottery()[LotteryID].ToSingle(lotteryNumber, ref Number, PlayTypeID).Length; sb.AppendLine("var option = document.createElement('option');"); sb.AppendLine("$Id('list_LotteryNumber').options.add(option);"); sb.Append("option.innerText = '").Append(lotteryNumber).AppendLine("';"); sb.Append("option.value = '").Append(lotteryNumber).AppendLine("';"); } if (IsChase) { sb.AppendLine("$Id('Chase').checked = true;"); sb.AppendLine("oncbInitiateTypeClick($Id('Chase'));"); } if (IsCoBuy) { sb.AppendLine("$Id('CoBuy').checked = true;"); sb.AppendLine("oncbInitiateTypeClick($Id('CoBuy'));"); } sb.Append("$Id('tb_LotteryNumber').value = '").Append(tb_LotteryNumber.Replace("\r", "\\r").Replace("\n", "\\n")).AppendLine("';"); sb.Append("$Id('tb_Share').value = '").Append(tb_Share).AppendLine("';"); sb.Append("$Id('tb_BuyShare').value = '").Append(tb_BuyShare).AppendLine("';"); sb.Append("$Id('tb_AssureShare').value = '").Append(tb_AssureShare).AppendLine("';"); sb.Append("$Id('tb_OpenUserList').value = '").Append(tb_OpenUserList).AppendLine("';"); sb.Append("$Id('tb_Title').value = '").Append(tb_Title).AppendLine("';"); sb.Append("$Id('tb_Description').value = '").Append(tb_Description.Replace("\r", "\\r").Replace("\n", "\\n")).AppendLine("';"); sb.Append("$Id('tbAutoStopAtWinMoney').value = '").Append(tbAutoStopAtWinMoney).AppendLine("';"); sb.Append("$Id('SecrecyLevel").Append(SecrecyLevel.ToString()).AppendLine("').checked = true;"); sb.Append("$Id('tb_hide_SumMoney').value = '").Append(tb_hide_SumMoney).AppendLine("';"); sb.Append("$Id('tb_hide_AssureMoney').value = '").Append(AssureMoney.ToString("N0")).AppendLine("';"); sb.Append("$Id('tb_Multiple').value = '").Append(Multiple.ToString()).AppendLine("';"); sb.Append("$Id('lab_AssureMoney').innerText = '").Append(AssureMoney.ToString("N0")).AppendLine("';"); sb.Append("$Id('lab_SumMoney').innerText = '").Append(SumMoney.ToString("N0")).AppendLine("';"); sb.Append("$Id('LbSumMoney').innerText = '").Append(SumMoney.ToString("N0")).AppendLine("';"); sb.Append("$Id('lab_Num').innerText = '").Append(LotteryNum.ToString()).AppendLine("';"); sb.AppendLine("CalcResult();"); sb.AppendLine("}"); sb.AppendLine("</script>"); script = sb.ToString(); }
protected void btn_ok_Click(object sender, EventArgs e) { DataTable dt = new DAL.Views.V_ElectronTicketAgentSchemesElectronTickets().Open("LotteryID, IsuseID, PlayTypeID, Ticket, SchemeNumber, WinLotteryNumber, DateTime, Money, Multiple", "Identifiers='" + tbTicket.Text.Trim() + "'", ""); if (dt == null) { Shove._Web.JavaScript.Alert(this.Page, "数据库读写错误!"); return; } if (dt.Rows.Count < 1) { Shove._Web.JavaScript.Alert(this.Page, "没有找到此票标识!"); return; } DataTable dtWinList = new DAL.Tables.T_WinTypes().Open("", "LotteryID=" + dt.Rows[0]["LotteryID"].ToString(), ""); if ((dtWinList == null) || (dtWinList.Rows.Count < 1)) { Shove._Web.JavaScript.Alert(this.Page, "数据库读写错误!"); return; } double[] WinMoneyList = new double[dtWinList.Rows.Count * 2]; for (int i = 0; i < dtWinList.Rows.Count; i++) { WinMoneyList[i * 2] = Shove._Convert.StrToDouble(dtWinList.Rows[i]["defaultMoney"].ToString(), 0); WinMoneyList[i * 2 + 1] = Shove._Convert.StrToDouble(dtWinList.Rows[i]["DefaultMoneyNoWithTax"].ToString(), 0); if (WinMoneyList[i * 2] < 0) { Shove._Web.JavaScript.Alert(this.Page, "数据库读写错误!"); return; } if (WinMoneyList[i * 2] < WinMoneyList[i * 2 + 1]) { Shove._Web.JavaScript.Alert(this.Page, "数据库读写错误!"); return; } } string t_LotteryNumber = dt.Rows[0]["Ticket"].ToString(); string LotteryNumber = ""; int LotteryID = Shove._Convert.StrToInt(dt.Rows[0]["LotteryID"].ToString(), 0); int PlayTypeID = Shove._Convert.StrToInt(dt.Rows[0]["PlayTypeID"].ToString(), 0); string WinLotteryNumber = dt.Rows[0]["WinLotteryNumber"].ToString(); try { new SLS.Lottery()[LotteryID].HPSH_ToElectronicTicket(PlayTypeID, t_LotteryNumber, ref LotteryNumber, ref PlayTypeID); } catch { } string Description = ""; double WinMoneyNoWithTax = 0; double WinMoney = 0; try { WinMoney = new SLS.Lottery()[LotteryID].ComputeWin(LotteryNumber, WinLotteryNumber, ref Description, ref WinMoneyNoWithTax, PlayTypeID, WinMoneyList); } catch { } lbDescription.Text = ""; if (!string.IsNullOrEmpty(Description.Trim())) { lbDescription.Text = Description; } lbSchemeNumber.Text = dt.Rows[0]["SchemeNumber"].ToString(); lbDateTime.Text = dt.Rows[0]["DateTime"].ToString(); lbAmount.Text = dt.Rows[0]["Money"].ToString(); lbMultiple.Text = dt.Rows[0]["Multiple"].ToString(); if (WinMoney > 0) { lbWinMoney.Text = WinMoney.ToString(); } else { lbWinMoney.Text = "<color='red'>" + WinMoney + "</color>"; } }
protected void btn_ok_Click(object sender, EventArgs e) { DataTable dt = new DAL.Views.V_ElectronTicketAgentSchemesElectronTickets().Open("LotteryID, IsuseID, PlayTypeID, Ticket, SchemeNumber, WinLotteryNumber, DateTime, Money, Multiple", "Identifiers='" + tbTicket.Text.Trim() + "'", ""); if (dt == null) { Shove._Web.JavaScript.Alert(this.Page, "数据库读写错误!"); return; } if (dt.Rows.Count < 1) { Shove._Web.JavaScript.Alert(this.Page, "没有找到此票标识!"); return; } DataTable dtWinList = new DAL.Tables.T_WinTypes().Open("","LotteryID=" + dt.Rows[0]["LotteryID"].ToString(),""); if ((dtWinList == null) || (dtWinList.Rows.Count < 1)) { Shove._Web.JavaScript.Alert(this.Page, "数据库读写错误!"); return; } double[] WinMoneyList = new double[dtWinList.Rows.Count * 2]; for (int i = 0; i < dtWinList.Rows.Count; i++) { WinMoneyList[i * 2] = Shove._Convert.StrToDouble(dtWinList.Rows[i]["defaultMoney"].ToString(), 0); WinMoneyList[i * 2 + 1] = Shove._Convert.StrToDouble(dtWinList.Rows[i]["DefaultMoneyNoWithTax"].ToString(), 0); if (WinMoneyList[i * 2] < 0) { Shove._Web.JavaScript.Alert(this.Page, "数据库读写错误!"); return; } if (WinMoneyList[i * 2] < WinMoneyList[i * 2 + 1]) { Shove._Web.JavaScript.Alert(this.Page, "数据库读写错误!"); return; } } string t_LotteryNumber = dt.Rows[0]["Ticket"].ToString(); string LotteryNumber = ""; int LotteryID = Shove._Convert.StrToInt(dt.Rows[0]["LotteryID"].ToString(), 0); int PlayTypeID = Shove._Convert.StrToInt(dt.Rows[0]["PlayTypeID"].ToString(), 0); string WinLotteryNumber = dt.Rows[0]["WinLotteryNumber"].ToString(); try { new SLS.Lottery()[LotteryID].HPSH_ToElectronicTicket(PlayTypeID, t_LotteryNumber, ref LotteryNumber, ref PlayTypeID); } catch { } string Description = ""; double WinMoneyNoWithTax = 0; double WinMoney = 0; try { WinMoney = new SLS.Lottery()[LotteryID].ComputeWin(LotteryNumber, WinLotteryNumber, ref Description, ref WinMoneyNoWithTax, PlayTypeID, WinMoneyList); } catch { } lbDescription.Text = ""; if (!string.IsNullOrEmpty(Description.Trim())) { lbDescription.Text = Description; } lbSchemeNumber.Text = dt.Rows[0]["SchemeNumber"].ToString(); lbDateTime.Text = dt.Rows[0]["DateTime"].ToString(); lbAmount.Text = dt.Rows[0]["Money"].ToString(); lbMultiple.Text = dt.Rows[0]["Multiple"].ToString(); if (WinMoney > 0) { lbWinMoney.Text = WinMoney.ToString(); } else { lbWinMoney.Text = "<color='red'>" + WinMoney + "</color>"; } }