Ejemplo n.º 1
0
        public IQueryable SP_XML_Prueba(string xml_cadena)
        {
            contexto = new PetsJCEntities();
            var info = (from spXML2 in contexto.sp_xml2(xml_cadena) select spXML2).ToList();

            return(info.AsQueryable());
        }
Ejemplo n.º 2
0
        public IQueryable sp_anularfacturas(string factura)
        {
            int idFac = Convert.ToInt32(factura);

            contexto = new PetsJCEntities();
            var info = (from sp6 in contexto.sp_anularfac(idFac) select sp6).ToList();

            return(info.AsQueryable());
        }//fin de Sp_AnularFactura
Ejemplo n.º 3
0
        public IQueryable Informe5(string factura)
        {
            int idFac = Convert.ToInt32(factura);

            contexto = new PetsJCEntities();
            var listado5 = (from sp5 in contexto.sp_informe5(idFac) select sp5).ToList();

            return(listado5.AsQueryable());
        }
Ejemplo n.º 4
0
        public IQueryable ProcedimientoTabla(string usuario)
        {
            int idUsuario = Convert.ToInt32(usuario);

            contexto = new PetsJCEntities();
            var listado = (from sp in contexto.sp_Logueo(idUsuario) select sp).ToList();

            return(listado.AsQueryable());
        }
Ejemplo n.º 5
0
        public IQueryable Informe3(string factura)
        {
            DateTime fecha1 = Convert.ToDateTime(factura);
            DateTime fecha2 = Convert.ToDateTime(factura);

            contexto = new PetsJCEntities();
            var listado3 = (from sp3 in contexto.sp_informe3(fecha1, fecha2) select sp3).ToList();

            return(listado3.AsQueryable());
        }
Ejemplo n.º 6
0
        }//fin de Editar

        public IQueryable <T> ListarTodo()
        {
            IQueryable <T> respuesta;

            using (contexto = new PetsJCEntities())
            {
                respuesta = contexto.Set <T>().ToList().AsQueryable();
            } //fin del using
            return(respuesta);
        }     //fin del listar todo
Ejemplo n.º 7
0
        }     //fin del listar todo

        public IQueryable <T> ListarTodoConFiltro(Expression <Func <T, bool> > filtro)
        {
            IQueryable <T> respuesta;

            using (contexto = new PetsJCEntities())
            {
                DbQuery <T> consulta = contexto.Set <T>();
                respuesta = consulta.Where(filtro).ToList().AsQueryable();
            } //fin del using
            return(respuesta);
        }     //fin del listar todo con filtro
Ejemplo n.º 8
0
        public string Agregar(T NuevaEntidad)
        {
            string mensaje = "";

            if (NuevaEntidad == null)
            {
                mensaje = "Error: Datos vacios";
            }
            else
            {
                using (contexto = new PetsJCEntities())
                {
                    var dbset = contexto.Set <T>();
                    dbset.Add(NuevaEntidad);
                    contexto.SaveChanges();
                }
                mensaje = "Se ha grabado un nuevo registro";
            }
            return(mensaje);
        }
Ejemplo n.º 9
0
        public string Editar(T Entidad)
        {
            string mensaje = "";

            if (Entidad == null)
            {
                mensaje = "Error datos vacios";
            }
            else
            {
                using (contexto = new PetsJCEntities())
                {
                    var dbset = contexto.Set <T>();
                    dbset.Attach(Entidad);
                    contexto.Entry(Entidad).State = EntityState.Modified;
                    contexto.SaveChanges();//guardar cambios
                    mensaje = "Datos actualizados";
                }
            }
            return(mensaje);
        }//fin de Editar