private void VerificarPagoInteres(Int32 CodPrestamo)
        {
            Clases.cPrestamo prestamo = new Clases.cPrestamo();
            DataTable        trdo     = prestamo.GetPrestamoxCodigo(CodPrestamo);

            if (trdo.Rows.Count > 0)
            {
                if (trdo.Rows[0]["FechaPago"].ToString() != "")
                {
                    btnGrabar.Enabled   = false;
                    btnEliminar.Enabled = false;
                }
            }
        }
        public void GetDatosxPrestamo(Int32 CodPrestamo)
        {
            VerificarPagoInteres(CodPrestamo);
            Clases.cFunciones fun      = new Clases.cFunciones();
            Clases.cPrestamo  prestamo = new Clases.cPrestamo();
            DataTable         trdo     = prestamo.GetPrestamoxCodigo(CodPrestamo);

            if (trdo.Rows.Count > 0)
            {
                txtNombre.Text           = trdo.Rows[0]["Nombre"].ToString();
                txtDireccion.Text        = trdo.Rows[0]["Direccion"].ToString();
                txtFecha.Text            = trdo.Rows[0]["Fecha"].ToString();
                txtPorcentaje.Text       = trdo.Rows[0]["PorcentajeInteres"].ToString();
                txtTelefono.Text         = trdo.Rows[0]["Telefono"].ToString();
                txtFechaVencimiento.Text = trdo.Rows[0]["FechaVencimiento"].ToString();
                txtMontoApagar.Text      = trdo.Rows[0]["ImporteaPagar"].ToString();
                txtImporte.Text          = trdo.Rows[0]["Importe"].ToString();
                if (txtMontoApagar.Text != "")
                {
                    txtMontoApagar.Text = fun.ParteEntera(txtMontoApagar.Text);
                }
                if (txtMontoApagar.Text != "")
                {
                    txtMontoApagar.Text = fun.FormatoEnteroMiles(txtMontoApagar.Text);
                }

                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.ParteEntera(txtImporte.Text);
                }
                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                }
            }
            CargarGrilla(CodPrestamo);
            CargarDetalle(CodPrestamo);
        }