Exemplo n.º 1
0
        private void Buscar(Int32 CodGarantia)
        {
            cGarantia gar  = new cGarantia();
            DataTable trdo = gar.GetGarantiaxCodigo(CodGarantia);

            if (trdo.Rows.Count > 0)
            {
                txtPatente.Text  = trdo.Rows[0]["Patente"].ToString();
                txtImporte.Text  = trdo.Rows[0]["Importe"].ToString();
                txtSaldo.Text    = trdo.Rows[0]["Saldo"].ToString();
                txtCodOrden.Text = trdo.Rows[0]["CodOrden"].ToString();
                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.SepararDecimales(txtImporte.Text);
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                }

                if (txtSaldo.Text != "")
                {
                    txtSaldo.Text = fun.SepararDecimales(txtSaldo.Text);
                    txtSaldo.Text = fun.FormatoEnteroMiles(txtSaldo.Text);
                }
            }
            if (txtSaldo.Text == "0")
            {
                btnGrabar.Enabled = false;
                btnAnular.Enabled = true;
            }
            else
            {
                btnGrabar.Enabled = true;
                btnAnular.Enabled = false;
            }
        }
Exemplo n.º 2
0
        private void Buscar()
        {
            cMovimiento mov      = new cMovimiento();
            double      Efectivo = mov.GetTotalEfectivo();

            txtEfectivo.Text = Efectivo.ToString();
            txtEfectivo.Text = fun.SepararDecimales(txtEfectivo.Text);
            txtEfectivo.Text = fun.FormatoEnteroMiles(txtEfectivo.Text);
            cDocumento doc        = new cDocumento();
            double     ImporteDoc = doc.GetTotalDocumentos();

            txtDocumentos.Text = ImporteDoc.ToString();
            txtDocumentos.Text = fun.SepararDecimales(txtDocumentos.Text);
            txtDocumentos.Text = fun.FormatoEnteroMiles(txtDocumentos.Text);
            cCobroTarjeta cobro = new cCobroTarjeta();

            txtTotalTarjeta.Text = cobro.GetTotal().ToString();
            txtTotalTarjeta.Text = fun.SepararDecimales(txtTotalTarjeta.Text);
            txtTotalTarjeta.Text = fun.FormatoEnteroMiles(txtTotalTarjeta.Text);
            cCheque cheque = new cCheque();

            txtTotalCheque.Text = cheque.GetTotalCheque().ToString();
            txtTotalCheque.Text = fun.SepararDecimales(txtTotalCheque.Text);
            txtTotalCheque.Text = fun.FormatoEnteroMiles(txtTotalCheque.Text);

            cGarantia garantia = new cGarantia();

            txtGarantia.Text = garantia.GetTotalGarantia().ToString();
            txtGarantia.Text = fun.SepararDecimales(txtGarantia.Text);
            txtGarantia.Text = fun.FormatoEnteroMiles(txtGarantia.Text);

            cInsumo insumo = new cInsumo();

            txtTotalInsumo.Text = insumo.GetTotalInsumo().ToString();
            txtTotalInsumo.Text = fun.SepararDecimales(txtTotalInsumo.Text);
            txtTotalInsumo.Text = fun.FormatoEnteroMiles(txtTotalInsumo.Text);

            cVale vale = new cVale();

            txtTotalVale.Text = vale.GetTotalVales().ToString();
            txtTotalVale.Text = fun.SepararDecimales(txtTotalVale.Text);
            txtTotalVale.Text = fun.FormatoEnteroMiles(txtTotalVale.Text);

            cTransferencia tra = new Clases.cTransferencia();

            txtTotalTransferencia.Text = tra.GetTotal().ToString();
            txtTotalTransferencia.Text = fun.SepararDecimales(txtTotalTransferencia.Text);
            txtTotalTransferencia.Text = fun.FormatoEnteroMiles(txtTotalTransferencia.Text);

            cCuentaCorriente cuenta        = new cCuentaCorriente();
            Double           ImporteCuenta = cuenta.GetTotal();

            txtCuentaCorriente.Text = ImporteCuenta.ToString();
            txtCuentaCorriente.Text = fun.SepararDecimales(txtCuentaCorriente.Text);
            txtCuentaCorriente.Text = fun.FormatoEnteroMiles(txtCuentaCorriente.Text);
        }
Exemplo n.º 3
0
        private void form_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (frmPrincipal.CodigoPrincipal != null)
            {
                Int32     CodInsumo = Convert.ToInt32(frmPrincipal.CodigoPrincipal);
                cInsumo   insumo    = new cInsumo();
                DataTable trdo      = insumo.GetInsumoxCodigo(CodInsumo);
                if (trdo.Rows.Count > 0)
                {
                    txtCodigo.Text   = trdo.Rows[0]["CodInsumo"].ToString();
                    txtCantidad.Text = trdo.Rows[0]["Cantidad"].ToString();
                    txt_Precio.Text  = trdo.Rows[0]["Precio"].ToString();
                    txt_Nombre.Text  = trdo.Rows[0]["Nombre"].ToString();
                    if (txtCantidad.Text == "")
                    {
                        txtCantidad.Text = "0";
                    }

                    if (txt_Precio.Text != "")
                    {
                        txt_Precio.Text = fun.SepararDecimales(txt_Precio.Text);
                        txt_Precio.Text = fun.FormatoEnteroMiles(txt_Precio.Text);
                    }
                    AplicarPorcentaje();
                }
            }
        }
Exemplo n.º 4
0
        private void txt_Codigo_TextChanged(object sender, EventArgs e)
        {
            string Codigo = txt_Codigo.Text;
            cJoya  joya   = new cJoya();

            if (Codigo.Length > 2)
            {
                DataTable trdo = joya.GetJoyaxCodigo(Codigo);
                if (trdo.Rows.Count > 0)
                {
                    txt_Codigo.Text      = trdo.Rows[0]["Codigo"].ToString();
                    txtCodigo.Text       = trdo.Rows[0]["CodJoya"].ToString();
                    txt_Nombre.Text      = trdo.Rows[0]["Nombre"].ToString();
                    txt_Stock.Text       = trdo.Rows[0]["Stock"].ToString();
                    txt_PrecioVenta.Text = trdo.Rows[0]["PrecioVenta"].ToString();
                    if (trdo.Rows[0]["CodTipo"].ToString() != "")
                    {
                        {
                            cmb_CodTipo.SelectedValue = trdo.Rows[0]["CodTipo"].ToString();
                        }

                        if (txt_PrecioVenta.Text != "")
                        {
                            cFunciones fun         = new cFunciones();
                            Double     PrecioVenta = Convert.ToDouble(txt_PrecioVenta.Text.Replace(".", ","));
                            txt_PrecioVenta.Text = Math.Round(PrecioVenta, 0).ToString();
                            txt_PrecioVenta.Text = fun.SepararDecimales(txt_PrecioVenta.Text);
                            txt_PrecioVenta.Text = fun.FormatoEnteroMiles(txt_PrecioVenta.Text);
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void CargarGrilla()
        {
            cFunciones fun        = new cFunciones();
            DateTime   FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime   FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            Int32?     CodTarjeta = null;

            if (cmbTarjeta.SelectedIndex > 0)
            {
                CodTarjeta = Convert.ToInt32(cmbTarjeta.SelectedValue);
            }
            string    Patente = txtPatente.Text;
            cTarjeta  tarj    = new cTarjeta();
            DataTable trdo    = tarj.GetVentaxTarjeta(FechaDesde, FechaHasta, CodTarjeta, Patente);
            Double    Total   = fun.TotalizarColumna(trdo, "Importe");

            trdo = fun.TablaaMiles(trdo, "Importe");
            trdo = fun.TablaaMiles(trdo, "Saldo");
            Grilla.DataSource         = trdo;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[1].Visible = false;
            Grilla.Columns[3].Width   = 250;
            Grilla.Columns[5].Width   = 250;
            Grilla.Columns[4].Width   = 130;
            Grilla.Columns[6].Width   = 120;
            txtTotal.Text             = Total.ToString();
            txtTotal.Text             = fun.SepararDecimales(txtTotal.Text);
            txtTotal.Text             = fun.FormatoEnteroMiles(txtTotal.Text);
        }
Exemplo n.º 6
0
        private void btnBuscarOrden_Click(object sender, EventArgs e)
        {
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                Mensaje("La fecha desde es incorrecta");
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                Mensaje("La fecha hasta es incorrecta");
                return;
            }

            DateTime  fechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime  fechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            cCheque   Cheque     = new cCheque();
            DataTable trdo       = Cheque.GetChequesxFecha(fechaDesde, fechaHasta);

            trdo = fun.TablaaMiles(trdo, "Importe");
            trdo = fun.TablaaMiles(trdo, "Saldo");
            Grilla.DataSource            = trdo;
            Grilla.Columns[1].HeaderText = "Nro Cheque";
            Grilla.Columns[6].HeaderText = "Fecha Vto";
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[4].Visible    = false;
            Grilla.Columns[1].Width      = 160;
            Grilla.Columns[2].Width      = 150;
            Grilla.Columns[3].Width      = 150;
            Grilla.Columns[5].Width      = 150;
            Grilla.Columns[7].Visible    = false;
            txtTotal.Text = fun.TotalizarColumna(trdo, "Saldo").ToString();
            txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
        }
        private void btnBuscarOrden_Click(object sender, EventArgs e)
        {
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                Mensaje("La fecha desde es incorrecta");
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                Mensaje("La fecha hasta es incorrecta");
                return;
            }

            DateTime  fechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime  fechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            string    Insumo     = txtInsumo.Text;
            cCompra   compra     = new cCompra();
            DataTable trdo       = compra.GetDetalleCompraxFecha(fechaDesde, fechaHasta, Insumo);

            trdo = fun.TablaaMiles(trdo, "Precio");
            trdo = fun.TablaaMiles(trdo, "Total");
            Grilla.DataSource            = trdo;
            Grilla.Columns[0].HeaderText = "Proveedor";
            Grilla.Columns[1].HeaderText = "Teléfono";
            Grilla.Columns[2].HeaderText = "Factura";
            Grilla.Columns[4].HeaderText = "Cantidad";
            Grilla.Columns[0].Width      = 200;
            Grilla.Columns[3].Width      = 180;
            double Total = fun.TotalizarColumna(trdo, "Total");

            txtTotal.Text = Total.ToString();
            txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
            txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
        }
Exemplo n.º 8
0
        private void Buscar()
        {
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                Mensaje("La fecha desde es incorrecta");
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                Mensaje("La fecha hasta es incorrecta");
                return;
            }

            DateTime  fechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime  fechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            cVale     vale       = new cVale();
            DataTable trdo       = vale.GetValesxFecha(fechaDesde, fechaHasta);

            trdo = fun.TablaaMiles(trdo, "Importe");
            trdo = fun.TablaaMiles(trdo, "Saldo");
            Grilla.DataSource            = trdo;
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[1].Width      = 140;
            Grilla.Columns[2].Width      = 140;
            Grilla.Columns[6].Width      = 100;
            Grilla.Columns[7].Width      = 250;
            Grilla.Columns[6].HeaderText = "Devolución";
            Grilla.Columns[2].Visible    = false;
            txtTotal.Text = fun.TotalizarColumna(trdo, "Saldo").ToString();
            txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
        }
Exemplo n.º 9
0
        private void CalcularTotales()
        {
            int Cantidad = GrillaCuotas.Rows.Count - 1;

            txtCuotas.Text = Cantidad.ToString();
            txtTotal.Text  = fun.TotalizarColumna(tbCuotas, "Importe").ToString();
            txtTotal.Text  = fun.FormatoEnteroMiles(txtTotal.Text);
        }
Exemplo n.º 10
0
        private void txtPrecioHasta_Leave(object sender, EventArgs e)
        {
            cFunciones fun = new cFunciones();

            if (txtPrecioHasta.Text != "")
            {
                txtPrecioHasta.Text = fun.FormatoEnteroMiles(txtPrecioHasta.Text);
            }
        }
Exemplo n.º 11
0
        private void Buscar(Int32 CodCheque)
        {
            cCheque   cheque = new cCheque();
            DataTable trdo   = cheque.GetChequexCodigo(CodCheque);

            if (trdo.Rows.Count > 0)
            {
                txtImporte.Text   = trdo.Rows[0]["Importe"].ToString();
                txtSaldo.Text     = trdo.Rows[0]["Saldo"].ToString();
                txtNroCheque.Text = trdo.Rows[0]["NroCheque"].ToString();
                txtOrden.Text     = trdo.Rows[0]["CodOrden"].ToString();
            }
            if (txtImporte.Text != "")
            {
                txtImporte.Text = fun.SepararDecimales(txtImporte.Text);
                txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
            }

            if (txtSaldo.Text != "")
            {
                txtSaldo.Text = fun.SepararDecimales(txtSaldo.Text);
                txtSaldo.Text = fun.FormatoEnteroMiles(txtSaldo.Text);
            }

            cCobroCheque objCobro = new cCobroCheque();
            DataTable    tresul   = objCobro.GetCobroChequexCodCheque(CodCheque);

            Grilla.DataSource         = tresul;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[1].Visible = false;
            Grilla.Columns[2].Width   = 130;
            Grilla.Columns[3].Width   = 130;
            if (txtSaldo.Text == "0")
            {
                btnAnular.Enabled = true;
                btnGrabar.Enabled = false;
            }
            else
            {
                btnAnular.Enabled = false;
                btnGrabar.Enabled = true;
            }
        }
Exemplo n.º 12
0
        private void GetAgendaxCodigo(Int32 CodAgenda)
        {
            cFunciones fun    = new cFunciones();
            cAgenda    agenda = new cAgenda();
            DataTable  trdo   = agenda.GetAgendaxCodigo(CodAgenda);

            if (trdo.Rows.Count > 0)
            {
                txtCodAgenda.Text   = trdo.Rows[0]["CodAgenda"].ToString();
                txtNombre.Text      = trdo.Rows[0]["Nombre"].ToString();
                txtApellido.Text    = trdo.Rows[0]["Apellido"].ToString();
                txtModelo.Text      = trdo.Rows[0]["Modelo"].ToString();
                txtDescripcion.Text = trdo.Rows[0]["Descripcion"].ToString();
                txtPatente.Text     = trdo.Rows[0]["Patente"].ToString();
                if (trdo.Rows[0]["CodMarca"].ToString() != "")
                {
                    Int32 CodMarca = Convert.ToInt32(trdo.Rows[0]["CodMarca"].ToString());
                    cmbMarca.SelectedValue = CodMarca.ToString();
                }

                if (trdo.Rows[0]["Fecha"].ToString() != "")
                {
                    DateTime Fecha = Convert.ToDateTime(trdo.Rows[0]["Fecha"].ToString());
                    txtFechaDesde.Text = Fecha.ToShortDateString();
                }

                TXTtELEFONO.Text = trdo.Rows[0]["Telefono"].ToString();
                if (trdo.Rows[0]["Precio"].ToString() != "")
                {
                    Double Precio = Convert.ToDouble(trdo.Rows[0]["Precio"].ToString());
                    txtImporte.Text = Precio.ToString();
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                }
                if (trdo.Rows[0]["CodOpcion"].ToString() != "")
                {
                    Int32 CodOpcion = Convert.ToInt32(trdo.Rows[0]["CodOpcion"].ToString());
                    if (CodOpcion == 1)
                    {
                        RadioComprador.Checked = true;
                        RadioVendedor.Checked  = false;
                    }

                    if (CodOpcion == 2)
                    {
                        RadioVendedor.Checked  = true;
                        RadioComprador.Checked = false;
                    }

                    if (trdo.Rows[0]["CodVendedor"].ToString() != "")
                    {
                        cmbVendedor.SelectedValue = trdo.Rows[0]["CodVendedor"].ToString();
                    }
                }
            }
        }
        private void txtCodigo_TextChanged(object sender, EventArgs e)
        {
            string Codigo = txtCodigo.Text;
            int    b      = 0;

            if (Codigo.Length > 3)
            {
                cJoya     joya = new cJoya();
                DataTable trdo = joya.GetJoyaxCodigo(Codigo);
                if (trdo.Rows.Count > 0)
                {
                    if (trdo.Rows[0]["CodJoya"].ToString() != "")
                    {
                        b = 1;
                        txtCodJoya.Text    = trdo.Rows[0]["CodJoya"].ToString();
                        txtNombreJoya.Text = trdo.Rows[0]["Nombre"].ToString();
                        txtStock.Text      = trdo.Rows[0]["Stock"].ToString();
                        txtPrecio.Text     = trdo.Rows[0]["PrecioVenta"].ToString();
                        if (trdo.Rows[0]["CodTipo"].ToString() != "")
                        {
                            cmbTipo.SelectedValue = trdo.Rows[0]["CodTipo"].ToString();
                        }
                        if (txtPrecio.Text != "")
                        {
                            txtPrecio.Text = fun.SepararDecimales(txtPrecio.Text);
                            txtPrecio.Text = fun.FormatoEnteroMiles(txtPrecio.Text);
                        }
                        txtCodigoBarra.Text = trdo.Rows[0]["CodigoBarra"].ToString();
                    }
                }
            }
            if (b == 0)
            {
                txtCodJoya.Text    = "";
                txtNombreJoya.Text = "";
                txtStock.Text      = "";
                if (cmbTipo.Items.Count > 0)
                {
                    cmbTipo.SelectedIndex = 0;
                }
            }
        }
Exemplo n.º 14
0
        private void Buscar(Int32 CodDocumento)
        {
            cDocumento doc  = new cDocumento();
            DataTable  trdo = doc.GetDocumentoxCodigo(CodDocumento);

            if (trdo.Rows.Count > 0)
            {
                txtNombre.Text   = trdo.Rows[0]["Nombre"].ToString();
                txtApellido.Text = trdo.Rows[0]["Apellido"].ToString();
                txtImporte.Text  = trdo.Rows[0]["Importe"].ToString();
                txtSaldo.Text    = trdo.Rows[0]["Saldo"].ToString();
                txtOrden.Text    = trdo.Rows[0]["CodOrden"].ToString();
                txtPatente.Text  = trdo.Rows[0]["Patente"].ToString();
                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.SepararDecimales(txtImporte.Text);
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                }

                if (txtSaldo.Text != "")
                {
                    txtSaldo.Text = fun.SepararDecimales(txtSaldo.Text);
                    txtSaldo.Text = fun.FormatoEnteroMiles(txtSaldo.Text);
                }
            }
            cCobroDocumento cob    = new cCobroDocumento();
            DataTable       tresul = cob.GetCobrosxCodDocumento(CodDocumento);

            tresul                    = fun.TablaaMiles(tresul, "Importe");
            Grilla.DataSource         = tresul;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[1].Visible = false;
            Grilla.Columns[3].Width   = 120;
            if (txtSaldo.Text == "0")
            {
                btnGrabar.Enabled = false;
            }
            else
            {
                btnGrabar.Enabled = true;
            }
        }
Exemplo n.º 15
0
        private void btnBuscarOrden_Click(object sender, EventArgs e)
        {
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                Mensaje("La fecha desde es incorrecta");
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                Mensaje("La fecha hasta es incorrecta");
                return;
            }
            string cupon = "";

            if (txtCupon.Text != "")
            {
                cupon = txtCupon.Text;
            }
            DateTime fechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime fechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            Int32?   CodOrden   = null;

            if (txtNroOrden.Text != "")
            {
                CodOrden = Convert.ToInt32(txtNroOrden.Text);
            }
            int Impago = 0;

            if (chkSoloImpago.Checked == true)
            {
                Impago = 1;
            }
            cCobroTarjeta cobro = new cCobroTarjeta();
            DataTable     trdo  = cobro.GetCobroTarjetaxFecha(fechaDesde, fechaHasta, CodOrden, cupon, Impago);

            trdo = fun.TablaaMiles(trdo, "Saldo");
            trdo = fun.TablaaMiles(trdo, "Importe");
            Grilla.DataSource             = trdo;
            Grilla.Columns[0].Visible     = false;
            Grilla.Columns[10].Visible    = false;
            Grilla.Columns[1].Visible     = false;
            Grilla.Columns[2].Visible     = false;
            Grilla.Columns[3].Visible     = false;
            Grilla.Columns[6].Width       = 100;
            Grilla.Columns[7].Width       = 100;
            Grilla.Columns[8].Width       = 160;
            Grilla.Columns[6].HeaderText  = "Cupón";
            Grilla.Columns[7].HeaderText  = "Cobro";
            Grilla.Columns[11].HeaderText = "Tarjeta";
            txtTotal.Text = fun.TotalizarColumna(trdo, "Importe").ToString();
            txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
        }
Exemplo n.º 16
0
        private void BuscarPresupuesto(Int32 CodPresupuesto)
        {   //string Col = "CodArticulo;Nombre;Precio;Cantidad;Subtotal";
            cPresupuesto prep        = new cPresupuesto();
            DataTable    trdo        = prep.GetPresupuestoxCod(CodPresupuesto);
            string       CodArticulo = "";
            string       Nombre      = "";
            string       Precio      = "";
            string       Cantidad    = "";
            string       Subtotal    = "";
            string       Val         = "";

            if (trdo.Rows.Count > 0)
            {/*
              * if (trdo.Rows[0]["CodTarjeta"].ToString() != "")
              * {
              *     CmbTarjeta.SelectedValue = trdo.Rows[0]["CodTarjeta"].ToString();
              *     txtCupon.Text = trdo.Rows[0]["Cupon"].ToString();
              *     CmbTarjeta.Visible = true;
              *     txtCupon.Visible = true;
              * }
              */
                if (trdo.Rows[0]["CodCliente"].ToString() != "")
                {
                    Int32 CodCli = Convert.ToInt32(trdo.Rows[0]["CodCliente"].ToString());
                    BuscarCliente(CodCli);
                }
                for (int i = 0; i < trdo.Rows.Count; i++)
                {
                    CodArticulo = trdo.Rows[i]["CodArticulo"].ToString();
                    Nombre      = trdo.Rows[i]["Nombre"].ToString();
                    Precio      = trdo.Rows[i]["Precio"].ToString();
                    Cantidad    = trdo.Rows[i]["Cantidad"].ToString();
                    Subtotal    = trdo.Rows[i]["Subtotal"].ToString();
                    Val         = CodArticulo + ";" + Nombre;
                    Val         = Val + ";" + Precio + ";" + Cantidad;
                    Val         = Val + ";" + Subtotal;
                    tbVenta     = fun.AgregarFilas(tbVenta, Val);
                }
                Grilla.DataSource         = tbVenta;
                Grilla.Columns[0].Visible = false;
                Grilla.Columns[5].Visible = false;
                Grilla.Columns[1].Width   = 370;
                Double Total = fun.TotalizarColumna(tbVenta, "Subtotal");
                txtTotal.Text       = Total.ToString();
                txtTotal.Text       = fun.FormatoEnteroMiles(txtTotal.Text);
                btnGrabar.Enabled   = false;
                btnCancelar.Enabled = false;
            }
        }
        private void Buscar()
        {
            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);

            Clases.cGastosNegocio gasto = new Clases.cGastosNegocio();
            DataTable             trdo  = gasto.GetGastosNegocioxFecha(FechaDesde, FechaHasta, txtDescripcion.Text);

            trdo                      = fun.TablaaMiles(trdo, "Importe");
            txtTotal.Text             = fun.TotalizarColumna(trdo, "Importe").ToString();
            txtTotal.Text             = fun.FormatoEnteroMiles(txtTotal.Text);
            Grilla.DataSource         = trdo;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[2].Width   = 520;
        }
Exemplo n.º 18
0
        private void Buscar()
        {
            DateTime   FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime   FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            cFunciones fun        = new cFunciones();
            cVenta     venta      = new cVenta();
            DataTable  trdo       = venta.GetVentas(FechaDesde, FechaHasta);

            trdo = fun.TablaaMiles(trdo, "Total");
            Grilla.DataSource         = trdo;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[2].Width   = 170;
            Grilla.Columns[3].Width   = 180;
            txtTotal.Text             = fun.TotalizarColumna(trdo, "Total").ToString();
            txtTotal.Text             = fun.FormatoEnteroMiles(txtTotal.Text);
        }
        private void Buscar(DateTime FechaDesde, DateTime FechaHasta, Int32?CodTipo)
        {
            cVentaJoya venta = new Clases.cVentaJoya();
            DataTable  trdo  = venta.GetResumenVentasxFecha(FechaDesde, FechaHasta, CodTipo);

            trdo = fun.TablaaMiles(trdo, "Total");
            Double Total = fun.TotalizarColumna(trdo, "Total");

            Grilla.DataSource = trdo;
            fun.AnchoColumnas(Grilla, "60;20;20");
            txtTotal.Text = Total.ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
        }
Exemplo n.º 20
0
        private void btnBuscarOrden_Click(object sender, EventArgs e)
        {
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                Mensaje("La fecha desde es incorrecta");
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                Mensaje("La fecha hasta es incorrecta");
                return;
            }
            Int32?CodOrden = null;

            if (txtNroOrden.Text != "")
            {
                CodOrden = Convert.ToInt32(txtNroOrden.Text);
            }
            DateTime fechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime fechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            int      SoloImpago = 0;

            if (chkSoloImpago.Checked)
            {
                SoloImpago = 1;
            }
            cDocumento doc  = new cDocumento();
            DataTable  trdo = doc.GetDocumentosxFecha(fechaDesde, fechaHasta, SoloImpago, CodOrden);

            trdo = fun.TablaaMiles(trdo, "Importe");
            trdo = fun.TablaaMiles(trdo, "Saldo");
            Grilla.DataSource         = trdo;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[1].Width   = 70;
            Grilla.Columns[2].Width   = 210;
            txtTotal.Text             = fun.TotalizarColumna(trdo, "Saldo").ToString();
            txtTotal.Text             = fun.FormatoEnteroMiles(txtTotal.Text);
        }
Exemplo n.º 21
0
        private void BuscarVale(Int32 CodVale)
        {
            cFunciones fun  = new cFunciones();
            cVale      vale = new cVale();
            DataTable  trdo = vale.GetValexCodigo(CodVale);

            if (trdo.Rows.Count > 0)
            {
                txtNombre.Text      = trdo.Rows[0]["Nombre"].ToString();
                txtApellido.Text    = trdo.Rows[0]["Apellido"].ToString();
                txtDescripcion.Text = trdo.Rows[0]["Descripcion"].ToString();
                DateTime Fecha = Convert.ToDateTime(trdo.Rows[0]["Fecha"].ToString());
                txtFecha.Text = Fecha.ToShortDateString();
                txtMonto.Text = trdo.Rows[0]["Importe"].ToString();
                if (txtMonto.Text != "")
                {
                    txtMonto.Text = fun.SepararDecimales(txtMonto.Text);
                    txtMonto.Text = fun.FormatoEnteroMiles(txtMonto.Text);
                }
            }
            btnGuardar.Visible = false;
        }
Exemplo n.º 22
0
        private void BuscarInsumoxCodigo(Int32 CodInsumo)
        {
            cInsumo   insumo = new cInsumo();
            DataTable trdo   = insumo.GetInsumoxCodigo(CodInsumo);

            if (trdo.Rows.Count > 0)
            {
                txtCodigo.Text   = trdo.Rows[0]["CodInsumo"].ToString();
                txtCantidad.Text = trdo.Rows[0]["Cantidad"].ToString();
                txt_Precio.Text  = trdo.Rows[0]["Precio"].ToString();
                txt_Nombre.Text  = trdo.Rows[0]["Nombre"].ToString();
                if (txtCantidad.Text == "")
                {
                    txtCantidad.Text = "0";
                }

                if (txt_Precio.Text != "")
                {
                    txt_Precio.Text = fun.SepararDecimales(txt_Precio.Text);
                    txt_Precio.Text = fun.FormatoEnteroMiles(txt_Precio.Text);
                }
            }
        }
        public void Buscar(DateTime FechaDesde, DateTime FechaHasta)
        {
            string    Mes           = "";
            string    Anio          = "";
            int       NumeroMes     = 0;
            string    Total         = "";
            string    TotalComision = "";
            string    TotalRendido  = "";
            string    Val           = "";
            string    Col           = "Mes;Anio;Total;TotalComision;TotalRendido";
            DataTable tbResumen     = fun.CrearTabla(Col);
            cVenta    venta         = new Clases.cVenta();
            DataTable trdo          = venta.GetResumenVentas(FechaDesde, FechaHasta);

            if (trdo.Rows.Count > 0)
            {
                for (int i = 0; i < trdo.Rows.Count; i++)
                {
                    Val           = "";
                    NumeroMes     = Convert.ToInt32(trdo.Rows[i]["Mes"].ToString());
                    Mes           = Getmes(NumeroMes);
                    Anio          = trdo.Rows[i]["Anio"].ToString();
                    Total         = trdo.Rows[i]["Total"].ToString();
                    TotalComision = trdo.Rows[i]["TotalComision"].ToString();
                    TotalRendido  = trdo.Rows[i]["TotalRendido"].ToString();
                    Val           = Mes + ";" + Anio;
                    Val           = Val + ";" + Total + ";" + TotalComision + ";" + TotalRendido;
                    tbResumen     = fun.AgregarFilas(tbResumen, Val);
                }
            }
            if (tbResumen.Rows.Count > 0)
            {
                tbResumen = fun.TablaaMiles(tbResumen, "Total");
                tbResumen = fun.TablaaMiles(tbResumen, "TotalComision");
                tbResumen = fun.TablaaMiles(tbResumen, "TotalRendido");
            }
            Double dTotal         = fun.TotalizarColumna(tbResumen, "Total");
            Double dTotalComision = fun.TotalizarColumna(tbResumen, "TotalComision");
            Double dTotalRendido  = fun.TotalizarColumna(tbResumen, "TotalRendido");

            txtTotal.Text         = dTotal.ToString();
            txtTotalRendido.Text  = dTotalRendido.ToString();
            txtTotalComision.Text = dTotalComision.ToString();
            Grilla.DataSource     = tbResumen;
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            if (txtTotalComision.Text != "")
            {
                txtTotalComision.Text = fun.FormatoEnteroMiles(txtTotalComision.Text);
            }
            if (txtTotalRendido.Text != "")
            {
                txtTotalRendido.Text = fun.FormatoEnteroMiles(txtTotalRendido.Text);
            }
            string ancho = "30;10;20;20;20";

            fun.AnchoColumnas(Grilla, ancho);
            Grilla.Columns[3].HeaderText = "Total Comisión";
            Grilla.Columns[4].HeaderText = "Total Rendido";
        }
Exemplo n.º 24
0
        private void Buscar()
        {
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                Mensaje("La fecha desde es incorrecta");
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                Mensaje("La fecha hasta es incorrecta");
                return;
            }

            DateTime fechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime fechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            string   Patente    = "";

            if (txtPatente.Text != "")
            {
                Patente = txtPatente.Text;
            }
            string Apellido = "";

            if (txtApellido.Text != "")
            {
                Apellido = txtApellido.Text;
            }
            Int32?CodOrden = null;

            if (txtNroOrden.Text != "")
            {
                CodOrden = Convert.ToInt32(txtNroOrden.Text);
            }
            Int32?Tipo = null;

            if (CmbTipo.SelectedIndex > 0)
            {
                Tipo = Convert.ToInt32(CmbTipo.SelectedValue);
            }
            cOrden    orden = new cOrden();
            DataTable trdo  = orden.GetOrdenxFecha(fechaDesde, fechaHasta, Patente, Apellido, CodOrden, Tipo);

            if (Tipo == 2)
            {
                for (int k = 0; k < trdo.Rows.Count; k++)
                {
                    if (Convert.ToDouble(trdo.Rows[k]["Saldo"].ToString()) == 0)
                    {
                        trdo.Rows[k].Delete();
                    }
                }
                trdo.AcceptChanges();
            }

            if (Tipo == 3)
            {
                for (int k = 0; k < trdo.Rows.Count; k++)
                {
                    if (Convert.ToDouble(trdo.Rows[k]["Saldo"].ToString()) > 0)
                    {
                        trdo.Rows[k].Delete();
                    }
                }
                trdo.AcceptChanges();
            }


            trdo = fun.TablaaMiles(trdo, "Costo");
            trdo = fun.TablaaMiles(trdo, "Venta");
            trdo = fun.TablaaMiles(trdo, "ManoObra");
            trdo = fun.TablaaMiles(trdo, "Ganancia");
            trdo = fun.TablaaMiles(trdo, "Efectivo");
            trdo = fun.TablaaMiles(trdo, "Documento");
            trdo = fun.TablaaMiles(trdo, "Cheque");
            trdo = fun.TablaaMiles(trdo, "Tarjeta");
            trdo = fun.TablaaMiles(trdo, "Garantia");
            trdo = fun.TablaaMiles(trdo, "Saldo");
            trdo = fun.TablaaMiles(trdo, "CuentaCorriente");
            if (Tipo == 2)
            {
            }
            grdOrdenes.DataSource            = trdo;
            grdOrdenes.Columns[0].HeaderText = "Orden";
            grdOrdenes.Columns[0].Width      = 80;
            grdOrdenes.Columns[4].Width      = 60;
            grdOrdenes.Columns[5].Visible    = false;
            grdOrdenes.Columns[3].Visible    = false;
            grdOrdenes.Columns[7].Visible    = false;
            txtTotal.Text    = fun.TotalizarColumna(trdo, "Ganancia").ToString();
            txtTotal.Text    = fun.SepararDecimales(txtTotal.Text);
            txtTotal.Text    = fun.FormatoEnteroMiles(txtTotal.Text);
            txtCantidad.Text = trdo.Rows.Count.ToString();
            VerificarUsuario();
            Pintar();
            PintarOrdenesSinSaldo();
        }
Exemplo n.º 25
0
        private void Buscar(Int32 CodCobro)
        {
            int b = 0;

            txtFecha.Text = DateTime.Now.ToShortDateString();
            cCobroTarjeta cobro = new cCobroTarjeta();
            DataTable     trdo  = cobro.GetCobroTarjeta(CodCobro);

            if (trdo.Rows.Count > 0)
            {
                txtNombre.Text   = trdo.Rows[0]["Nom"].ToString();
                txtApellido.Text = trdo.Rows[0]["Apellido"].ToString();
                txtPatente.Text  = trdo.Rows[0]["Patente"].ToString();
                txtImporte.Text  = trdo.Rows[0]["Importe"].ToString();
                txtSaldo.Text    = trdo.Rows[0]["Saldo"].ToString();
                txtImporte.Text  = fun.SepararDecimales(txtImporte.Text);
                txtImporte.Text  = fun.FormatoEnteroMiles(txtImporte.Text);
                txtSaldo.Text    = fun.SepararDecimales(txtSaldo.Text);
                txtSaldo.Text    = fun.FormatoEnteroMiles(txtSaldo.Text);
                txtaPagar.Text   = trdo.Rows[0]["Importe"].ToString();
                if (txtaPagar.Text != "")
                {
                    txtaPagar.Text = fun.SepararDecimales(txtaPagar.Text);
                    txtaPagar.Text = fun.FormatoEnteroMiles(txtaPagar.Text);
                }
                txtTarjeta.Text  = trdo.Rows[0]["Nombre"].ToString();
                txtCodVenta.Text = trdo.Rows[0]["CodVenta"].ToString();
                txtOrden.Text    = trdo.Rows[0]["CodOrden"].ToString();
                txtCupon.Text    = trdo.Rows[0]["Cupon"].ToString();


                DateTime FechadeEmision = Convert.ToDateTime(trdo.Rows[0]["FechaEmision"].ToString());
                txtFechaEmision.Text = FechadeEmision.ToShortDateString();
                DateTime FechaOrden = Convert.ToDateTime(trdo.Rows[0]["Fecha"].ToString());
                txtFechaOrden.Text = FechaOrden.ToShortDateString();
                txtRecargo.Text    = trdo.Rows[0]["Recargo"].ToString();
                if (trdo.Rows[0]["FechaCobro"].ToString() != "")
                {
                    b = 1;
                    DateTime fechaCobro = Convert.ToDateTime(trdo.Rows[0]["FechaCobro"].ToString());
                    txtFechaCobro.Text = fechaCobro.ToShortDateString();
                    double Imp   = Convert.ToDouble(trdo.Rows[0]["Importe"].ToString());
                    double Saldo = Convert.ToDouble(trdo.Rows[0]["Saldo"].ToString());
                    Imp = Imp - Saldo;
                    txtIngresarMonto.Text = Imp.ToString();
                    txtIngresarMonto.Text = fun.SepararDecimales(txtIngresarMonto.Text);
                    txtIngresarMonto.Text = fun.FormatoEnteroMiles(txtIngresarMonto.Text);
                }
                else
                {
                    txtDiferencia.Text = "";
                }
            }

            if (b == 1)
            {
                btnGrabar.Enabled = false;
                btnAnular.Enabled = true;
            }
            else
            {
                btnGrabar.Enabled = true;
                btnAnular.Enabled = false;
            }
            GetSaldo(CodCobro);
        }