Ejemplo n.º 1
0
    protected void B_BuscarProducto_Click(object sender, EventArgs e)
    {
        AgregarProductos boton = new AgregarProductos();

        GV_VentaPedido.DataSource = boton.actualizar(((TextBox)GV_VentaPedido.HeaderRow.FindControl("TB_BuscarReferencia")).Text, ((TextBox)GV_VentaPedido.HeaderRow.FindControl("TB_BuscarTalla")).Text, Convert.ToString(Session["sede"]), pbNV);;
        GV_VentaPedido.DataBind();
    }
Ejemplo n.º 2
0
    protected void GV_Venta_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        List <Producto> pventa = new List <Producto>();

        pventa = (Session["lis"] as List <Producto>);
        AgregarProductos borr = new AgregarProductos();

        Session["lis"] = borr.BorrarDelGrid(e.CommandName.ToString(), pventa, e.CommandArgument.ToString());
        actualizarGV_Venta();
    }
Ejemplo n.º 3
0
    void actualizarInventario()
    {
        List <Producto>  refresh = new List <Producto>();
        AgregarProductos actInvt = new AgregarProductos();

        refresh = (Session["lis"] as List <Producto>);
        foreach (Producto p in refresh)
        {
            actInvt.actualizarInvent(Session["sede"].ToString(), p);
        }
    }
Ejemplo n.º 4
0
    void actualizarGV_Venta()
    {
        List <Producto> listaV = new List <Producto>();

        listaV = (Session["lis"] as List <Producto>);
        GV_Venta.DataSource = listaV;
        GV_Venta.DataBind();
        AgregarProductos p = new AgregarProductos();

        ((TextBox)GV_Venta.FooterRow.FindControl("TB_TotalVenta")).Text = p.valorVenta(Session["valorVenta"].ToString());
    }
Ejemplo n.º 5
0
    void llenarVenta(List <Producto> listaVV)
    {
        Session["lis"] = listaVV;
        AgregarProductos tot         = new AgregarProductos();
        double           precioTotal = 0;
        List <Producto>  listaV      = new List <Producto>();

        listaV                = (Session["lis"] as List <Producto>);
        precioTotal           = tot.sumarTotal(listaV);
        Session["valorVenta"] = Convert.ToString(precioTotal);
    }
Ejemplo n.º 6
0
    protected void B_Seleccionar_Click(object sender, EventArgs e)
    {
        //Session["l"] = null;
        AgregarProductos agregar = new AgregarProductos();

        llenarVenta(agregar.AnalizarGridView(TB_Cantida.Text.ToString(), double.Parse(LTalla.Text.ToString()), LRef.Text.ToString(), Session["sede"].ToString(), (List <Producto>)Session["lis"]));
        string msg = agregar.get_mensaje();

#pragma warning disable CS0618 // Type or member is obsolete
        RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('" + msg + "');</script>");
#pragma warning restore CS0618 // Type or member is obsolete
        actualizarGV_Venta();
    }
Ejemplo n.º 7
0
    protected void GV_VentaPedido_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        AgregarProductos ag   = new AgregarProductos();
        List <Producto>  prod = new List <Producto>();

        string[] argumentos = e.CommandArgument.ToString().Split(new char[] { ',' });
        string   referencia = argumentos[0];
        string   talla      = argumentos[1];

        producto.Referencia = referencia;
        producto.Talla      = double.Parse(talla);
        pintarSeleccionado(producto);
    }
Ejemplo n.º 8
0
    protected void B_Seleccionar_Click(object sender, EventArgs e)
    {
        //Session["l"] = null;
        AgregarProductos agregar = new AgregarProductos();

        foreach (GridViewRow row in GV_VentaPedido.Rows)
        {
            llenarVenta(agregar.AnalizarGridView(Convert.ToString(((TextBox)row.Cells[2].FindControl("TB_Cantidad")).Text), Convert.ToDouble(((Label)row.Cells[1].FindControl("L_Talla")).Text), Convert.ToString(((Label)row.Cells[0].FindControl("L_Referencia")).Text), Session["sede"].ToString(), (List <Producto>)Session["lis"]));
            string msg = agregar.get_mensaje();
#pragma warning disable CS0618 // Type or member is obsolete
            RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('" + msg + "');</script>");
#pragma warning restore CS0618 // Type or member is obsolete
        }
        actualizarGV_Venta();
    }
Ejemplo n.º 9
0
        private void btnAgregarProductos_Click(object sender, EventArgs e)
        {
            var pedido = new AgregarProductos(PedidoId, false);

            pedido.ShowDialog();

            if (pedido.Bandera)
            {
                list = new List <VentaDto2>();
                CrearGrilla(PedidoId);
                CargarGrilla();

                Datos(PedidoId);

                VerSiHayProductos();
            }
        }
Ejemplo n.º 10
0
    protected void B_Facturar_Click(object sender, EventArgs e)
    {
        Venta    venta    = new Venta();
        DateTime fechaHoy = DateTime.Now;

        venta.Idcliente  = Convert.ToInt32(Session["idCliente"]);
        venta.Idvendedor = Convert.ToInt32(Session["user_id"]);
        venta.Producto   = (Session["list"] as List <Producto>);
        venta.Fecha      = fechaHoy.ToString("d");
        venta.Precio     = Convert.ToDouble(Session["valorVenta"]);
        venta.Sede       = Convert.ToString(Session["sede"]);
        AgregarProductos fact = new AgregarProductos();

        fact.actualizarVenta(venta);
        actualizarInventario();
        reiniciar();
        this.irAFactura();
    }
Ejemplo n.º 11
0
    void actualizarGV_Venta()
    {
        List <Producto> listaV = new List <Producto>();

        listaV = (Session["lis"] as List <Producto>);
        GV_Venta.DataSource = listaV;
        GV_Venta.DataBind();
        AgregarProductos p = new AgregarProductos();

        try
        {
            ((TextBox)GV_Venta.FooterRow.FindControl("TB_TotalVenta")).Text = p.valorVenta(Session["valorVenta"].ToString());
        }
        catch (Exception e)
        {
#pragma warning disable CS0618 // Type or member is obsolete
            RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('No hay productos para añadir a la grid venta');</script>");
#pragma warning restore CS0618 // Type or member is obsolete
        }
    }
Ejemplo n.º 12
0
    protected void B_Abono_Click(object sender, EventArgs e)
    {
        AgregarProductos abono    = new AgregarProductos();
        Abono            venta    = new Abono();
        DateTime         fechaHoy = DateTime.Now;

        venta.Idcliente  = Convert.ToInt32(Session["idCliente"]);
        venta.Idvendedor = Convert.ToInt32(Session["user_id"]);
        venta.Producto   = (Session["lis"] as List <Producto>);
        venta.Fecha      = fechaHoy.ToString("d");
        venta.Precio     = Convert.ToDouble(Session["valorVenta"]);
        venta.Sede       = Convert.ToString(Session["sede"]);
        string msj2 = abono.crearAbono(Convert.ToInt32(Session["idCliente"]), venta);

#pragma warning disable CS0618 // Type or member is obsolete
        RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('" + msj2 + "');</script>");
#pragma warning restore CS0618 // Type or member is obsolete
        actualizarInventario();
        reiniciar();
        this.irAFactura2();
    }
Ejemplo n.º 13
0
    void actualizarInventario()
    {
        AgregarProductos actInvt = new AgregarProductos();

        actInvt.paraInvent(Session["lis"] as List <Producto>, Session["sede"].ToString());
    }