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

                if (string.IsNullOrEmpty(vm.SearchText) == false)
                {
                    tb = tb.Where(d => d.tbStudent.StudentCode.Contains(vm.SearchText) || d.tbStudent.StudentName.Contains(vm.SearchText));
                }
                vm.PerformTotalList = (from p in tb
                                       orderby p.No
                                       select new Dto.PerformTotal.List
                {
                    Id = p.Id,
                    No = p.No,
                    PerformName = p.tbPerform.PerformName,
                    CourseName = p.tbCourse.CourseName,
                    PerformId = p.tbPerform.Id,
                    CourseId = p.tbCourse.Id,
                    TotalScore = p.TotalScore
                }).ToList();
                return(View(vm));
            }
        }
Ejemplo n.º 2
0
 public ActionResult List(Models.PerformTotal.List vm)
 {
     return(Code.MvcHelper.Post(null, Url.Action("List", new { searchText = vm.SearchText })));
 }