Exemplo n.º 1
0
        //
        // GET: /Cms/Oddments/

        public ActionResult Index(OddmentsRequest requset)
        {
            var model = new Oddments();
            this.RenderMyViewData(model);
            var ProjectBasedataIDList = this.ProjectService.GetProjectBasedataList(new ProjectRequest());
            this.ViewBag.ProjectBasedataID = new SelectList(ProjectBasedataIDList, "ID", "PName");
            var result = this.ProjectService.GetOddmentsList(requset);
            return View(result);
        }
Exemplo n.º 2
0
        //
        // GET: /Cms/Oddments/

        public ActionResult Index(OddmentsRequest requset)
        {
            var result = this.ProjectService.GetOddmentsList(requset);
            return View(result);
        }
Exemplo n.º 3
0
        public IEnumerable<Oddments> GetOddmentsList(OddmentsRequest request = null)
        {
            request = request ?? new OddmentsRequest();
            using (var dbContext = new ProjectDbContext())
            {
                IQueryable<Oddments> oddments = dbContext.Oddments;


                if (!string.IsNullOrEmpty(request.Name))

                    oddments = oddments.Where(u => u.Name.Contains(request.Name));

                //if (!string.IsNullOrEmpty(request.Toolname))
                //    oddments = oddments.Where(u => u.Toolname.Contains(request.Toolname));

                //if (!string.IsNullOrEmpty(request.obb))
                //    oddments = oddments.Where(u => u.obb.Contains(request.obb));

                //if (!string.IsNullOrEmpty(request.Way))
                //    oddments = oddments.Where(u => u.Way.Contains(request.Way));

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