Exemple #1
0
        private void funcionesTabla(ClsDescriptorTablaDescuentos tablaAtributos)
        {
            Double iva      = tablaAtributos.Iva;
            string producto = tablaAtributos.NombreProducto;
            Double precio   = tablaAtributos.Precio;
            int    cantidad = tablaAtributos.Cantidad;


            if (tablaAtributos.Precio > 0 && tablaAtributos.Precio <= 50)
            {
                lblProductoNombre.Text          = producto;
                lblTotalSinIVA.Text             = (precio * cantidad).ToString();
                lblIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                lblTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad) * iva)).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad) * iva));
                lblTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento * 0.0)).ToString();
            }
            else if (tablaAtributos.Precio > 50 && tablaAtributos.Precio < 100)
            {
                lblProductoNombre.Text          = producto;
                lblTotalSinIVA.Text             = (precio * cantidad).ToString();
                lblIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                lblTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad) * iva)).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad) * iva));
                lblTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento * 0.05)).ToString();
            }
            else if (tablaAtributos.Precio >= 100 && tablaAtributos.Precio < 101)
            {
                lblProductoNombre.Text          = producto;
                lblTotalSinIVA.Text             = (precio * cantidad).ToString();
                lblIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                lblTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad) * iva)).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad) * iva));
                lblTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento * 0.10)).ToString();
            }
            else if (tablaAtributos.Precio >= 101 && tablaAtributos.Precio < 150)
            {
                lblProductoNombre.Text          = producto;
                lblTotalSinIVA.Text             = (precio * cantidad).ToString();
                lblIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                lblTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad) * iva)).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad) * iva));
                lblTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento * 0.20)).ToString();
            }
            else
            {
                lblProductoNombre.Text          = producto;
                lblTotalSinIVA.Text             = (precio * cantidad).ToString();
                lblIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                lblTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad) * iva)).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad) * iva));
                lblTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento * 0.50)).ToString();
            }
        }
Exemple #2
0
        private void btnCalcular_Click(object sender, EventArgs e)
        {
            if (((txtIVA.Text == "") || (txtNombreProducto.Text == "")) ||
                ((txtPrecioDelProducto.Text == "") || (txtCantidad.Text == "")))
            {
                MessageBox.Show("Información incompleta");
            }
            else
            {
                ClsDescriptorTablaDescuentos datos = new ClsDescriptorTablaDescuentos();

                datos.NombreProducto = txtNombreProducto.Text;
                datos.Iva            = Convert.ToDouble(txtIVA.Text);
                datos.Precio         = Convert.ToDouble(txtPrecioDelProducto.Text);
                datos.Cantidad       = Convert.ToInt32(txtCantidad.Text);


                funcionesTabla(datos);
            }
        }
        public void funcionesTabla(ClsDescriptorTablaDescuentos tablaAtributos)
        {
            frmOperaciones frmTabla  = new frmOperaciones();
            frmOperaciones frmTabla2 = new frmOperaciones();

            Double iva      = tablaAtributos.Iva;
            string producto = tablaAtributos.NombreProducto;
            Double precio   = tablaAtributos.Precio;
            int    cantidad = tablaAtributos.Cantidad;


            if (tablaAtributos.Precio > 0 && tablaAtributos.Precio <= 50)
            {
                frmTabla.lbProductoNombre.Text          = producto;
                frmTabla.lbTotalSinIVA.Text             = (precio * cantidad).ToString();
                frmTabla.lbIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                frmTabla.lbTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad)) * iva).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad)) * iva);
                frmTabla.lbTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento)).ToString();
                MessageBox.Show((TotalSinDescuento - (TotalSinDescuento * 0.0)).ToString());
            }
            else if (tablaAtributos.Precio > 50 && tablaAtributos.Precio < 100)
            {
                frmTabla.lbProductoNombre.Text          = producto;
                frmTabla.lbTotalSinIVA.Text             = (precio * cantidad).ToString();
                frmTabla.lbIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                frmTabla.lbTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad)) * iva).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad)) * iva);
                frmTabla.lbTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento * 0.05)).ToString();
                MessageBox.Show((TotalSinDescuento - (TotalSinDescuento * 0.05)).ToString());
            }
            else if (tablaAtributos.Precio >= 100 && tablaAtributos.Precio < 101)
            {
                frmTabla.lbProductoNombre.Text          = producto;
                frmTabla.lbTotalSinIVA.Text             = (precio * cantidad).ToString();
                frmTabla.lbIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                frmTabla.lbTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad)) * iva).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad)) * iva);
                frmTabla.lbTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento * 0.10)).ToString();
                MessageBox.Show((TotalSinDescuento - (TotalSinDescuento * 0.10)).ToString());
            }
            else if (tablaAtributos.Precio >= 101 && tablaAtributos.Precio < 150)
            {
                frmTabla.lbProductoNombre.Text          = producto;
                frmTabla.lbTotalSinIVA.Text             = (precio * cantidad).ToString();
                frmTabla.lbIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                frmTabla.lbTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad)) * iva).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad)) * iva);
                frmTabla.lbTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento * 0.20)).ToString();
                MessageBox.Show((TotalSinDescuento - (TotalSinDescuento * 0.20)).ToString());
            }
            else
            {
                frmTabla.lbProductoNombre.Text          = producto;
                frmTabla.lbTotalSinIVA.Text             = (precio * cantidad).ToString();
                frmTabla.lbIVAaAgregar.Text             = ((precio * cantidad) * iva).ToString();
                frmTabla.lbTotalSinDescuentoMasIVA.Text = ((precio * cantidad) + ((precio * cantidad)) * iva).ToString();
                double TotalSinDescuento = ((precio * cantidad) + ((precio * cantidad)) * iva);
                frmTabla.lbTotalConDescuento.Text = (TotalSinDescuento - (TotalSinDescuento * 0.50)).ToString();
                MessageBox.Show((TotalSinDescuento - (TotalSinDescuento * 0.50)).ToString());
            }
            frmTabla.Show();
        }