Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
    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);
    }
Esempio n. 5
0
 public bool RemoveMyComment(string commentID)
 {
     return(IcommentInfo.Delete(commentID));
 }