Esempio n. 1
0
        public ActionResult List()
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var vm = new Models.SysRole.List();
                var tb = from p in db.Table <Sys.Entity.tbSysRole>()
                         select p;

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

                vm.RoleList = (from p in tb
                               orderby p.RoleName
                               select p).ToList();
                return(View(vm));
            }
        }
Esempio n. 2
0
 public ActionResult List(Models.SysRole.List vm)
 {
     return(Code.MvcHelper.Post(null, Url.Action("List", new { searchText = vm.SearchText })));
 }