Ejemplo n.º 1
0
        public IEnumerable<MachineryCost> GetMachineryCostList(MachineryCostRequest request = null)
        {
            request = request ?? new MachineryCostRequest();
            using (var dbContext = new ProjectDbContext())
            {
                IQueryable<MachineryCost> MachineryCost = dbContext.MachineryCosts;

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

                return MachineryCost.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
            }
        }
Ejemplo n.º 2
0
 public ActionResult Index(MachineryCostRequest request)
 {
     var result = this.ProjectService.GetMachineryCostList(request);
     return View(result);
 }