Ejemplo n.º 1
0
 protected void GridViewLances_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         e.Row.Cells[1].Text = Usuario_Manager.CarregaUsuarioPorId(int.Parse(e.Row.Cells[1].Text)).Nome;
         e.Row.Cells[2].Text = Produto_Manager.CarregaProdutoPorId(int.Parse(e.Row.Cells[2].Text)).Nome;
     }
 }
Ejemplo n.º 2
0
        protected void ButtonNovoLance_Click(object sender, EventArgs e)
        {
            string error      = LabelErro.Text = "";
            var    usuario    = Usuario_Manager.CarregaUsuarioPorId(int.Parse(DropDownListUsuario.SelectedValue));
            var    produto    = Produto_Manager.CarregaProdutoPorId(int.Parse(DropDownListProduto.SelectedValue));
            var    valorLance = decimal.Parse(TextBoxLance.Text);


            Lance_Manager.NovoLace(produto.Id, usuario.Id, valorLance, out error);

            if (!string.IsNullOrWhiteSpace(error))
            {
                LabelErro.Text = $"<div class='alert alert-warning' role='alert'> {error} </div>";
            }

            CarregaListas();
        }