Ejemplo n.º 1
0
        public IEnumerable<Branch> GetBranchList(BranchRequest request = null)
        {
            request = request ?? new BranchRequest();
            using (var dbContext = new OADbContext())
            {
                IQueryable<Branch> branchs = dbContext.Branchs;

                if (!string.IsNullOrEmpty(request.Name))
                    branchs = branchs.Where(u => u.Name.Contains(request.Name));

                return branchs.OrderByDescending(u => u.ID).ToPagedList(request.PageIndex, request.PageSize);
            }
        }
Ejemplo n.º 2
0
        //
        // GET: /OA/Branch/

        public ActionResult Index(BranchRequest request)
        {
            var result = this.OAService.GetBranchList(request);
            return View(result);
        }