示例#1
0
        public ActionResult Index(InsMachineryCostRequest request)
        {
            var ProjectList = this.ProjectService.GetProjectBasedataList(new ProjectRequest());

            this.ViewBag.ProjectBasedataID = new SelectList(ProjectList, "ID", "PName");

            var result = this.ProjectService.GetInsMachineryCostList(request);

            return(View(result));
        }
示例#2
0
        public IEnumerable <InsMachineryCost> GetInsMachineryCostList(InsMachineryCostRequest request = null)
        {
            request = request ?? new InsMachineryCostRequest();
            using (var dbContext = new ProjectDbContext())
            {
                IQueryable <InsMachineryCost> InsMachineryCost = dbContext.InsMachineryCosts.Include("ProjectBasedata");

                if (request.ProjectBasedataID > 0)
                {
                    InsMachineryCost = InsMachineryCost.Where(d => d.ProjectBasedataID == request.ProjectBasedataID);
                }

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