Example #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;
        }
Example #2
0
        public List <object> CargarSubasta()
        {
            AuctionBLL    auctionbll = new AuctionBLL();
            List <object> lst        = new List <object>();

            lst = auctionbll.CargarSubasta();
            return(lst);
        }
Example #3
0
        public List <Auction> filtarSubastas(string descripcion)
        {
            AuctionBLL     subastaBLL        = new AuctionBLL();
            List <Auction> subastasFiltradas = new List <Auction>();

            subastasFiltradas = subastaBLL.filtrarSubastas(descripcion);

            return(subastasFiltradas);
        }
Example #4
0
        public void cargarNombreDescripcionTabla(string ProductName)
        {
            AuctionBLL historial   = new AuctionBLL();
            Auction    hisProducto = new Auction();

            hisProducto = historial.CargarSubasta(ProductName);


            lblNombre.Text      = hisProducto.ProductName;
            lblDescripcion.Text = hisProducto.Description;
        }
        public void ModificarSubasta()
        {
            AuctionBLL oAuctionBll = new AuctionBLL();

            Auction oSubasta = new Auction();

            oSubasta.ProductName = txtNuevoNombreProducto.Text;
            oSubasta.Description = txtNuevoDescripcionProducto.Text;
            oSubasta.StartDate   = Convert.ToDateTime(txtNuevoFechaInicio.Text);
            oSubasta.EndDate     = Convert.ToDateTime(txtNuevoFechaFin.Text);
            oSubasta.HighestBind = Convert.ToDecimal(txtNuevoOfertaAlta.Text);

            oAuctionBll.ModificarSubasta(oSubasta);
        }
        public void crearSubasta()
        {
            Auction    subasta    = new Auction();
            AuctionBLL subastaBLL = new AuctionBLL();

            subasta.ProductName = txtNombre.Text;
            subasta.Description = txtDescripcion.Text;
            subasta.StartDate   = Convert.ToDateTime(txtFechaInicio.Text);
            subasta.EndDate     = Convert.ToDateTime(txtFechaFin.Text);
            subasta.UserId      = (int)Session["UserId"];

            try
            {
                subastaBLL.CrearSubasta(subasta);
            }catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Alta", "alert ('" + ex.Message + "')", true);
            }
        }
        public void AgregarSubasta()
        {
            AuctionDAL oAuctionDal = new AuctionDAL();
            AuctionBLL oAuctionBll = new AuctionBLL();
            Auction    oAuction    = new Auction();

            oAuction.ProductName = txtNombreProducto.Text;
            oAuction.Description = txtDescripcionProducto.Text;
            oAuction.StartDate   = Convert.ToDateTime(txtFechaInicio.Text);
            oAuction.EndDate     = Convert.ToDateTime(txtFechaFin.Text);

            try
            {
                oAuctionBll.AgregarSubasta(oAuction);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "alert('" + ex.Message + "');", true);
            }
        }
Example #8
0
 public static bool IsAuctionDisposed(AuctionBLL auctionBll)
 {
     return(auctionBll.IsDeleted);
 }
Example #9
0
        public List <Auction> CargarSubastas()
        {
            AuctionBLL subastasBLL = new AuctionBLL();

            return(subastasBLL.CargarSubastas());
        }