protected void btnConcluir_Click(object sender, EventArgs e) { decimal? ultimoLance = Convert.ToDecimal(txtUltimoLance2.Text.Split(' ')[1]); testeRodrigo_LANCES l = new testeRodrigo_LANCES(); l.ID_PRODUTO = Convert.ToInt32(cbxProdutos.SelectedItem.Value); l.ID_USUARIO = UsuarioLogado.ID_USUARIO; l.VL_LANCE_ANTERIOR = ultimoLance; l.VL_LANCE_ATUAL = Convert.ToDecimal(txtLanceAtual.Text); l.DT_LANCE = DateTime.Now; try { if (Convert.ToDecimal(txtLanceAtual.Text) > ultimoLance) { realizaLanceBusiness.geraNovoLance(l); Response.Redirect("consultaLances.aspx", true); } else { ltErro.Text = $@"<div class='alert alert-danger'>O novo lance tem que ser maior que o lance anterior</div>"; } } catch (Exception ex) { ltErro.Text = $@"<div class='alert alert-danger'>{ex.Message}</div>"; } }
public void geraNovoLance(testeRodrigo_LANCES p) { _testeRodrigo_LANCESRepository.geraNovoLance(p); }