public _Gift GetGiftDetail(long id, long userid, Paging page, CommentEnumType commentEnumType, PriseEnumType priseEnumType, JoinItemTypeEnum joinItemType) { _Gift amodel = GetDetail(id, userid, joinItemType, true); amodel.Comments = CommentBLL.Instance.GetCommentCallBack(id, commentEnumType.GetHashCode(), priseEnumType.GetHashCode(), userid, page); return(amodel); }
/// <summary> /// 添加标签处理 /// </summary> /// <param name="mainId"></param> /// <param name="menuType"></param> /// <param name="tagType"></param> /// <param name="tags"></param> public bool HandleTags(long mainId, CommentEnumType mainType, int tagType, string[] tagArr, SqlTransaction tran = null) { List <string> tagList = new List <string>(); if (tagArr == null || tagArr.Length == 0) { //用户没有选择标签时,由系统自动分配标签(取使用最多的前3个标签) var newList = TagBLL.Instance.GetTop3Tag(tagType, tran); newList.ForEach(tag => tagList.Add(tag.TagId.ToString())); } else { tagList = tagArr.ToList(); } List <MenuBelongTag> list = new List <MenuBelongTag>(); tagList.ForEach(tag => { list.Add(new MenuBelongTag() { MainId = mainId, MainType = mainType.GetHashCode(), TagId = tag.ToInt64() }); }); if (list.Count > 0) { return(SqlHelper.SqlBulkCopyByDatatable("MenuBelongTag", list.ToDataTable <MenuBelongTag>(), tran)); } else { return(true); } }
public bool DeleteTagForMainID(long mainId, CommentEnumType mainType, SqlTransaction tran) { if (dal.HasTagByMainId(mainId, mainType.GetHashCode())) { return(dal.DeleteTagForMainID(mainId, mainType.GetHashCode(), tran)); } else { return(true); } }
public bool RemoveAndAddNew(long mainId, int menuType, CommentEnumType mainType, string[] tags, SqlTransaction tran) { if (DeleteTagForMainID(mainId, mainType, tran)) { if (HandleTags(mainId, mainType, menuType, tags, tran)) { return(true); } } return(false); }
/// <summary> /// 根据用户ID获取评论/回答 /// </summary> /// <param name="userID"></param> /// <param name="answerPage"></param> /// <returns></returns> public MyCommentsViewModel GetCommentListByUserid(long userID, CommentEnumType commentEnumType, Paging answerPage, long currentLoginUserID) { MyCommentsViewModel amodel = new MyCommentsViewModel(); DataSet ds = dal.GetCommentListByUserid(userID, commentEnumType.GetHashCode(), answerPage.StartIndex, answerPage.EndIndex, currentLoginUserID, UserBaseBLL.Instance.IsMaster); DataTable answerdt = ds.Tables[1]; if (answerdt.IsNotNullAndRowCount()) { answerPage.RecordCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]); amodel.CommentPage = answerPage; amodel.CommentList = ModelConvertHelper <_MyComments> .ConvertToList(answerdt); amodel.CommentHeadUrl = ds.Tables[2].Rows[0][0].ToString(); } return(amodel); }