public ActionResult GetAllLearns() { short?type = short.Parse(Request["type"] ?? "1"); int size = short.Parse(Request["size"] ?? "14"); var data = StudyOnlineService.GetEntity(u => u.DelFlag == true && u.Status == type).OrderByDescending(u => u.RegTime).Take(size).Select(u => new { u.ID, u.Name }).ToList(); return(Json(data)); }
public ActionResult ClickZan1(int id = 0) { var entity = StudyOnlineService.GetEntity(u => u.ID == id).FirstOrDefault(); var count = entity.Count; entity.Count = ++count; StudyOnlineService.Update(entity); return(Json(new { status = 1, msg = "成功" })); }
public ActionResult GetStudyItems() { int StudyOnlineID = int.Parse(Request["key"] ?? "0"); int pageSize = int.Parse(Request["rows"] ?? "10"); int pageIndex = int.Parse(Request["page"] ?? "1"); var dd = StudyOnlineService.GetEntity(u => u.ID == StudyOnlineID).FirstOrDefault(); var temp = StudyItemService.GetEntity(u => u.DelFlag == true && u.StudyOnlineID == StudyOnlineID); var list = temp.OrderByDescending(t => t.RegTime).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList(); var data = list.Select(d => new { d.ID, d.Context, d.RegTime, d.UserInfo.Icon, d.UserInfoID }).ToList(); var count = Convert.ToInt32(Math.Ceiling((double)temp.Count() / pageSize)); var str = HNCJ.DY.Common.PageBar.GetPageBar(pageIndex, count, "talk", StudyOnlineID); return(Json(new { datas = data, str = str, Title = dd.Name, Content = dd.Content }, JsonRequestBehavior.AllowGet)); }