Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        public List <Object> cargarHistorialesPorProductoGrd(string ProductName)
        {
            AuctionRecordBLL historial = new AuctionRecordBLL();

            return(historial.cargarHistorialesPorProducto(ProductName));
        }