public BoolWithPrimaryKeyView Praise(string publishID) { PraiseInfo tempPraiseInfo = ((PraiseInfoDao)IpraiseInfo).GetUserPraiseInfo(new MyBehaviorView() { PublishID = publishID }); bool operResult = false; string operID = string.Empty; if (tempPraiseInfo == null) {//点赞操作 PraiseInfo praiseInfo = new PraiseInfo() { ID = Guid.NewGuid().ToString(), PublishID = publishID, PraiserID = this.UserID, PraiserName = this.UserName, PraiseTime = DateTime.Now, }; operID = praiseInfo.ID; operResult = IpraiseInfo.Insert(praiseInfo); } else {//取消赞操作 operResult = IpraiseInfo.Delete(tempPraiseInfo.ID); } BoolWithPrimaryKeyView result = new BoolWithPrimaryKeyView() { PrimaryID = operID,//取消赞时为空,点赞时为新增记录ID result = operResult }; return(result); }
public BoolWithPrimaryKeyView Tread(string publishID) { TreadInfo tempThreadInfo = ((TreadInfoDao)ItreadInfo).GetUserTreadInfo(new MyBehaviorView() { PublishID = publishID }); bool operResult = false; string operID = string.Empty; if (tempThreadInfo == null) { TreadInfo treadInfo = new TreadInfo() { ID = Guid.NewGuid().ToString(), PublishID = publishID, TreaderID = this.UserID, TreaderName = this.UserName, TreadTime = DateTime.Now }; operID = treadInfo.ID; operResult = ItreadInfo.Insert(treadInfo); } else { operResult = ItreadInfo.Delete(tempThreadInfo.ID); } BoolWithPrimaryKeyView result = new BoolWithPrimaryKeyView() { PrimaryID = operID, result = operResult }; return(result); }
public BoolWithPrimaryKeyView Collect(string publishID) { CollectInfo tempCollectInfo = ((CollectInfoDao)IcollectInfo).GetUserCollectInfo(new MyBehaviorView() { PublishID = publishID }); bool operResult = false; string operID = string.Empty; if (tempCollectInfo == null) { CollectInfo collectInfo = new CollectInfo() { ID = Guid.NewGuid().ToString(), CollectorID = this.UserID, CollectorName = this.UserName, CollectTime = DateTime.Now, PublishID = publishID, CollectValid = ((int)MiicValidTypeSetting.Valid).ToString() }; operID = collectInfo.ID; operResult = IcollectInfo.Insert(collectInfo); } else { operResult = IcollectInfo.Delete(tempCollectInfo.ID); } BoolWithPrimaryKeyView result = new BoolWithPrimaryKeyView() { PrimaryID = operID, result = operResult }; return(result); }
public BoolWithPrimaryKeyView Report(string publishID) { ReportInfo tempReportInfo = ((ReportInfoDao)IreportInfo).GetUserReportInfo(new MyBehaviorView() { PublishID = publishID }); bool operResult = false; string operID = string.Empty; if (tempReportInfo == null) { ReportInfo reportInfo = new ReportInfo() { ID = Guid.NewGuid().ToString(), PublishID = publishID, ReporterID = this.UserID, ReporterName = this.UserName, ReportTime = DateTime.Now }; operID = reportInfo.ID; operResult = IreportInfo.Insert(reportInfo); } else { operResult = IreportInfo.Delete(tempReportInfo.ID); } BoolWithPrimaryKeyView result = new BoolWithPrimaryKeyView() { PrimaryID = operID, result = operResult }; return(result); }
public bool RemoveMyComment(string commentID) { return(IcommentInfo.Delete(commentID)); }