|
@@ -1,5 +1,6 @@
|
|
|
using PP_Ven_MosS.Classes;
|
|
|
using PP_Ven_MosS.ModelBase;
|
|
|
+using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Windows;
|
|
@@ -26,22 +27,33 @@ namespace PP_Ven_MosS.Pages
|
|
|
List<Rectangle> rectangles = new List<Rectangle>();
|
|
|
List<Place> place = Database.entities.Place.ToList();
|
|
|
List<Place_event> plevs = Database.entities.Place_event.ToList();
|
|
|
+
|
|
|
+
|
|
|
+ List<Place> p = Database.entities.Place.Distinct().ToList();
|
|
|
+
|
|
|
int[] mass = new int[plevs.Count];
|
|
|
|
|
|
- foreach (var pl in plevs)
|
|
|
+ foreach (Place pid in p)
|
|
|
{
|
|
|
-
|
|
|
- Rectangle newRectangle = new Rectangle();
|
|
|
- newRectangle.Width = 100;
|
|
|
- for (int i = 0; i < mass.Length; i++)
|
|
|
+ TextBlock textBlock = new TextBlock();
|
|
|
+ textBlock.Text = pid.title_place;
|
|
|
+ diagr.Children.Add(textBlock);
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (Place pid in p)
|
|
|
+ {
|
|
|
+ k = 0;
|
|
|
+ foreach (Place_event pe in plevs)
|
|
|
{
|
|
|
-
|
|
|
- if (pl.id_place == plev.id_place)
|
|
|
- {
|
|
|
- k++;
|
|
|
- }
|
|
|
+ if (pid.id_place == pe.id_place)
|
|
|
+ {
|
|
|
+ k++;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+ Rectangle newRectangle = new Rectangle();
|
|
|
+ newRectangle.Width = 100;
|
|
|
+
|
|
|
+
|
|
|
newRectangle.Height = k * 30;
|
|
|
|
|
|
if (k > 5)
|
|
@@ -61,24 +73,55 @@ namespace PP_Ven_MosS.Pages
|
|
|
diag.Children.Add(newRectangle);
|
|
|
rectangles.Add(newRectangle);
|
|
|
}
|
|
|
+
|
|
|
+ //foreach (var pl in plevs)
|
|
|
+ //{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // Rectangle newRectangle = new Rectangle();
|
|
|
+ // newRectangle.Width = 100;
|
|
|
+
|
|
|
+
|
|
|
+ // newRectangle.Height = k * 30;
|
|
|
+
|
|
|
+ // if (k > 5)
|
|
|
+ // {
|
|
|
+ // newRectangle.Fill = new SolidColorBrush(Colors.Green);
|
|
|
+ // }
|
|
|
+ // else if (k < 2)
|
|
|
+ // {
|
|
|
+ // newRectangle.Fill = new SolidColorBrush(Colors.Red);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // newRectangle.Fill = new SolidColorBrush(Colors.Blue);
|
|
|
+ // }
|
|
|
+ // newRectangle.Margin = new Thickness(20, 0, 0, 0);
|
|
|
+ // newRectangle.VerticalAlignment = VerticalAlignment.Bottom;
|
|
|
+ // diag.Children.Add(newRectangle);
|
|
|
+ // rectangles.Add(newRectangle);
|
|
|
+ //}
|
|
|
|
|
|
|
|
|
- foreach (var pl in place)
|
|
|
- {
|
|
|
- if (pl.id_place == plev.id_place)
|
|
|
- {
|
|
|
- TextBlock block = new TextBlock
|
|
|
- {
|
|
|
- Text = pl.title_place,
|
|
|
- HorizontalAlignment = HorizontalAlignment.Center,
|
|
|
- VerticalAlignment = VerticalAlignment.Bottom,
|
|
|
- Width = 100,
|
|
|
- Margin = new Thickness(20, 250, 0, 0)
|
|
|
- };
|
|
|
- diagr.Children.Add(block);
|
|
|
- }
|
|
|
+ //foreach (var pl in place)
|
|
|
+ //{
|
|
|
+ // if (pl.id_place == plev.id_place)
|
|
|
+ // {
|
|
|
+ // TextBlock block = new TextBlock
|
|
|
+ // {
|
|
|
+ // Text = pl.title_place,
|
|
|
+ // HorizontalAlignment = HorizontalAlignment.Center,
|
|
|
+ // VerticalAlignment = VerticalAlignment.Bottom,
|
|
|
+ // Width = 100,
|
|
|
+ // Margin = new Thickness(20, 250, 0, 0)
|
|
|
+ // };
|
|
|
+ // diagr.Children.Add(block);
|
|
|
+ // }
|
|
|
|
|
|
- }
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|