コード例 #1
0
ファイル: ProjectService.cs プロジェクト: addy002/HaoTang
        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);
            }
        }
コード例 #2
0
 public ActionResult Index(MachineryCostRequest request)
 {
     var result = this.ProjectService.GetMachineryCostList(request);
     return View(result);
 }