Esempio n. 1
0
        public Product Single(Guid id)
        {
            Product result = new Product();

            _db.Execute(() =>
            {
                result = _db.Single <Product>(m => m.ID == id);
            });
            result.Count++;
            this.Update(result);
            result.Attr = Product_AttService.GetAttsByPID(id);
            return(result);
        }
Esempio n. 2
0
        public IEnumerable <Product> GetProductByCid(Guid cid)
        {
            IEnumerable <Product> result = new List <Product>();

            _db.Execute(() =>
            {
                result = _db.GetList <Product>(m => m.ClassID == cid && m.DR == false).Where(m => m.IsAudit);
            });
            if (result.Count() > 0)
            {
                result.Each(m =>
                {
                    m.Attr = Product_AttService.GetAttsByPID(m.ID);
                });
            }
            return(result);
        }