Ejemplo n.º 1
0
        public bool ReportComment(int id, User user, string reason)
        {
            if (user != null || reason != null)
            {
                if (mediaRepo.CheckReportedComment(user.ID, this.ID) == 1)
                {
                    return(false);
                }
                else
                {
                    Report report = new Report(reason);
                    this.Reports.Add(report);
                    user.Reports.Add(report);

                    return(mediaRepo.InsertReportComment(user.ID, this.ID, reason));
                }
            }
            else if (user != null || reason != null && id > 0)
            {
                Report report = new Report(id, reason);
                this.Reports.Add(report);
                user.Reports.Add(report);

                return(true);
            }
            return(false);
        }