コード例 #1
0
ファイル: Oferta.cs プロジェクト: Ratapan/MisOfertas_ISY3101
        public List <MisOfertas.Datos.Oferta> ListaOferta()
        {
            MisOfertasEntities bd = new MisOfertasEntities();
            var ListaP            = from d in bd.Oferta
                                    select d;



            return(ListaP.ToList());
        }
コード例 #2
0
        public List <MisOfertas.Datos.Producto> ListaProductos()
        {
            MisOfertasEntities bd = new MisOfertasEntities();
            var ListaP            = from d in bd.Producto
                                    select d;



            return(ListaP.ToList());
        }
コード例 #3
0
        public List <MisOfertas.Datos.Producto> ListaFiltrada(int rubro)
        {
            MisOfertasEntities bd = new MisOfertasEntities();
            var filtro            = from d in bd.Producto
                                    where d.Idrubro == rubro
                                    select d;



            return(filtro.ToList());
        }
コード例 #4
0
ファイル: Oferta.cs プロジェクト: Ratapan/MisOfertas_ISY3101
        public List <MisOfertas.Datos.Oferta> ListaFiltrada(int rubro)
        {
            MisOfertasEntities bd = new MisOfertasEntities();
            var filtro            = from a in bd.Oferta
                                    join b in bd.Producto on a.Idproducto equals b.Idproducto
                                    where b.Idrubro == rubro
                                    select a;



            return(filtro.ToList());
        }
コード例 #5
0
ファイル: Oferta.cs プロジェクト: Ratapan/MisOfertas_ISY3101
        public bool validaNuevaOferta(int id)
        {
            MisOfertasEntities bd = new MisOfertasEntities();

            var result = from d in bd.Oferta
                         where d.Fecha_Hasta < DateTime.Today && d.Idproducto == id
                         select d;

            if (result.Count() < 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }