Ejemplo n.º 1
0
 public ActionResult DeleteTalk(int id = 0)
 {
     TopicInfoService.DeleteListByLogical(new List <int> {
         id
     });
     return(Json(new { status = 1, msg = "" }, JsonRequestBehavior.AllowGet));
 }
Ejemplo n.º 2
0
        public ActionResult TalkData1()
        {
            int TopicInfoID = int.Parse(Request["TopID"] ?? "1");
            int pageSize    = int.Parse(Request["rows"] ?? "10");
            int pageIndex   = int.Parse(Request["pageIndex"] ?? "1");
            int sort        = int.Parse(Request["sort"] ?? "0");
            var list        = TopicInfoService.GetEntity(u => u.DelFlag == true && u.TopicInfoID == TopicInfoID).Select(u => new TTData {
                ID = u.ID, Title = u.Title, Content = u.Content, UserName = u.UserInfo.UserName, Count = u.UserInfo1.Count, Icon = u.UserInfo.Icon, RegTime = u.RegTime, Number = u.TopicInfo1.Count, UserID = u.UserInfoID
            }).ToList();
            var data = list;

            if (sort == 1)
            {
                data = data.OrderByDescending(t => t.RegTime).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
            }
            else if (sort == 2)
            {
                data = data.OrderByDescending(t => t.Count).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
            }
            else if (sort == 3)
            {
                data = data.OrderByDescending(t => t.Number).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
            }
            else
            {
                data = data.OrderByDescending(r => r.Count).OrderByDescending(t => t.RegTime).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
            }

            var count = Convert.ToInt32(Math.Ceiling((double)list.Count() / pageSize));
            var str   = HNCJ.DY.Common.PageBar.GetPageBars(pageIndex, count, "add", sort.ToString());
            var str1  = StrToHtml(data);

            return(Json(new { list = data, str = str, str1 = str1 }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        public ActionResult talkhuitie(int id, string content)
        {
            int       UserID = this.LoginUser.ID;
            TopicInfo model  = new TopicInfo();

            model.Content     = content;
            model.DelFlag     = true;
            model.ModfiedTime = DateTime.Now;
            model.RegTime     = DateTime.Now;
            model.Status      = 1;
            model.Title       = "";
            model.Type        = 1;
            model.TopicInfoID = id;
            model.UserInfoID  = UserID;
            TopicInfoService.Add(model);

            return(Json(new { status = 1, msg = "成功" }));
        }