예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bussinesPedido = new obPedido();
        PedidoEntity pedido = (PedidoEntity)Session["PedID"];

        if (pedido != null)
        {
            try {
                int borra = Convert.ToInt32(Request.QueryString["RemDet"]);

                if (borra != 0)
                {
                    bussinesPedido.SacarProducto(pedido.Detalles.Find(detalles => detalles.IdDetalle == borra), pedido);
                }

                total.InnerText    = "Total: $" + pedido.Total;
                carrito.DataSource = bussinesPedido.ObtenerItemsCarrito(pedido.IdPedido);
                carrito.DataBind();
            } catch (Exception) {
                Response.Redirect("Login.aspx");
            }
        }
        else
        {
            Response.Redirect("Login.aspx");
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bussinesPedido = new obPedido();
        int productoCargado = 0;

        try {
            productoCargado = Convert.ToInt32(Request.QueryString["Id"]);
        } catch (Exception ex) {
            Response.Redirect("Principal.aspx");
        }

        if (productoCargado != 0)
        {
            TraerProducto(obProducto.CargarProducto(productoCargado));
            for (int i = 1; i < 101; i++)
            {
                ddCantidad.Items.Add(i.ToString());
            }
        }
        else
        {
            Response.Redirect("Principal.aspx");
        }
    }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     bussinesPedido = new obPedido();
 }