Пример #1
0
 private void CheckReportStatus(Post post, PostLogic postLogic, ReportOracleContext reportContext)
 {
     var allReports = reportContext.GetAllByPost(post);
     if (allReports.Count >= 5) post.Visible = false;
     postLogic.UpdatePost(post);
 }
Пример #2
0
 private void RefreshReportSystem(List<Post> getAllPostByEvent, ReportOracleContext report)
 {
     lbReportsUnder5.Items.Clear();
     lbUnvisiblePosts.Items.Clear();
     lbReportsAbove5.Items.Clear();
     // Under 5 listbox
     foreach (var p in getAllPostByEvent)
     {
         var tempListOfReports = report.GetAllByPost(p);
         if (tempListOfReports.Count >= 1 && tempListOfReports.Count < 5 && p.Visible)
         {
             lbReportsUnder5.Items.Add(p);
         }
     }
     // Invisible listbox
     foreach (var p in getAllPostByEvent)
     {
         if (!p.Visible)
         {
             lbUnvisiblePosts.Items.Add(p);
         }
     }
     // Above 5 lisbox
     foreach (var p in getAllPostByEvent)
     {
         var tempListOfReports = report.GetAllByPost(p);
         if (tempListOfReports.Count >= 5)
         {
             lbReportsAbove5.Items.Add(p);
         }
     }
 }