public bool ReportPost(int id, User user, string reason) { if (user != null && reason != null) { if (mediaRepo.CheckReportedPost(user.ID, this.ID) == 1) { return(false); } else { Report report = new Report(reason); this.Reports.Add(report); user.Reports.Add(report); return(mediaRepo.InsertReportPost(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); }