Пример #1
0
        private void dgvInsumo_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (bloqueo == false)
                {
                    if (e.ColumnIndex == dgvInsumo.Columns["cnCantidadApertura"].Index && e.RowIndex >= 0)
                    {
                        foreach (DataGridViewRow row2 in dgvInsumo.SelectedRows)
                        {
                            frmAddCantidad frm = new frmAddCantidad();
                            frm.lblCantidad.Text = "CANTIDAD";
                            frm.ShowDialog();

                            if (frm.Cancelado == false)
                            {
                                row2.Cells["cnCantidadApertura"].Value = frm.txtCantidad.Text;
                            }
                        }
                    }
                }
            }
            catch
            {
            }
        }
Пример #2
0
        private void txtNumero_Click(object sender, EventArgs e)
        {
            try
            {
                frmAddCantidad frmCantidad = new frmAddCantidad();
                frmCantidad.ShowDialog();

                if (frmCantidad.Cancelado == false)
                {
                    txtNumero.Text = Convert.ToDecimal(frmCantidad.txtCantidad.Text).ToString("00000000");

                    //SqlDataReader readerVenta = fn.selectMultiValues("select * from venta where IDVenta = '" + idVenta + "'");
                    //readerVenta.Read();
                    //lblTipoPago.Text = readerVenta["TipoPago"].ToString();
                    //lblTotal.Text = readerVenta["Total"].ToString();
                    //readerVenta.Close();

                    //lblSerieActual.Text = txtSerie.Text;
                    //lblNumeroActual.Text = txtNumero.Text;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #3
0
        private void atenderInsumo()
        {
            try
            {
                string codInsumo = dgvListaInsumo.CurrentRow.Cells["IDInsumo"].Value.ToString();
                string insumo    = dgvListaInsumo.CurrentRow.Cells["Insumo"].Value.ToString();

                for (short i = 0; i < dgvAtendiendoInsumo.Rows.Count; i++)
                {
                    string codigo = dgvAtendiendoInsumo.Rows[i].Cells["cnCodigo"].Value.ToString();
                    if (codInsumo == codigo)
                    {
                        MessageBox.Show("El Inusmo ya se Encuentra en la Lista de Atendidos. Verificar", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                frmAddCantidad frm = new frmAddCantidad();
                frm.ShowDialog();

                if (frm.Cancelado == false)
                {
                    dgvAtendiendoInsumo.Rows.Add(codInsumo, insumo, frm.txtCantidad.Text, 'X');

                    dgvListaInsumo.Rows.Remove(dgvListaInsumo.CurrentRow);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #4
0
        private void txtNroDocumento_Click(object sender, EventArgs e)
        {
            frmAddCantidad frmCantidad = new frmAddCantidad();

            frmCantidad.txtCantidad.Text = "";
            frmCantidad.ShowDialog();

            if (frmCantidad.Cancelado == false)
            {
                txtNroDocumento.Text = frmCantidad.txtCantidad.Text;
                BuscarCliente(txtNroDocumento.Text);
            }
        }
Пример #5
0
        private void dgvInsumo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                frmAddCantidad frm = new frmAddCantidad();
                frm.ShowDialog();

                if (frm.Cancelado == false)
                {
                    string idInsumo = dgvInsumo.CurrentRow.Cells[0].Value.ToString();
                    string insumo   = dgvInsumo.CurrentRow.Cells[1].Value.ToString();
                    string cantidad = frm.txtCantidad.Text;
                    dgvSalida.Rows.Add(idInsumo, insumo, cantidad, 'X');
                }
            }
        }
Пример #6
0
        private void addItem()
        {
            try
            {
                frmAddCantidad frm = new frmAddCantidad();
                frm.ShowDialog();
                if (frm.Cancelado == false)
                {
                    int    cantidad       = Convert.ToInt16(frm.txtCantidad.Text);
                    string idPresentation = dgvListaPlatos.CurrentRow.Cells["IDPresentacion"].Value.ToString();
                    string categoria      = dgvListaPlatos.CurrentRow.Cells["Categoria"].Value.ToString();
                    string costo          = dgvListaPlatos.CurrentRow.Cells["Costo"].Value.ToString();
                    string presentacion   = dgvListaPlatos.CurrentRow.Cells["Presentacion"].Value.ToString();
                    double precio         = Convert.ToDouble(dgvListaPlatos.CurrentRow.Cells["Precio"].Value.ToString());
                    bool   combo          = Convert.ToBoolean(dgvListaPlatos.CurrentRow.Cells["Combo"].Value.ToString());
                    double importe        = precio * cantidad;

                    dgvPedido.Rows.Add(false, idPresentation, presentacion, frm.txtDescr.Text, combo, cantidad, precio, importe, "", categoria, costo, "");

                    if (combo)
                    {
                        //COMBO
                        SqlDataReader lectorCombo = fn.selectMultiValues("select p2.IDPresentacion,pro.Producto+''+p2.Presentacion as Presentacion,pc.cantidad,p2.Precio  from PresentacionCombo pc  inner join Presentacion p2 on pc.IDPresentacion = p2.IDPresentacion  inner join  Producto pro on p2.IDProducto = pro.IDProducto where pc.IDPresentacionCombo = '" + idPresentation + "'");
                        while (lectorCombo.Read())
                        {
                            string idPresentacionC = lectorCombo["IDPresentacion"].ToString();
                            string presentacionC   = lectorCombo["Presentacion"].ToString();
                            int    cantidadC       = Convert.ToInt16(lectorCombo["Cantidad"]);


                            dgvPedido.Rows.Add(false, idPresentacionC, presentacionC, "", false, (cantidadC * cantidad), "0", "0", "", categoria, costo, idPresentation);
                        }
                        lectorCombo.Close();
                    }

                    calcularTotal();
                    txtBuscar.SelectAll();
                    txtBuscar.Focus();

                    OcultarCombos();
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #7
0
        private void txtNumero_Click(object sender, EventArgs e)
        {
            try
            {
                frmAddCantidad frmCantidad = new frmAddCantidad();
                frmCantidad.ShowDialog();

                if (frmCantidad.Cancelado == false)
                {
                    txtNumero.Text = Convert.ToDecimal(frmCantidad.txtCantidad.Text).ToString("00000000");



                    string idVenta = txtSerie.Text + " - " + txtNumero.Text;

                    SqlDataReader readerVenta = fn.selectMultiValues("select tp.IDTipoPago,tp.TipoPago,v.Total,v.NombreCliente,c.Numero,v.Anulada,v.NroComanda  from venta v  inner join Cliente c on v.IDCliente = c.IDCliente  inner join TipoPago tp on v.IDTipoPago = tp.IDTipoPago where v.IDVenta = '" + idVenta + "'");
                    readerVenta.Read();
                    bool anulada = Convert.ToBoolean(readerVenta["Anulada"].ToString());
                    if (anulada == true)
                    {
                        MessageBox.Show("No se Puede Cangear el comprobante " + idVenta + ". Por que se Encuentra Anulado.", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }

                    lblSerieActual.Text  = txtSerie.Text;
                    lblNumeroActual.Text = txtNumero.Text;
                    lblTipoPago.Tag      = readerVenta["IDTipoPago"].ToString();
                    lblTipoPago.Text     = readerVenta["TipoPago"].ToString();
                    lblTotal.Text        = readerVenta["Total"].ToString();
                    txtCliente.Text      = readerVenta["NombreCliente"].ToString();
                    txtNroDocumento.Text = readerVenta["Numero"].ToString();
                    lblNroComanda.Text   = readerVenta["NroComanda"].ToString();
                    readerVenta.Close();



                    fn.ActualizarGrid(dgvDetalleVenta, "select dv.IDPresentacion as cnCodigo,dv.Presentacion as cnPresentacion,dv.Cantidad as cnCantidad,Precio as cnPrecio,(Cantidad * Precio) as cnImporte from DetalleVenta dv where IDVenta = '" + idVenta + "'");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #8
0
        private void btnDesbloquear_Click(object sender, EventArgs e)
        {
            frmAddCantidad frm = new frmAddCantidad();

            frm.ShowDialog();

            if (frm.Cancelado == false)
            {
                if (Datos.contraseñaSeguridad == frm.txtCantidad.Text)
                {
                    dgvInsumo.Columns["cnCantidadApertura"].ReadOnly = false;
                    bloqueo = false;
                    MessageBox.Show("Contraseña Correcta", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Contraseña Incorrecta", "FactuTED", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Пример #9
0
        private void dgvInsumo_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.ColumnIndex == dgvInsumo.Columns["cnEspecificar"].Index && e.RowIndex >= 0)
                {
                    foreach (DataGridViewRow row2 in dgvInsumo.SelectedRows)
                    {
                        frmAddCantidad frm = new frmAddCantidad();
                        frm.lblCantidad.Text = "SALDO";
                        frm.ShowDialog();

                        if (frm.Cancelado == false)
                        {
                            calcularSaldo(row2, frm.txtCantidad.Text);
                        }
                    }
                }
            }
            catch
            {
            }
        }
Пример #10
0
        private void txtSerie_Click(object sender, EventArgs e)
        {
            frmAddCantidad frm = new frmAddCantidad();

            frm.ShowDialog();
        }