Ejemplo n.º 1
0
        private void agregarMP()
        {
            FCapturaDatos fc;
            object[] datos_mp;
            int cant=0;

            fc = new FCapturaDatos();
            datos_mp = new object[4];

            mp_select = sgc_mp.PrimaryGrid.GridPanel.GetSelectedRows().GetCells();

            if (mp_select.Count != 0)
            {
                if (fc.ShowDialog() == DialogResult.OK)
                {
                    cant = Convert.ToInt32(fc.tb_cant.Text);

                    datos_mp[0] = cant;
                    datos_mp[1] = mp_select[0].Value;
                    datos_mp[2] = mp_select[1].Value;
                    datos_mp[3] = mp_select[2].Value;
                    sgc_receta.PrimaryGrid.Rows.Add(new GridRow(datos_mp));

                    ajustarDetalleReseta(datos_mp[1], cant, true);
                }
            }
            else
                MsgError("Seleccione todo el registro", "Agregar MP", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }
Ejemplo n.º 2
0
        private void agregarMP()
        {
            FCapturaDatos fc;

            object[] datos_mp;
            int      cant = 0;

            fc       = new FCapturaDatos();
            datos_mp = new object[4];

            mp_select = sgc_mp.PrimaryGrid.GridPanel.GetSelectedRows().GetCells();

            if (mp_select.Count != 0)
            {
                if (fc.ShowDialog() == DialogResult.OK)
                {
                    cant = Convert.ToInt32(fc.tb_cant.Text);

                    datos_mp[0] = cant;
                    datos_mp[1] = mp_select[0].Value;
                    datos_mp[2] = mp_select[1].Value;
                    datos_mp[3] = mp_select[2].Value;
                    sgc_receta.PrimaryGrid.Rows.Add(new GridRow(datos_mp));

                    ajustarDetalleReseta(datos_mp[1], cant, true);
                }
            }
            else
            {
                MsgError("Seleccione todo el registro", "Agregar MP", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Ejemplo n.º 3
0
        private void agregarMP()
        {
            FCapturaDatos fc;

            object[] datos_mp;
            int      cant;

            fc       = new FCapturaDatos();
            datos_mp = new object[5];

            mp_select = sgc_mp.PrimaryGrid.GridPanel.GetSelectedRows().GetCells();

            if (mp_select.Count != 0)
            {
                if (fc.ShowDialog() == DialogResult.OK)
                {
                    cant = Convert.ToInt32(fc.tb_cant.Text);

                    datos_mp[0] = cant;
                    datos_mp[1] = mp_select[0].Value;
                    datos_mp[2] = mp_select[1].Value;
                    datos_mp[3] = mp_select[3].Value;
                    datos_mp[4] = cant * Convert.ToSingle(mp_select[3].Value);

                    sgc_detalle.PrimaryGrid.Rows.Add(new GridRow(datos_mp));

                    subTotal += Convert.ToSingle(datos_mp[4]);
                    subTotal  = Convert.ToSingle(Math.Round((decimal)subTotal, 2));

                    tb_subtotal.Text = subTotal.ToString();
                    tb_iva.Text      = (Math.Round(subTotal * 0.16, 2)).ToString();
                    tb_total.Text    = (Math.Round(subTotal + (subTotal * 0.16), 2)).ToString();

                    ajustarDetalleCompra(datos_mp[1], cant, datos_mp[4], true);
                }
            }
            else
            {
                MsgError("Seleccione todo el registro", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 4
0
        private void agregarProductoDV(object sender, EventArgs e)
        {
            FCapturaDatos fc = new FCapturaDatos();

            object[] datos_product = new object[5];
            int      row           = Convert.ToInt32(((PictureBox)sender).Name);
            int      cant;
            float    iva;

            if (tb_cantidad.Text.Length > 0)
            {
                cant = Convert.ToInt32(tb_cantidad.Text);
            }
            else
            {
                fc.ShowDialog();
                cant = Convert.ToInt32(fc.tb_cant.Text);
            }

            if (cant.ToString().Length > 0)
            {
                datos_product[0] = cant;
                datos_product[1] = products.Rows[row][0];
                datos_product[2] = products.Rows[row][2];
                datos_product[3] = products.Rows[row][3];
                datos_product[4] = Convert.ToSingle(cant * Convert.ToSingle(products.Rows[row][3]));

                sgc_dv.PrimaryGrid.Rows.Add(new GridRow(datos_product));
                ajustarDetalleVenta(datos_product[1], cant, datos_product[4], true);

                subTotal += Convert.ToSingle(datos_product[4]);
                subTotal  = Convert.ToSingle(Math.Round((decimal)subTotal, 2));

                tb_subtotal.Text = subTotal.ToString();
                tb_iva.Text      = (Math.Round(subTotal * 0.16, 2)).ToString();
                tb_total.Text    = (Math.Round(subTotal + (subTotal * 0.16), 2)).ToString();

                tb_cantidad.Text = "";
            }
        }