コード例 #1
0
        public ActionResult List()
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var vm = new Models.DictHealth.List();
                var tb = from p in db.Table <Dict.Entity.tbDictHealth>()
                         select p;

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

                vm.HealthList = (from p in tb
                                 orderby p.No
                                 select p).ToList();
                return(View(vm));
            }
        }
コード例 #2
0
 public ActionResult List(Models.DictHealth.List vm)
 {
     return(Code.MvcHelper.Post(null, Url.Action("List", new { searchText = vm.SearchText })));
 }