public async Task <IActionResult> PutBuyMoney(int id, BuyMoney buyMoney) { if (id != buyMoney.Id) { return(BadRequest()); } _context.Entry(buyMoney).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BuyMoneyExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <BuyMoney> > PostBuyMoney(BuyMoney buyMoney) { _context.BuyMoneys.Add(buyMoney); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBuyMoney", new { id = buyMoney.Id }, buyMoney)); }
protected void gReward_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem) { double money; double BuyMoney; BuyMoney = Shove._Convert.StrToDouble(e.Item.Cells[3].Text, 0); e.Item.Cells[3].Text = (BuyMoney == 0) ? "" : BuyMoney.ToString("N"); money = Shove._Convert.StrToDouble(e.Item.Cells[4].Text, 0); e.Item.Cells[4].Text = (money == 0) ? "" : money.ToString("N"); money = Shove._Convert.StrToDouble(e.Item.Cells[5].Text, 0); e.Item.Cells[5].Text = (money == 0) ? "" : money.ToString("N"); if (money > 0) { e.Item.Cells[7].Text = "<font color=\"red\">中奖啦!</font>"; } else { e.Item.Cells[7].Text = "未中奖"; } e.Item.ToolTip = e.Item.Cells[2].Text; e.Item.Cells[2].Text = "<span class='red12_2'><a href='Scheme.aspx?id=" + e.Item.Cells[8].Text + "' target='_blank'>投注内容</a></span>"; double winMoneyNoWithTax = Shove._Convert.StrToDouble(e.Item.Cells[5].Text, 0); //我的奖金 double detailMoney = Shove._Convert.StrToDouble(e.Item.Cells[3].Text, 0); //我投注的金额 double winMoney = (winMoneyNoWithTax - detailMoney); double winRate = winMoney / detailMoney; if (winRate >= 1) { e.Item.Cells[6].Text = Math.Round(winRate, 2).ToString() + "倍"; } else { e.Item.Cells[6].Text = (Math.Round(winRate, 2) * 100).ToString() + "%"; } if (winMoney < 0) { e.Item.Cells[6].Text = ""; } } }
public virtual void OnBuy(TradeEventArgs e) { BuyMoney?.Invoke(this, e); }