public Boolean Guardar8(clsCuentaPorPagar CuentaPorPagar)
        {
            try
            {
                using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
                {
                    CtaXPag = new CuentaPorPagar()
                    {
                        NumCuentaPorPagar = CuentaPorPagar._NumCuentaPorPagar,
                        NumIngresoEgreso = CuentaPorPagar._NumIngresoEgreso,
                        FechaIngreso = CuentaPorPagar._FechaIngreso,
                        NumeroFactura = CuentaPorPagar._Factura,
                        FechaTransaccion = CuentaPorPagar._FechaTransaccion,
                        IdProveedor = CuentaPorPagar._IdProveedor,
                        Motivo = CuentaPorPagar._Motivo,
                        Detalle = CuentaPorPagar._Detalle,
                        Subtotal = CuentaPorPagar._Subtotal,
                        Total = CuentaPorPagar._Total,
                        FormaPago = CuentaPorPagar._FormaPago,
                        IdUsuario = CuentaPorPagar._IdUsuario,
                        IdEmpresa = CuentaPorPagar._IdEmpresa,
                    };
                    ent.AddToCuentaPorPagar(CtaXPag);
                    ent.SaveChanges();

                    GuardarImpuestos(CuentaPorPagar._ImpuestoCuenta);
                }

                return true;

            }
            catch (Exception)
            {
                return false;
            }
        }
        public Boolean Guardar2(clsCuentaPorPagar CuentaPorPagar)
        {
            try
            {
                using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
                {
                    CtaXPag = new CuentaPorPagar()
                    {
                        NumCuentaPorPagar = CuentaPorPagar._NumCuentaPorPagar,
                        FechaIngreso = CuentaPorPagar._FechaIngreso,
                        NumeroFactura = CuentaPorPagar._Factura,
                        FechaTransaccion = CuentaPorPagar._FechaTransaccion,
                        IdEmpresaServicio = CuentaPorPagar._IdEmpresaServicio,
                        Motivo = CuentaPorPagar._Motivo,
                        Detalle = CuentaPorPagar._Detalle,
                        Subtotal = CuentaPorPagar._Subtotal,
                        Total = CuentaPorPagar._Total,
                        FormaPago = CuentaPorPagar._FormaPago,
                        ValorEntrada = CuentaPorPagar._ValorEntrada,
                        NumeroLetra = CuentaPorPagar._NumeroLetra,
                        IdFrecuencia = CuentaPorPagar._IdFrecuencia,
                        ValorLetra = CuentaPorPagar._ValorLetra,
                        SaldoDeuda = CuentaPorPagar._SaldoDeuda,
                        IdUsuario = CuentaPorPagar._IdUsuario,
                        IdEmpresa = CuentaPorPagar._IdEmpresa,
                    };
                    ent.AddToCuentaPorPagar(CtaXPag);
                    ent.SaveChanges();

                    GuardarDetCtaPorPagar(CuentaPorPagar._DetCredito);

                    GuardarImpuestos(CuentaPorPagar._ImpuestoCuenta);
                }

                return true;

            }
            catch (Exception)
            {
                return false;
            }
        }