Exemplo n.º 1
0
        protected ProductoEntidad obtenerProductoxId(int idProducto)
        {
            ProductoEntidad producto = new ProductoEntidad();

            producto = ProductoLN.Obtener(idProducto);
            return(producto);
        }
Exemplo n.º 2
0
        protected void btnAgregar_Command(object sender, CommandEventArgs e)
        {
            ProductoEntidad producto      = ProductoLN.Obtener(Convert.ToInt32(e.CommandArgument.ToString()));
            CarritoEntidad  carritoCompra = new CarritoEntidad();

            carritoCompra.idProducto        = producto.idProducto;
            carritoCompra.tipoProducto      = producto.tipoProducto;
            carritoCompra.nombre            = producto.nombre;
            carritoCompra.descripcion       = producto.descripcion;
            carritoCompra.precio            = producto.precio;
            carritoCompra.cantidadProductos = 1;
            carritoCompra.total             = carritoCompra.cantidadProductos * carritoCompra.precio;

            CompraLN.AgregarProductoLista(carritoCompra);
        }
Exemplo n.º 3
0
        protected void btnRegistrar_Click(object sender, EventArgs e)
        {
            if (Page.IsValid && (rbtnDescuento.Checked || rbtnRegalia.Checked))
            {
                Cupon cupon = new Cupon()
                {
                    idCupon     = Random(),
                    nombre      = txtNombre.Text,
                    descripcion = txtDescripcion.Text,
                    cantidad    = Convert.ToInt32(txtCantidad.Text),
                    estado      = true
                };
                if (ddlProducto.SelectedIndex == 0 || ddlRango.SelectedIndex == 0)
                {
                    ClientScript.RegisterStartupScript(
                        this.GetType(),
                        "Cupón",
                        "mensaje('Cupón','Registro no exitoso!','warning')",
                        true
                        );
                }
                else
                {
                    cupon.producto.idProducto = Convert.ToInt32(ddlProducto.SelectedValue);

                    cupon.rango.idRango = Convert.ToInt32(ddlRango.SelectedValue);
                }

                if (txtDescuento.Text == "")
                {
                    cupon.descuento = ProductoLN.Obtener(Convert.ToInt32(ddlProducto.SelectedValue)).precio;
                }
                else
                {
                    cupon.descuento = Convert.ToDecimal(txtDescuento.Text);
                }
                CuponLN.Nuevo(cupon);


                ClientScript.RegisterStartupScript(this.GetType(), "Carrito",
                                                   "mensajeConfirm('Agregado correctamente')", true);
                Response.Redirect("CuponCliente.aspx");

                txtCantidad.Text    = "";
                txtDescripcion.Text = "";
                txtNombre.Text      = "";
            }
        }
Exemplo n.º 4
0
        protected void btnAplicar_Command(object sender, CommandEventArgs e)
        {
            if (ddlCupon.Visible)
            {
                int id = int.Parse(e.CommandArgument.ToString());
                producto = ProductoLN.Obtener(id);

                lblProdNombre.Visible = true;
                prodIm.Visible        = true;
                lblProdNombre.Text    = producto.nombre;
                prodIm.ImageUrl       = producto.imagen;
            }
            else
            {
                lblProdDesc.Visible = true;
            }
        }
Exemplo n.º 5
0
 private Producto producto1(int idProducto)
 {
     return(ProductoLN.Obtener(idProducto));
 }