public ActionResult Index() { var mdl = lessonBLL.Query("imagepath is not null and imagepath <>''", "makeDay desc", 4); if (mdl != null) { return(View(mdl)); } return(View()); }
/// <summary> /// query lessons by clicked 'a'. /// </summary> /// <param name="bindId"></param> /// <param name="pg"></param> /// <param name="ttl"></param> /// <param name="pgsz"></param> /// <returns></returns> public BindingLessonViewModel QueryPagedLessons(Base_DataBind datas, int pg, int pgsz) { Base_DataBindBLL bindBll = new Base_DataBindBLL(); string whr = " schoolid=1"; int ttl = 0; whr += bindBll.ArrayToWhere(datas); var mdl = new BindingLessonViewModel() { TrainBaseLessons = _lessonBLL.Query(whr, pg, out ttl, 10), Pager = Common.Utility.HtmlPager(10, pg, ttl, 5) }; return(mdl); }
public ActionResult Index(Base_DataBind model, int pg = 1) { if (model == null) { return(Json(new { err = "params null" }, JsonRequestBehavior.AllowGet)); } if (model.GenreId == null || model.GradeId == null || model.PeriodId == null || model.SubjectId == null) { return(PartialView()); } string whr = DataBindToWhere(model); int i; var mdl = _lessonBLL.Query(whr, pg, out i, 10); ViewData["pager"] = Common.Utility.HtmlPager(10, pg, i, 5); return(PartialView("lessonTable", mdl)); }