コード例 #1
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                MessageBox.Show("Fecha desde incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                MessageBox.Show("Fecha hasta incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (Convert.ToDateTime(txtFechaDesde.Text) > Convert.ToDateTime(txtFechaHasta.Text))
            {
                MessageBox.Show("La fecha desde debe ser inferior a la fecha hasta", Clases.cMensaje.Mensaje());
                return;
            }

            int Impago = 0;

            if (chkImpagos.Checked == true)
            {
                Impago = 1;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            int      Impagos    = 0;

            if (chkImpagos.Checked == true)
            {
                Impagos = 1;
            }
            Clases.cChequesaPagar cheque = new Clases.cChequesaPagar();
            DataTable             trdo   = cheque.GetChequesPagar(FechaDesde, FechaHasta, Impago, txtPatente.Text);

            txtTotal.Text                = fun.TotalizarColumna(trdo, "Importe").ToString();
            txtTotal.Text                = fun.FormatoEnteroMiles(txtTotal.Text);
            trdo                         = fun.TablaaMiles(trdo, "Importe");
            trdo                         = fun.TablaaMiles(trdo, "Saldo");
            Grilla.DataSource            = trdo;
            Grilla.Columns[1].HeaderText = "Nro de cheque";
            Grilla.Columns[6].HeaderText = "Fecha Pago";
            Grilla.Columns[9].HeaderText = "Fecha Vto";
            Grilla.Columns[5].Width      = 130;
            Grilla.Columns[1].Width      = 140;
            Grilla.Columns[2].Width      = 150;
            Grilla.Columns[3].Width      = 100;
            Grilla.Columns[6].Width      = 110;
            Grilla.Columns[7].Width      = 180;
            Grilla.Columns[7].HeaderText = "Descripción";
            Grilla.Columns[0].Visible    = false;
        }
コード例 #2
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                MessageBox.Show("Fecha desde incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                MessageBox.Show("Fecha hasta incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (Convert.ToDateTime(txtFechaDesde.Text) > Convert.ToDateTime(txtFechaHasta.Text))
            {
                MessageBox.Show("La fecha desde debe ser inferior a la fecha hasta", Clases.cMensaje.Mensaje());
                return;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            int      Impagos    = 0;
            Int32?   CodBanco   = null;
            string   NroCheque  = "";

            if (cmbBanco.SelectedIndex > 0)
            {
                CodBanco = Convert.ToInt32(cmbBanco.SelectedValue);
            }
            NroCheque = txtNumeroCheque.Text;
            if (chkImpagos.Checked == true)
            {
                Impagos = 1;
            }
            Clases.cCheque cheque = new Clases.cCheque();
            DataTable      trdo   = cheque.GetChequesxFecha(FechaDesde, FechaHasta, Impagos, CodBanco, NroCheque);

            trdo          = fun.TablaaMiles(trdo, "Importe");
            txtTotal.Text = fun.TotalizarColumna(trdo, "Importe").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            Grilla.DataSource            = trdo;
            Grilla.Columns[1].Width      = 100;
            Grilla.Columns[1].HeaderText = "Fec. Cobro";
            Grilla.Columns[2].Width      = 100;
            Grilla.Columns[2].HeaderText = "Fecha Vto.";
            Grilla.Columns[3].Width      = 140;
            Grilla.Columns[3].HeaderText = "Nro. Cheque";
            Grilla.Columns[5].Width      = 220;
            Grilla.Columns[6].Visible    = false;
        }
コード例 #3
0
        public void GetCobranzas(Int32 CodCobranza)
        {
            Clases.cFunciones       fun = new Clases.cFunciones();
            Clases.cCobranzaGeneral cob = new Clases.cCobranzaGeneral();
            DataTable trdo = cob.GetCobranzaxCodigo(CodCobranza);

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

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

                if (trdo.Rows[0]["FechaPago"].ToString() == "")
                {
                    btnGuardar.Enabled    = true;
                    btnAnular.Enabled     = false;
                    btnPagarSaldo.Visible = false;
                }
                else
                {
                    btnGuardar.Enabled    = false;
                    btnAnular.Enabled     = true;
                    btnPagarSaldo.Visible = true;
                }
                txtTotalCobrado.Text = trdo.Rows[0]["ImportePagado"].ToString();
                txtDescripcion.Text  = trdo.Rows[0]["Descripcion"].ToString();
                txtImporte.Text      = trdo.Rows[0]["Importe"].ToString();
                txtPatente.Text      = trdo.Rows[0]["Patente"].ToString();
                txtSaldo.Text        = trdo.Rows[0]["Saldo"].ToString();
                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.SepararDecimales(txtImporte.Text);
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                }

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

                if (txtSaldo.Text != "")
                {
                    txtSaldo.Text = fun.SepararDecimales(txtSaldo.Text);
                    txtSaldo.Text = fun.FormatoEnteroMiles(txtSaldo.Text);
                }
            }
        }
コード例 #4
0
 private void btnGrabar_Click(object sender, EventArgs e)
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     if (Validar() == true)
     {
         fun.ModificarGenerico(this, "Cliente", "CodCliente", "1");
         //  if (txtCodCLiente.Text =="")
         //      fun.GuardarNuevoGenerico(this, "Cliente");
     }
 }
コード例 #5
0
 private void FrmAbmAuto_Load(object sender, EventArgs e)
 {
     Botonera(1);
     Grupo.Enabled = false;
     Clases.cFunciones fun = new Clases.cFunciones();
     fun.LlenarCombo(cmb_CodMarca, "Marca", "Nombre", "CodMarca");
     fun.LlenarCombo(cmb_CodCiudad, "Ciudad", "Nombre", "CodCiudad");
     fun.LlenarCombo(cmb_CodTipoCombustible, "TipoCombustible", "Nombre", "Codigo");
     cmb_CodCiudad.SelectedValue = 1;
 }
コード例 #6
0
        private void CargarGrilla(Int32 CodPrestamo)
        {
            Clases.cFunciones     fun  = new Clases.cFunciones();
            Clases.cPagoIntereses pago = new Clases.cPagoIntereses();
            DataTable             trdo = pago.GetInteresesPagadosxCodPrestamo(CodPrestamo);

            trdo = fun.TablaaFechas(trdo, "Importe");
            Grilla.DataSource         = trdo;
            Grilla.Columns[0].Visible = false;
        }
コード例 #7
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     if (txtPatente.Text == "")
     {
         MessageBox.Show("Debe ingresar una patente", Clases.cMensaje.Mensaje());
         return;
     }
     CargarGrilla();
 }
コード例 #8
0
ファイル: FrmGastos.cs プロジェクト: pablomartinzabala2/AG
 private void InicializarComponentes()
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     fun.LlenarCombo(cmbMarca, "Marca", "Nombre", "CodMarca");
     fun.LlenarCombo(cmbCiudad, "Ciudad", "Nombre", "CodCiudad");
     cmbCiudad.SelectedValue = 1;
     fun.LlenarCombo(CmbCategoriaGasto, "CategoriaGasto", "Nombre", "CodCategoriaGasto");
     // string FechaCorta = DateTime.Now.ToShortDateString();
     txtFecha.Text = DateTime.Now.ToShortDateString();
 }
コード例 #9
0
        private void GetPrendas()
        {
            Clases.cPrenda prenda  = new Clases.cPrenda();
            double         Importe = prenda.GetTotalPrenda();

            txtPrenda.Text = Importe.ToString();
            Clases.cFunciones fun = new Clases.cFunciones();
            txtPrenda.Text = fun.SepararDecimales(txtPrenda.Text);
            txtPrenda.Text = fun.FormatoEnteroMiles(txtPrenda.Text);
        }
コード例 #10
0
 private void FrmCobroDocumentosAnteriores_Load(object sender, EventArgs e)
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     fun.LlenarCombo(cmb_CodMarca, "Marca", "Nombre", "CodMarca");
     if (Principal.CodigoPrincipalAbm != null)
     {
         txtCodGrupo.Text = Principal.CodigoPrincipalAbm.ToString();
         Buscar();
     }
 }
コード例 #11
0
        private void btnAgregarCosto_Click(object sender, EventArgs e)
        {
            if (txtCodStock.Text == "")
            {
                MessageBox.Show("Debe ingresar un vehículo para continuar", Clases.cMensaje.Mensaje());
                return;
            }
            Clases.cFunciones fun = new Clases.cFunciones();
            if (txtCodAuto.Text == "")
            {
                MessageBox.Show("Debe ingresar un auto válido", Clases.cMensaje.Mensaje());
                return;
            }
            if (txtFecha.Text == "")
            {
                MessageBox.Show("Debe ingresar una fecha para continuar.", Clases.cMensaje.Mensaje());
                return;
            }

            if (fun.ValidarFecha(txtFecha.Text) == false)
            {
                MessageBox.Show("La fecha ingresada es incorrecta.", Clases.cMensaje.Mensaje());
                return;
            }


            Double Importe = 0;

            if (txtCosto.Text != "")
            {
                Importe = Convert.ToDouble(txtCosto.Text);
            }
            Int32  CodAuto     = Convert.ToInt32(txtCodAuto.Text);
            string Descripcion = txtDescripcionCosto.Text + ", PATENTE " + txtPatente.Text;
            string Fecha       = txtFecha.Text;
            string Patente     = txtPatente.Text;
            Int32? CodStock    = -1;

            if (txtCodStock.Text != "")
            {
                CodStock = Convert.ToInt32(txtCodStock.Text);
            }

            Clases.cCosto costo = new Clases.cCosto();
            costo.InsertarCosto(CodAuto, Patente, Importe, Fecha, Descripcion.ToUpper(), CodStock);
            CargarCostoxstock(Convert.ToInt32(CodStock));
            DateTime FechaCosto = Convert.ToDateTime(txtFecha.Text);

            Clases.cMovimiento mov = new Clases.cMovimiento();
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, (-1) * (Importe), 0, 0, Importe, 0, FechaCosto, Descripcion.ToUpper());
            txtCosto.Text            = "";
            txtDescripcionCosto.Text = "";
            txtCodCosto.Text         = "";
            // Clases.cGrilla.FormatoColumnasMiles(Grilla, "Importe");
        }
コード例 #12
0
 private void FrmCobroPrenda_Load(object sender, EventArgs e)
 {
     if (Principal.CodigoPrincipalAbm != null)
     {
         Clases.cFunciones fun = new Clases.cFunciones();
         fun.LlenarCombo(CmbBanco, "Banco", "Nombre", "CodBanco");
         Int32 CodPrenda = Convert.ToInt32(Principal.CodigoPrincipalAbm);
         GetPrendaxCod(CodPrenda);
         BuscarCheques(CodPrenda);
     }
 }
コード例 #13
0
        private void CargarGrilla()
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                MessageBox.Show("Fecha desde incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                MessageBox.Show("Fecha hasta incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (Convert.ToDateTime(txtFechaDesde.Text) > Convert.ToDateTime(txtFechaHasta.Text))
            {
                MessageBox.Show("La fecha desde debe ser inferior a la fecha hasta", Clases.cMensaje.Mensaje());
                return;
            }

            int soloImpago = 0;

            if (chkImpagos.Checked)
            {
                soloImpago = 1;
            }
            string Nombre = txtNombre.Text;

            Clases.cPrestamo prestamo   = new Clases.cPrestamo();
            DateTime         FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime         FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            DataTable        tb         = prestamo.GetPrestamosxFecha(FechaDesde, FechaHasta, Nombre, soloImpago);

            tb            = fun.TablaaMiles(tb, "Importe");
            tb            = fun.TablaaMiles(tb, "ImporteaPagar");
            txtTotal.Text = fun.TotalizarColumna(tb, "Importe").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            Grilla.DataSource            = tb;
            Grilla.Columns[1].Width      = 290;
            Grilla.Columns[2].Width      = 170;
            Grilla.Columns[5].HeaderText = "Fecha";
            Grilla.Columns[5].Width      = 100;
            Grilla.Columns[7].HeaderText = "Importe a pagar";
            Grilla.Columns[7].Width      = 140;
            Grilla.Columns[8].HeaderText = "Fecha Pago";
            Grilla.Columns[8].Width      = 130;
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[4].Visible    = false;
        }
コード例 #14
0
 private void InicializarComponentes()
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     fun.LlenarCombo(cmbDocumento, "TipoDocumento", "Nombre", "CodTipoDoc");
     if (cmbDocumento.Items.Count > 0)
     {
         cmbDocumento.SelectedIndex = 1;
     }
     fun.LlenarCombo(CmbBarrio, "Barrio", "Nombre", "CodBarrio");
     PintarFormulario();
 }
コード例 #15
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (GrillaCheques.CurrentRow == null)
            {
                MessageBox.Show("Debe seleccionar una cheque para continuar", Clases.cMensaje.Mensaje());
                return;
            }

            DataTable tbCheques = new DataTable();

            tbCheques.Columns.Add("NroCheque");
            tbCheques.Columns.Add("Importe");
            tbCheques.Columns.Add("FechaVencimiento");
            tbCheques.Columns.Add("CodBanco");
            tbCheques.Columns.Add("Banco");
            int i = 0;

            for (i = 0; i < GrillaCheques.Rows.Count - 1; i++)
            {
                string  Cheque           = GrillaCheques.Rows[i].Cells[0].Value.ToString();
                string  Importe          = GrillaCheques.Rows[i].Cells[1].Value.ToString();
                string  FechaVencimiento = GrillaCheques.Rows[i].Cells[2].Value.ToString();
                string  CodBanco         = GrillaCheques.Rows[i].Cells[3].Value.ToString();
                string  sBanco           = GrillaCheques.Rows[i].Cells[4].Value.ToString();
                DataRow r = tbCheques.NewRow();
                r[0] = Cheque;
                r[1] = Importe;
                r[2] = FechaVencimiento;
                r[3] = CodBanco;
                tbCheques.Rows.Add(r);
            }

            string ChequeaBorrar = GrillaCheques.CurrentRow.Cells[0].Value.ToString();

            for (i = 0; i < tbCheques.Rows.Count; i++)
            {
                if (tbCheques.Rows[i]["NroCheque"].ToString() == ChequeaBorrar)
                {
                    tbCheques.Rows[i].Delete();
                    tbCheques.AcceptChanges();
                    i = tbCheques.Rows.Count;
                }
            }
            Clases.cFunciones fun = new Clases.cFunciones();
            GrillaCheques.DataSource = tbCheques;
            double TotalCheques = 0;

            for (i = 0; i < tbCheques.Rows.Count; i++)
            {
                TotalCheques = TotalCheques + fun.ToDouble(tbCheques.Rows[i][1].ToString());
            }
            txtTotalCheque.Text = TotalCheques.ToString();
            CalcularDiferencias();
        }
コード例 #16
0
 private void InicializarComponentes()
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     fun.LlenarCombo(cmb_CodTipoDoc, "TipoDocumento", "Nombre", "CodTipoDoc");
     if (cmb_CodTipoDoc.Items.Count > 0)
     {
         cmb_CodTipoDoc.SelectedIndex = 1;
     }
     cmb_CodTipoDoc.Enabled = false;
     fun.LlenarCombo(cmb_CodBarrio, "Barrio", "Nombre", "CodBarrio");
 }
コード例 #17
0
 private void FrmAbmAuto_Load(object sender, EventArgs e)
 {
     Botonera(1);
     Grupo.Enabled = false;
     Clases.cFunciones fun = new Clases.cFunciones();
     fun.LlenarCombo(cmb_CodMarca, "Marca", "Nombre", "CodMarca");
     fun.LlenarCombo(cmbProvincia, "Provincia", "Nombre", "CodProvincia");
     fun.LlenarCombo(cmb_CodTipoCombustible, "TipoCombustible", "Nombre", "Codigo");
     fun.LlenarCombo(cmb_CodTipoUtilitario, "TipoUtilitario", "Nombre", "CodTipo");
     fun.LlenarCombo(cmb_CodSucursal, "Sucursal", "Nombre", "CodSucursal");
 }
コード例 #18
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (txtMontoModificar.Text == "")
            {
                MessageBox.Show("Debe ingresar un monto para continuar ", Clases.cMensaje.Mensaje());
                return;
            }

            Int32    CodPrestamo        = Convert.ToInt32(Principal.CodigoPrincipalAbm);
            DateTime Fecha              = Convert.ToDateTime(txtFechaPago.Text);
            double   Importe            = fun.ToDouble(txtMontoModificar.Text);
            string   DescripcionDetalle = "INGRESO PRESTAMO " + Importe.ToString().Replace(",", ".");
            double   MontoAnterio       = fun.ToDouble(txtImporte.Text);
            double   MontoModificar     = fun.ToDouble(txtMontoModificar.Text);

            if (CmbOpciones.SelectedIndex == 0)
            {
                DescripcionDetalle = "AGREGAR CAPITAL " + Importe.ToString();
            }
            else
            {
                MontoModificar     = -1 * MontoModificar;
                DescripcionDetalle = "DESCUENTO DE CAPITAL " + Importe.ToString();
            }
            txtImporte.Text = (fun.ToDouble(txtImporte.Text) + fun.ToDouble(MontoModificar.ToString())).ToString();
            txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
            CalcularPorcentaje();

            Clases.cDetallePrestamo detalle = new Clases.cDetallePrestamo();
            detalle.InsertarDetallePrestamo(CodPrestamo, Importe, DescripcionDetalle, Fecha);
            //cargo el nuevo porcentaje
            double   Por              = Convert.ToDouble(txtPorcentaje.Text.Replace(".", ","));
            double   MontoFinal       = fun.ToDouble(txtImporte.Text);
            double   ImporteaPagar    = fun.ToDouble(txtMontoApagar.Text);
            DateTime FechaVencimiento = Convert.ToDateTime(txtFechaVencimiento.Text);

            Clases.cPrestamo prestamo = new Clases.cPrestamo();
            prestamo.ModificarPorcentajePrestamo(CodPrestamo, Por, ImporteaPagar, Fecha, MontoFinal);
            CargarDetalle(CodPrestamo);
            string DescripcionMovimiento = "";

            if (MontoModificar > 0)
            {
                DescripcionMovimiento = " INGRESO PRESTAMO " + txtNombre.Text;
            }
            else
            {
                DescripcionMovimiento = " RETIRO PRESTAMO " + txtNombre.Text;
            }
            Clases.cMovimiento mov = new Clases.cMovimiento();
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, MontoModificar, 0, 0, 0, 0, Fecha, DescripcionMovimiento);
            MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje());
        }
コード例 #19
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtFecha.Text) == false)
            {
                Mensaje("La fecha es incorrecta");
                return;
            }

            if (txtEfectivo.Text == "")
            {
                Mensaje("Debe ingresar un importe");
                return;
            }

            if (cmbConcepto.SelectedIndex == 0)
            {
                if (txtDescripcion.Text == "")
                {
                    Mensaje("Debe ingresar una descripción");
                    return;
                }
            }

            DateTime Fecha         = Convert.ToDateTime(txtFecha.Text);
            double   Importe       = fun.ToDouble(txtEfectivo.Text);
            string   Descripcion   = txtDescripcion.Text;
            Int32?   CodEntidad    = null;
            string   NombreEntidad = "";

            if (cmbConcepto.SelectedIndex > 0)
            {
                CodEntidad = Convert.ToInt32(cmbConcepto.SelectedValue);
                Clases.cEntidad ent = new Clases.cEntidad();
                NombreEntidad = ent.GetNombrexCodigo(Convert.ToInt32(CodEntidad));
            }

            if (NombreEntidad != "")
            {
                Descripcion = NombreEntidad + "," + Descripcion;
            }
            Clases.cGastosNegocio gasto = new Clases.cGastosNegocio();
            gasto.GrabarGastos(Fecha, CodEntidad, Descripcion, Importe);
            Clases.cMovimiento mov = new Clases.cMovimiento();
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion);
            Mensaje("Datos grabados correctamente");
            txtEfectivo.Text    = "";
            txtDescripcion.Text = "";
            txtFecha.Text       = "";
            if (cmbConcepto.Items.Count > 1)
            {
                cmbConcepto.SelectedIndex = 0;
            }
        }
コード例 #20
0
        private void CargarPlandeCuotas(Int32 CodVenta)
        {
            Clases.cFunciones fun   = new Clases.cFunciones();
            Clases.cCuota     cuota = new Clases.cCuota();
            DataTable         trdo  = cuota.GetCuotasxCodVenta(CodVenta);

            trdo = fun.TablaaMiles(trdo, "Importe");
            trdo = fun.TablaaMiles(trdo, "ImportePagado");
            trdo = fun.TablaaMiles(trdo, "Saldo");
            GrillaCuotas.DataSource = trdo;
        }
コード例 #21
0
        private void FrmSaldoCuotas_Load(object sender, EventArgs e)
        {
            Clases.cFunciones  fun   = new Clases.cFunciones();
            Clases.cSaldoCuota saldo = new Clases.cSaldoCuota();
            DataTable          trdo  = saldo.GetSaldoCobranza(Convert.ToInt32(Principal.CodigoPrincipalAbm));

            trdo = fun.TablaaMiles(trdo, "Importe");
            Grilla.DataSource         = trdo;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[1].Visible = false;
        }
コード例 #22
0
ファイル: FrmGastos.cs プロジェクト: pablomartinzabala2/AG
        private void CargarGrilla()
        {
            Clases.cGasto gasto  = new Clases.cGasto();
            DataTable     tresul = gasto.GetGastosxCodStock(Convert.ToInt32(txtCodStock.Text));

            Clases.cFunciones fun = new Clases.cFunciones();
            tresul                    = fun.TablaaMiles(tresul, "Importe");
            Grilla.DataSource         = tresul;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[1].Width   = 480;
        }
コード例 #23
0
        private void Cargar(Int32 CodCheque)
        {
            Clases.cFunciones     fun    = new Clases.cFunciones();
            Clases.cChequesaPagar cheque = new Clases.cChequesaPagar();
            DataTable             trdo   = cheque.GetChequesPagarxCodigo(CodCheque);

            if (trdo.Rows.Count > 0)
            {
                txtNroCheque.Text = trdo.Rows[0]["NroCheque"].ToString();
                txtImporte.Text   = trdo.Rows[0]["Importe"].ToString();
                txtCliente.Text   = trdo.Rows[0]["Nombre"].ToString();
                txtCliente.Text   = txtCliente.Text + " " + trdo.Rows[0]["Apellido"].ToString();
                txtPatente.Text   = trdo.Rows[0]["Patente"].ToString();
                txtSaldo.Text     = trdo.Rows[0]["Saldo"].ToString();
                if (trdo.Rows[0]["FechaPago"].ToString() != "")
                {
                    DateTime Fecha = Convert.ToDateTime(trdo.Rows[0]["FechaPago"].ToString());
                    txtFecha.Text = Fecha.ToShortDateString();
                }

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

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

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

                if (txtSaldo.Text == "0")
                {
                    btnGrabar.Enabled = false;
                }
            }

            Clases.cPagoCheque pago   = new Clases.cPagoCheque();
            DataTable          tresul = pago.GetPagosCheques(CodCheque);

            tresul            = fun.TablaaMiles(tresul, "Importe");
            Grilla.DataSource = tresul;
            // Grilla.Columns[0].Visible = false;
            //  Grilla.Columns[1].Visible = false;
            Grilla.Columns[2].Width = 280;
        }
コード例 #24
0
        private void GetPunitorio(Int32 CodGrupo, Int32 Cuota)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            Clases.cPunitorioCuotasAnteriores puni = new Clases.cPunitorioCuotasAnteriores();
            Double Importe = puni.GetImportePunitorio(CodGrupo, Cuota);

            txtPunitorio.Text = Importe.ToString();
            if (txtPunitorio.Text != "")
            {
                txtPunitorio.Text = fun.FormatoEnteroMiles(txtPunitorio.Text);
            }
        }
コード例 #25
0
 private void btnNuevo_Click_1(object sender, EventArgs e)
 {
     Botonera(2);
     Clases.cFunciones fun = new Clases.cFunciones();
     fun.LimpiarGenerico(this);
     txtCodAuto.Text = "";
     Grupo.Enabled   = true;
     if (cmb_CodMarca.Items.Count > 0)
     {
         cmb_CodMarca.SelectedIndex = 1;
     }
 }
コード例 #26
0
ファイル: cGrilla.cs プロジェクト: pablomartinzabala2/AG
        public static void FormatoColumnasMiles(DataGridView Grilla, string Columna)
        {
            cFunciones fun   = new cFunciones();
            string     Valor = "";

            for (int i = 0; i < Grilla.Rows.Count - 1; i++)
            {
                Valor = Grilla.Rows[i].Cells[Columna].Value.ToString();
                Valor = fun.ParteEntera(Valor);
                Grilla.Rows[i].Cells[Columna].Value = fun.FormatoEnteroMiles(Valor);
            }
        }
コード例 #27
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            //arreglar que no graba el cod cliente en cobranza
            //en eo form de venta

            Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                MessageBox.Show("Fecha desde incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                MessageBox.Show("Fecha hasta incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (Convert.ToDateTime(txtFechaDesde.Text) > Convert.ToDateTime(txtFechaHasta.Text))
            {
                MessageBox.Show("La fecha desde debe ser inferior a la fecha hasta", Clases.cMensaje.Mensaje());
                return;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            Int32    SoloImpago = 0;

            if (chkImpago.Checked == true)
            {
                SoloImpago = 1;
            }
            Clases.cCobranza cob  = new Clases.cCobranza();
            DataTable        trdo = cob.GetCobranzaxFecha(FechaDesde, FechaHasta, txtPatente.Text, txtApellido.Text, SoloImpago);

            trdo          = fun.TablaaMiles(trdo, "Saldo");
            txtTotal.Text = fun.TotalizarColumna(trdo, "Saldo").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            trdo = fun.TablaaMiles(trdo, "Importe");
            Grilla.DataSource            = trdo;
            Grilla.Columns[4].HeaderText = "Fecha Pago";
            Grilla.Columns[6].HeaderText = "Fecha Comp.";
            Grilla.Columns[1].Width      = 150;
            Grilla.Columns[2].Width      = 200;
            Grilla.Columns[4].Width      = 120;
            Grilla.Columns[5].Width      = 120;
            Grilla.Columns[6].Width      = 158;
        }
コード例 #28
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                MessageBox.Show("Fecha desde incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                MessageBox.Show("Fecha hasta incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (Convert.ToDateTime(txtFechaDesde.Text) > Convert.ToDateTime(txtFechaHasta.Text))
            {
                MessageBox.Show("La fecha desde debe ser inferior a la fecha hasta", Clases.cMensaje.Mensaje());
                return;
            }

            int Impagos = 0;

            if (chkImpagos.Checked == true)
            {
                Impagos = 1;
            }

            Clases.cPrenda prenda     = new Clases.cPrenda();
            DateTime       FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime       FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            DataTable      trdo       = prenda.GetPrendasxFecha(FechaDesde, FechaHasta, Impagos, txtPatente.Text, txtApellido.Text);

            txtTotal.Text = fun.TotalizarColumna(trdo, "Importe").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            trdo = fun.TablaaMiles(trdo, "Importe");
            trdo = fun.TablaaMiles(trdo, "ImportePagado");
            trdo = fun.TablaaMiles(trdo, "Diferencia");
            Grilla.DataSource            = trdo;
            Grilla.Columns[1].HeaderText = "Descripción";
            Grilla.Columns[1].Width      = 150;
            Grilla.Columns[2].Width      = 350;
            Grilla.Columns[5].HeaderText = "Fecha Pago";
            Grilla.Columns[5].Width      = 140;
            Grilla.Columns[6].Visible    = false;
            Grilla.Columns[7].HeaderText = "Pagado";
            Grilla.Columns[8].HeaderText = "Diferencia";
        }
コード例 #29
0
        private void AgregarGastoRecepcion(string Codigo, string Descripcion, string Importe, string Tipo)
        {
            /*  for (int i = 0; i < GrillaGastosRecepcion.Rows.Count - 1; i++)
             * {
             *    if (GrillaGastosRecepcion.Rows[i].Cells[0].Value.ToString() == Codigo.ToString() && GrillaGastos.Rows[i].Cells[2].Value.ToString() == Tipo)
             *    {
             *        MessageBox.Show("Ya se ha ingresado el gasto", Clases.cMensaje.Mensaje());
             *        return;
             *    }
             * }
             */
            DataTable tListado = new DataTable();

            tListado.Columns.Add("Codigo");
            tListado.Columns.Add("Descripcion");
            tListado.Columns.Add("Tipo");
            tListado.Columns.Add("Importe");
            tListado.Columns.Add("Fecha");
            for (int i = 0; i < GrillaGastosRecepcion.Rows.Count - 1; i++)
            {
                string  sCodigo      = GrillaGastosRecepcion.Rows[i].Cells[0].Value.ToString();
                string  sDescripcion = GrillaGastosRecepcion.Rows[i].Cells[1].Value.ToString();
                string  sTipo        = GrillaGastosRecepcion.Rows[i].Cells[2].Value.ToString();
                string  sImporte     = GrillaGastosRecepcion.Rows[i].Cells[3].Value.ToString();
                string  sFecha       = GrillaGastosRecepcion.Rows[i].Cells[4].Value.ToString();
                DataRow r;
                r    = tListado.NewRow();
                r[0] = sCodigo;
                r[1] = sDescripcion;
                r[2] = sTipo;
                r[3] = sImporte;
                r[4] = sFecha;
                tListado.Rows.Add(r);
            }
            DataRow r1;

            r1    = tListado.NewRow();
            r1[0] = Codigo;
            r1[1] = Descripcion;
            r1[2] = Tipo;
            r1[3] = Importe;
            r1[4] = txtFecha.Text;
            tListado.Rows.Add(r1);
            GrillaGastosRecepcion.DataSource = tListado;
            Clases.cFunciones fun = new Clases.cFunciones();
            GrillaGastosRecepcion.Columns[0].Visible = false;
            GrillaGastosRecepcion.Columns[2].Visible = false;

            txtImporteGastoRecepcion.Text               = "";
            GrillaGastosRecepcion.Columns[1].Width      = 450;
            GrillaGastosRecepcion.Columns[1].HeaderText = "Descripción";
        }
コード例 #30
0
        private void GrillaCuotas_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string Cuota         = GrillaCuotas.CurrentRow.Cells[1].Value.ToString();
            string Importe       = GrillaCuotas.CurrentRow.Cells[3].Value.ToString();
            string ImportePagado = GrillaCuotas.CurrentRow.Cells[5].Value.ToString();
            string Fecha         = GrillaCuotas.CurrentRow.Cells[2].Value.ToString();
            string CodGrupo      = GrillaCuotas.CurrentRow.Cells[0].Value.ToString();

            GetPunitorio(Convert.ToInt32(CodGrupo), Convert.ToInt32(Cuota));
            Clases.cFunciones fun = new Clases.cFunciones();

            if (Cuota != "")
            {
                txtCuota.Text         = Cuota;
                txtImporte.Text       = Importe;
                txtImportePagado.Text = ImportePagado;
                txtFecha.Text         = Fecha;
                if (txtImporte.Text != "")
                {
                    //string xx = trdo.Rows[0]["Importe"].ToString().Replace (",",".").ToString();
                    txtImporte.Text  = fun.TransformarEntero(Importe);
                    txtImporte.Text  = fun.FormatoEnteroMiles(txtImporte.Text);
                    txtCodGrupo.Text = CodGrupo.ToString();
                    if (txtImportePagado.Text != "")
                    {
                        btnAnular.Enabled     = true;
                        btnPagarSaldo.Visible = true;
                        // txtImportePagado.ReadOnly = true;
                        btnGrabar.Enabled     = false;
                        txtImportePagado.Text = fun.TransformarEntero(txtImportePagado.Text);
                        txtImportePagado.Text = fun.FormatoEnteroMiles(txtImportePagado.Text);
                        txtSaldo.Text         = (fun.ToDouble(txtImporte.Text) - fun.ToDouble(txtImportePagado.Text)).ToString();
                    }
                    else
                    {
                        btnPagarSaldo.Visible = false;
                        txtSaldo.Text         = "";
                        btnAnular.Enabled     = false;
                        btnGrabar.Enabled     = true;
                        // txtImportePagado.ReadOnly = false;
                    }
                }
                //obtengo la deuda total
                Clases.cCuotasAnteriores objCuota = new Clases.cCuotasAnteriores();
                txtTotalDeuda.Text = objCuota.GetSaldoDeudaCuotas(Convert.ToInt32(CodGrupo)).ToString();
                if (txtTotalDeuda.Text != "")
                {
                    txtTotalDeuda.Text = fun.TransformarEntero(txtTotalDeuda.Text);
                    txtTotalDeuda.Text = fun.FormatoEnteroMiles(txtTotalDeuda.Text);
                }
            }
        }