Exemplo n.º 1
0
        public ActionResult List()
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var vm = new Models.Perform.List();
                var tb = from p in db.Table <Perform.Entity.tbPerform>()
                         select p;

                if (string.IsNullOrEmpty(vm.SearchText) == false)
                {
                    tb = tb.Where(d => d.PerformName.Contains(vm.SearchText));
                }

                vm.PerformList = (from p in tb
                                  orderby p.No descending
                                  select new Dto.Perform.List
                {
                    Id = p.Id,
                    No = p.No,
                    IsOpen = p.IsOpen,
                    PerformName = p.PerformName,
                    YearName = p.tbYear.YearName,
                    FromDate = p.FromDate,
                    ToDate = p.ToDate
                }).ToPageList(vm.Page);
                return(View(vm));
            }
        }
Exemplo n.º 2
0
 public ActionResult List(Models.Perform.List vm)
 {
     return(Code.MvcHelper.Post(null, Url.Action("List", new { searchText = vm.SearchText, PageSize = vm.Page.PageSize, PageCount = vm.Page.PageCount, PageIndex = vm.Page.PageIndex })));
 }