Пример #1
0
        private void btnGrabarEntrega_Click(object sender, EventArgs e)
        {
            if (txtEntregadoa.Text == "")
            {
                Mensaje("Debe ingresar el destinatario del cheque ");
                return;
            }
            string        EntregadoA = txtEntregadoa.Text;
            cChequeCobrar cheque     = new cChequeCobrar();
            Int32         CodCheque  = Convert.ToInt32(Principal.CodigoPrincipalAbm.ToString());

            cheque.GrabarEntregado(CodCheque, EntregadoA);
            Mensaje("Datos grabados correctamente");
        }
        private void btnCobrar_Click(object sender, EventArgs e)
        {
            cFunciones fun = new cFunciones();

            if (Grilla.CurrentRow == null)
            {
                MessageBox.Show("Debe seleccionar un registro para continuar ");
                return;
            }



            if (Grilla.CurrentRow.Cells[5].Value.ToString() != "")
            {
                MessageBox.Show("Ya se ha cobrado el cheque ");
                return;
            }

            //Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtFechaCobro.Text) == false)
            {
                MessageBox.Show("La fecha cobro es incorrecta ", "Sistema");
                return;
            }
            string   Entregado    = Grilla.CurrentRow.Cells[9].Value.ToString();
            DateTime FechaCobro   = Convert.ToDateTime(txtFechaCobro.Text);
            Int32    CodCheque    = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value.ToString());
            Double   Importe      = fun.ToDouble(Grilla.CurrentRow.Cells[4].Value.ToString());
            string   NumeroCheque = Grilla.CurrentRow.Cells[2].Value.ToString();
            string   Descripcion  = "COBRO DE CHEQUE " + NumeroCheque.ToString();

            if (Entregado != "")
            {
                Descripcion = Descripcion + ", " + Entregado;
            }
            cChequeCobrar cheque = new cChequeCobrar();
            cMovimiento   mov    = new cMovimiento();

            cheque.CobroCheque(FechaCobro, CodCheque);
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe,
                                               0, 0, 0, 0, FechaCobro, Descripcion);
            Buscar();
            MessageBox.Show("Datos grabados correctamente ");
        }
Пример #3
0
        private void GetCheque(Int32 CodCheque)
        {
            cChequeCobrar cheque = new cChequeCobrar();
            DataTable     trdo   = cheque.GetChequexCodigo(CodCheque);

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

                Int32? CodBanco = null;
                string Nombre   = "";
                string Apellido = "";
                Double Importe  = 0;
                string Patente  = "";

                if (trdo.Rows[0]["Vencimiento"].ToString() != "")
                {
                    DateTime Vencimiento = Convert.ToDateTime(trdo.Rows[0]["Vencimiento"].ToString());
                    txtVencimiento.Text = Vencimiento.ToShortDateString();
                }
                if (trdo.Rows[0]["CodBanco"].ToString() != "")
                {
                    CodBanco = Convert.ToInt32(trdo.Rows[0]["CodBanco"].ToString());
                }
                Nombre   = trdo.Rows[0]["Nombre"].ToString();
                Apellido = trdo.Rows[0]["Apellido"].ToString();
                Patente  = trdo.Rows[0]["Patente"].ToString();
                Importe  = Convert.ToDouble(trdo.Rows[0]["Importe"].ToString());

                txtNombre.Text     = Nombre;
                txtApellido.Text   = Apellido;
                txtImporte.Text    = Importe.ToString();
                txtFecha.Text      = Fecha.ToShortDateString();
                txtTelefono.Text   = trdo.Rows[0]["Telefono"].ToString();
                txtPatente.Text    = Patente;
                txtEntregadoa.Text = trdo.Rows[0]["EntregadoA"].ToString();
                if (trdo.Rows[0]["CodBanco"].ToString() != "")
                {
                    cmbBanco.SelectedValue = trdo.Rows[0]["CodBanco"].ToString();
                }
                txtNumeroCheque.Text = trdo.Rows[0]["NumeroCheque"].ToString();
            }
        }
        private void Buscar()
        {
            DateTime Desde      = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime Hasta      = Convert.ToDateTime(txtFechaHasta.Text);
            int      SoloImpago = 0;

            if (chkSoloImpago.Checked == true)
            {
                SoloImpago = 1;
            }
            cChequeCobrar cheque = new cChequeCobrar();
            DataTable     trdo   = cheque.GetChequesxFecha(Desde, Hasta, SoloImpago);

            Clases.cFunciones fun = new Clases.cFunciones();
            trdo = fun.TablaaMiles(trdo, "Importe");
            Grilla.DataSource            = trdo;
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[2].HeaderText = "Nro Cheque";
            Grilla.Columns[5].HeaderText = "Fecha Cobro";
            Grilla.Columns[2].Width      = 120;
            Grilla.Columns[3].Width      = 200;
            Grilla.Columns[5].Width      = 120;
            Grilla.Columns[9].Width      = 160;
        }
Пример #5
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            if (txtFecha.Text == "")
            {
                Mensaje("Ingresar fecha");
                return;
            }

            if (txtVencimiento.Text == "")
            {
                Mensaje("Ingresar fecha de vencimiento");
                return;
            }

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

            if (txtNumeroCheque.Text == "")
            {
                Mensaje("Debe ingresar un número de cheque");
                return;
            }

            DateTime Fecha        = Convert.ToDateTime(txtFecha.Text);
            DateTime Vencimiento  = Convert.ToDateTime(txtVencimiento.Text);
            Double   Importe      = Convert.ToDouble(txtImporte.Text);
            string   NumeroCheque = txtNumeroCheque.Text;
            string   Apellido     = txtApellido.Text;
            string   Nombre       = txtNombre.Text;
            string   Patente      = txtPatente.Text;
            Int32?   CodBanco     = null;

            if (cmbBanco.SelectedIndex > 0)
            {
                CodBanco = Convert.ToInt32(cmbBanco.SelectedValue);
            }
            string Telefono    = txtTelefono.Text;
            string Descripcion = "INGRESO DE CHEQUE " + NumeroCheque;

            Descripcion = Descripcion + ", PATENTE: " + txtPatente.Text.ToUpper();
            Descripcion = Descripcion + ". CLIENTE: " + txtApellido.Text.ToUpper();
            cChequeCobrar cheque = new cChequeCobrar();

            cheque.Insertar(Fecha, Vencimiento, Importe,
                            CodBanco, Apellido, Nombre, Patente, Telefono, NumeroCheque);
            Mensaje("Datos grabados correctamente");
            cMovimiento mov = new cMovimiento();

            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado,
                                               -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion);
            txtNumeroCheque.Text = "";
            txtImporte.Text      = "";
            txtVencimiento.Text  = "";
            txtApellido.Text     = "";
            txtNombre.Text       = "";
            txtTelefono.Text     = "";
            txtPatente.Text      = "";
        }