public JsonResult ReplyTopic(string content, int topicId) { try { var reply = new GroupTopicReply { IsDelete = 0, IsHide = 0, ReplyContent = content, TopicId = topicId, ReplyTime = DateTime.Now, UserId = CurrentUser.UserId }; _groupService.AddReply(reply); #region 积分 IntegrationManager.Instence.FireIntegrationEvent(IntegrationEvents.TopicReply, CurrentUser.UserId, CurrentTenant.TenantId); #endregion return(Json(new { result = 1, content = RetechWing.LanguageResources.Learning.huifuchenggong }, JsonRequestBehavior.AllowGet)); } catch { return(Json(new { result = 0, content = RetechWing.LanguageResources.Learning.huifushibai }, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 增加一条数据 /// </summary> public int AddReply(GroupTopicReply model) { model.OrderNum = (int)_dataAccess.ExecuteScalar("select count(0) + 1 from Int_GroupTopicReply where topicId = " + model.TopicId); model.ReplyId = _dataAccess.AddEntity(model); _dataAccess.ExecuteSql("update Int_GroupTopic set ReplyCount = ReplyCount + 1 where TopicId = " + model.TopicId); return(model.ReplyId); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(GroupTopicReply model) { model.OrderNum = _dataAccess.GetListBySql <int>("select count(0) + 1 from Int_GroupTopicReply where topicId = " + model.TopicId).FirstOrDefault(); model.ReplyId = _dataAccess.AddEntity(model); _dataAccess.ExecuteSql("update Int_GroupTopic set ReplyCount = ReplyCount + 1 where TopicId = " + model.TopicId); return(model.ReplyId); }
public ActionResult DeleteReply(int id) { YSWL.MALL.BLL.SNS.GroupTopicReply replyBll = new GroupTopicReply(); if (replyBll.Delete(id)) { return(Content("ok")); } return(Content("no")); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(GroupTopicReply model) { return(_dataAccess.UpdateEntity(model) > 0); }