public ActionResult Index(MaterialCostRequest request)
 {
     var result = this.ProjectService.GetMaterialCostList(request);
     return View(result);
 }
Exemple #2
0
        public IEnumerable<MaterialCost> GetMaterialCostList(MaterialCostRequest request = null)
        {
            request = request ?? new MaterialCostRequest();
            using (var dbContext = new ProjectDbContext())
            {
                IQueryable<MaterialCost> MaterialCost = dbContext.MaterialCosts;

                if (!string.IsNullOrEmpty(request.ProjectName))
                    MaterialCost = MaterialCost.Where(u => u.ProjectName.Contains(request.ProjectName));

                return MaterialCost.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
            }
        }