コード例 #1
0
        public ActionResult List()
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var vm = new Models.Survey.List();

                var tb = from p in db.Table <Entity.tbSurvey>()
                         select p;
                if (string.IsNullOrEmpty(vm.SearchText) == false)
                {
                    tb = tb.Where(d => d.SurveyName.Contains(vm.SearchText));
                }

                vm.SurveyList = (from p in tb
                                 orderby p.No descending
                                 select new Dto.Survey.List
                {
                    Id = p.Id,
                    No = p.No,
                    SurveyName = p.SurveyName,
                    FromDate = p.FromDate,
                    ToDate = p.ToDate,
                    IsOpen = p.IsOpen,
                    YearSectionName = p.tbYear.YearName,
                }).ToPageList(vm.Page);
                return(View(vm));
            }
        }
コード例 #2
0
 public ActionResult List(Models.Survey.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
     })));
 }