public void CargarSubasta(string nombreProducto) { string oferta, nombre; AuctionBLL subastaBLL = new AuctionBLL(); Auction subasta = new Auction(); AuctionRecord historialSubasta = new AuctionRecord(); AuctionRecordBLL historialSubastaBLL = new AuctionRecordBLL(); historialSubasta = historialSubastaBLL.cargarHistorialPorProducto(nombreProducto); subasta = subastaBLL.CargarSubasta(nombreProducto); if (historialSubasta is null) { oferta = "00.00"; nombre = "Sin ofertante"; } else { oferta = historialSubasta.Amount.ToString(); nombre = historialSubasta.User.Name; } lblIdSubasta.Text = subasta.AuctionId.ToString(); lblNombre.Text = subasta.ProductName; lblDescripcion.Text = subasta.Description; lblFechaInicio.Text = subasta.StartDate.ToString(); lblFechaFin.Text = subasta.EndDate.ToString(); txtOfertaActual.Text = oferta; lblUsuarioOfertaAlta.Text = nombre; }
protected void ddlUsuario_SelectedIndexChanged(object sender, EventArgs e) { if (ddlUsuario.SelectedIndex != 0) { string nombreProducto = (Request.QueryString["pProductName"]); int idUsuario = int.Parse(ddlUsuario.SelectedValue); AuctionRecordBLL historialBLL = new AuctionRecordBLL(); List <Object> ofertasUsuario = historialBLL.cargarOfertasdeUsuario(nombreProducto, idUsuario); grd_Subasta.DataSource = ofertasUsuario; grd_Subasta.DataBind(); } else { string nombreProducto = (Request.QueryString["pProductName"]); grd_Subasta.DataSource = cargarHistorialesPorProductoGrd(nombreProducto); grd_Subasta.DataBind(); } }
public void HacerOferta() { AuctionRecord ofertaParam = new AuctionRecord(); AuctionRecordBLL ofertaBLL = new AuctionRecordBLL(); ofertaParam.AuctionId = int.Parse(lblIdSubasta.Text); ofertaParam.UserId = (int)Session["UserId"]; ofertaParam.Amount = Convert.ToDecimal(txtOferta.Text); ofertaParam.BidDate = DateTime.Now; try { ofertaBLL.OfertaMasAlta(ofertaParam); } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "Alta", "alert ('" + ex.Message + "')", true); } }
public List <Object> cargarHistorialesPorProductoGrd(string ProductName) { AuctionRecordBLL historial = new AuctionRecordBLL(); return(historial.cargarHistorialesPorProducto(ProductName)); }