public static PreCuentasDetalle Buscar(int id)
        {
            PreCuentasDetalle partido  = new PreCuentasDetalle();
            Contexto          contexto = new Contexto();

            try
            {
                partido = contexto.Detalle.Find(id);
                contexto.Dispose();
            }
            catch (Exception)
            {
                throw;
            }
            return(partido);
        }
        public static bool Guardar(PreCuentasDetalle preCuentasDetalle)
        {
            bool     paso     = false;
            Contexto contexto = new Contexto();

            try
            {
                if (contexto.Detalle.Add(preCuentasDetalle) != null)
                {
                    contexto.SaveChanges();
                    contexto.Dispose();
                    paso = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(paso);
        }
        public static bool Modificar(PreCuentasDetalle preCuentasDetalle)
        {
            bool     paso     = false;
            Contexto contexto = new Contexto();

            try
            {
                contexto.Entry(preCuentasDetalle).State = EntityState.Modified;
                if (contexto.SaveChanges() > 0)
                {
                    contexto.Dispose();
                    paso = true;
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(paso);
        }