Exemplo n.º 1
0
        //to get product detail
        public string GetProductDetail(int id)
        {
            Core_Products result = ent.Core_Products.Where(x => x.ProductId == id).FirstOrDefault();

            LedgerMasterModel model = new LedgerMasterModel();

            model.ProductId   = result.ProductId;
            model.ProductName = result.ProductName;

            return(model.ProductName);
        }
Exemplo n.º 2
0
        public IEnumerable <Core_Products> GetProducts(int AgentId)
        {
            var result = ent.Core_AgentProducts.Where(x => x.AgentId == AgentId);
            List <Core_Products> model = new List <Core_Products>();

            foreach (var item in result)
            {
                Core_Products obj = new Core_Products
                {
                    ProductName = ent.Core_Products.Where(x => x.ProductId == item.ProductId).Where(x => x.isActive == true).Select(x => x.ProductName).FirstOrDefault(),
                    ProductId   = item.ProductId
                };
                model.Add(obj);
            }
            return(model.AsEnumerable());
        }