void addLpc2(string type) { LotteryInptuNoControl lc1 = new LotteryInptuNoControl(type); lc1.Location = new Point(5, 5); ChoiceTabPage.Controls.Add(lc1); }
/// <summary> /// 刷新注数 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCalculate_Click(object sender, EventArgs e) { LotteryInptuNoControl tb = null; foreach (var item in ChoiceTabPage.Controls) { if (item.GetType() == typeof(LotteryInptuNoControl)) { tb = (LotteryInptuNoControl)item; break; } } if (tb != null) { var betStr = tb.GetBetNo(); var bet = betStr == "" ? 0 : betStr.Split('|').Length; lblTotal.Tag = bet + " " + ChoiceTabPage.Parent.Tag + ChoiceTabPage.Text; lblTotal.Text = BetCalculateTool.GetTotalMoney(bet, (int)nudBS.Value, cboDW.SelectedIndex); MessageBox.Show("自动剔除不符合规范号码"); } else { calculate(); } #region 注 if (lblTotal.Tag == null) { return; } var sp = lblTotal.Tag.ToString().Split(' '); if (sp[0] == "0") { return; } var lp = LotteryOpenTool_11x5.LpList().FirstOrDefault(n => n.LotteryPlayName == sp[1]); BetInfo b = new BetInfo { BetPlayTypeCode = lp.BetPlayTypeCode, BetTimes = Convert.ToInt32(nudBS.Value), BetUnit = Convert.ToInt32(sp[0]), BetMoney = Convert.ToDecimal(lblTotal.Text.Substring(lblTotal.Text.IndexOf("¥") + 1, lblTotal.Text.IndexOf("元") - lblTotal.Text.IndexOf("¥") - 1)), AccountId = account.Id, CreateTime = EntitiesTool.GetDateTimeNow(), //LotteryOpenId = nextOpen.Id, ResultType = (int)Enum_ResultType.Wait, GetBackPercent = account.AgentPercent11X5, IsGetBackPercent = cboFandian.SelectedIndex != 0, }; if (sp[1].Contains("趣味定_")) { StringBuilder sb = new StringBuilder(); foreach (var item in txtBetNo.Text.Split(' ')) { sb.Append(' ' + item[0].ToString()); } b.BetNum = sb.ToString().Trim(); } else { b.BetNum = txtBetNo.Text; } b.MaxBackMoney = (b.IsGetBackPercent?AgentCalculateTool.GetAgentBackMoney_11x5(lp.PayBack, account.AgentPercent11X5):lp.PayBack) * (b.BetMoney / b.BetUnit / 2); //根据是否要返点产生中奖金额 if (string.IsNullOrEmpty(b.BetNum)) { return; } wBetList.Add(b); #endregion var row = dgvwBet.Rows[dgvwBet.Rows.Add()]; row.Cells[0].Value = sp[1]; row.Cells[1].Value = b.BetNum; row.Cells[2].Value = b.BetUnit; row.Cells[3].Value = b.BetTimes; row.Cells[4].Value = b.BetMoney; row.Cells[5].Value = "X"; }