Beispiel #1
0
        public ActionResult List()
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var vm = new Models.ExamType.List();
                var tb = from p in db.Table <Exam.Entity.tbExamType>()
                         select p;

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

                vm.ExamTypeList = (from p in tb
                                   orderby p.No, p.ExamTypeName
                                   select p).ToList();
                return(View(vm));
            }
        }
Beispiel #2
0
 public ActionResult List(Models.ExamType.List vm)
 {
     return(Code.MvcHelper.Post(null, Url.Action("List", new { searchText = vm.SearchText })));
 }