public MapArea (MapData ParentParameter, DataRow SourceRow, System.Windows.Point PositionParameter, LogicalAreaType TypeParameter) { Parent = ParentParameter; Position = PositionParameter; Type = TypeParameter; ID = SourceRow ["ID"].ToString (); if (SourceRow.Table.Columns ["OrteID"] != null) OrtsID = SourceRow ["OrteID"].ToString (); ProcessSourceRow (SourceRow); }
public static void DrawSymbol(DrawingContext DC, Point ContentPosition, LogicalAreaType SymbolType, String Text = "", double TargetWidth = 0, double ResizingFactor = 10) { BitmapSource SourceToDraw = null; switch (SymbolType) { case LogicalAreaType.Schule: SourceToDraw = MapDataWrapper.Instance.SchulHaus; break; case LogicalAreaType.Schueler: SourceToDraw = MapDataWrapper.Instance.Schueler; break; case LogicalAreaType.SchuelerM: SourceToDraw = MapDataWrapper.Instance.SchuelerM; break; case LogicalAreaType.SchuelerW: SourceToDraw = MapDataWrapper.Instance.SchuelerW; break; case LogicalAreaType.Wunsch: SourceToDraw = MapDataWrapper.Instance.WunschOrt; break; case LogicalAreaType.Planung: SourceToDraw = MapDataWrapper.Instance.PlanungOrt; break; case LogicalAreaType.Projekt: SourceToDraw = MapDataWrapper.Instance.ProjektOrt; break; case LogicalAreaType.Realisierung: SourceToDraw = MapDataWrapper.Instance.RealisierungsOrt; break; case LogicalAreaType.MissingProjektPicture: SourceToDraw = MapDataWrapper.Instance.MissingProjektBild; break; case LogicalAreaType.Combined: SourceToDraw = MapDataWrapper.Instance.PlanungOrt; break; case LogicalAreaType.CombinedNoPupil: SourceToDraw = MapDataWrapper.Instance.PlanungOrt; break; case LogicalAreaType.DefinedProjectsForRSB: SourceToDraw = MapDataWrapper.Instance.PlanungOrt; break; case LogicalAreaType.OrteWithMoreProjects: SourceToDraw = MapDataWrapper.Instance.RealisierungsOrt; break; case LogicalAreaType.MissingOrtPicture: SourceToDraw = CreateTextAsBitmap(Text); break; case LogicalAreaType.Text: SourceToDraw = CreateTextAsBitmap(Text); break; case LogicalAreaType.Fertig: case LogicalAreaType.Error: Pen pen = new Pen(Brushes.Red, 3); DC.DrawEllipse(null, pen, new Point(ContentPosition.X - 3, ContentPosition.Y - 3), 7, 7); return; break; } //Rect LocationToDraw = new Rect(new Point(ContentPosition.X - SourceToDraw.Width / 2, // ContentPosition.Y - SourceToDraw.Height / 2), // new Size(SourceToDraw.PixelWidth / ResizingFactor, // SourceToDraw.PixelHeight / ResizingFactor)); if (TargetWidth != 0) { ResizingFactor *= (double)MapWrapper.MapBasics.BasicMapWidth / TargetWidth ; } Rect LocationToDraw = new Rect(new Point(ContentPosition.X , ContentPosition.Y - SourceToDraw.Height / 2), new Size(SourceToDraw.PixelWidth / ResizingFactor, SourceToDraw.PixelHeight / ResizingFactor)); DC.DrawImage(SourceToDraw, LocationToDraw); }
private List<Marker> CreateMarkerForOrteWithMoreProjects(Organisation[] SchulListen, LogicalAreaType PhaseToProduce) { List<Marker> Result = new List<Marker>(); Dictionary<int, int> Haeufigkeiten = new Dictionary<int, int>(); int ModuloValue = 5; foreach (Guid OrtsGuid in Data.DbServer3.WordUp.Projekte.CounterProProjektOrt.Keys) { ElementProOrt CounterEnry = Data.DbServer3.WordUp.Projekte.CounterProProjektOrt[OrtsGuid]; int Haeufigkeit = CounterEnry.Count / ModuloValue; if (!Haeufigkeiten.ContainsKey(Haeufigkeit)) Haeufigkeiten[Haeufigkeit] = 0; Haeufigkeiten[Haeufigkeit]++; } foreach (Guid OrtsGuid in Data.DbServer3.WordUp.Projekte.CounterProProjektOrt.Keys) { ElementProOrt CounterEnry = Data.DbServer3.WordUp.Projekte.CounterProProjektOrt[OrtsGuid]; if ((!CounterEnry.CounterProZustaendig.ContainsKey(Zustaendig.Bezirk)) || (CounterEnry.CounterProZustaendig[Zustaendig.Bezirk] < 3)) continue; DbEntities.dbserver3.wordup.rows.Ort CountedOrt = Data.DbServer3.WordUp.Orte.Find(OrtsGuid); if (CountedOrt.WLaenge == null) continue; if (IfExistsBefore(Result, OrtsGuid) == null) { int Haeufigkeit = CounterEnry.Count / ModuloValue; int Importance = -1; foreach (int Key in Haeufigkeiten.Keys) { if (Haeufigkeiten[Key] == Haeufigkeit) { Importance = Key + 1; break; } } Marker OrtMarker = new Marker() { Tag = CountedOrt, Lon = (double)CountedOrt.WLaenge, Lat = (double)CountedOrt.WBreite, TextToDraw = CountedOrt.NameId, ImportanceFactor = Importance, TypeToDraw = LogicalAreaType.OrteWithMoreProjects }; Result.Add(OrtMarker); } } return Result; }
private List<Marker> CreateMarkerForTypen(Organisation[] SchulListen, LogicalAreaType PhaseToProduce) { List<Marker> Result = new List<Marker>(); foreach (DataRow Schule in SchulListen) { if (Schule["WLaenge"] == Convert.DBNull) { continue; } if (IfExistsBefore(Result, Schule) == null) { Marker SchoolMarker = new Marker() { Tag = Schule, Lon = Convert.ToDouble(Schule["WLaenge"]), Lat = Convert.ToDouble(Schule["WBreite"]), TypeToDraw = LogicalAreaType.Schule }; Result.Add(SchoolMarker); } Organisation[] KlassenListe = WordUp23.DataWrapper.Instance.GetKlassen(null); //Schule); } return Result; }
private List<Marker> CreateMarkerForOrteWithMissingPictures(Organisation[] SchulListen, LogicalAreaType PhaseToProduce) { List<Marker> Result = new List<Marker>(); foreach (Ort OrtEntry in Data.DbServer3.WordUp.Orte .Find_AktuelleOrteForProjektPhase (DataWrapper.Instance.WordUpPhase.ToString())) { if (OrtEntry.WLaenge == double.NaN) { continue; } Dictionary<String, String> OrteMaterialien = DataWrapper.Instance.GetMaterialien(OrtEntry, "Orte"); if (OrteMaterialien.Keys.Count > 0) continue; if (IfExistsBefore(Result, OrtEntry) == null) { Marker DrawingMarker = new Marker() { Tag = OrtEntry, Lon = (double) OrtEntry.WLaenge, Lat = (double) OrtEntry.WBreite, TypeToDraw = LogicalAreaType.Text, TextToDraw = OrtEntry.NameId }; Result.Add(DrawingMarker); } } return Result; }
private List<Marker> CreateMarkerForDefinedOrteWherePicturesShouldProduced(Organisation[] SchulListen, LogicalAreaType PhaseToProduce) { List<Marker> Result = new List<Marker>(); Dictionary<string, List<DataRow>> Projekte = WordUp23.DataWrapper.Instance.GetSortedProjektSelection (DataWrapper.SortOrder.ArbeitsGruppen, DataWrapper.Instance.WordUpPhase, " and ID in (Select ProjektID from Aktivitaeten where AktivitaetsTypenID = 'EB6C4BAF-2A4C-4A81-81AB-296EDCEE1CFA') "); foreach (List<DataRow> ProjekteRows in Projekte.Values) { foreach (DataRow ProjekteRow in ProjekteRows) { if (ProjekteRow["WLaenge"] == Convert.DBNull) { continue; } Dictionary<String, String> ProjektMaterialien = DataWrapper.Instance.GetMaterialien(ProjekteRow, "Projekte"); if (ProjektMaterialien.Keys.Count > 0) continue; String NumericProjektID = ProjekteRow["NumericProjektID"].ToString().Substring(3); if (IfExistsBefore(Result, ProjekteRow) == null) { Marker DrawingMarker = new Marker() { Tag = ProjekteRow, Lon = Convert.ToDouble(ProjekteRow["WLaenge"]), Lat = Convert.ToDouble(ProjekteRow["WBreite"]), TypeToDraw = LogicalAreaType.Text, TextToDraw = NumericProjektID }; Result.Add(DrawingMarker); } } } return Result; }
private List<Marker> CreateMarkerForProjekteWithMissingPictures(Organisation[] SchulListen, LogicalAreaType typeToDraw) { List<Marker> Result = new List<Marker>(); foreach (Projekt ProjektEntry in Data.DbServer3.WordUp.Projekte .Find_PhasenCorrectProjekte (DataWrapper.Instance.WordUpPhase.ToString())) { if (ProjektEntry.Ort?.WLaenge == double.NaN) { continue; } Dictionary<String, String> ProjektMaterialien = DataWrapper.Instance.GetMaterialien(ProjektEntry, "Projekte"); if (ProjektMaterialien.Keys.Count > 0) continue; if (IfExistsBefore(Result, ProjektEntry) == null) { Marker DrawingMarker = new Marker() { Tag = ProjektEntry, Lon = (double)ProjektEntry.Ort?.WLaenge, Lat = (double) ProjektEntry.Ort?.WBreite, TypeToDraw = typeToDraw }; Result.Add(DrawingMarker); } } return Result; }
private List<Marker> CreateMarkerForCombined(Organisation[] SchulListen, LogicalAreaType PhaseToProduce) { List<Marker> Result = new List<Marker>(); foreach (Organisation Schule in SchulListen) { if (Schule.Ort.WLaenge == double.NaN) { continue; } if (IfExistsBefore(Result, Schule) == null) { Marker SchoolMarker = new Marker() { Tag = Schule, Lon = Convert.ToDouble(Schule.Ort.WLaenge), Lat = Convert.ToDouble(Schule.Ort.WBreite), TypeToDraw = LogicalAreaType.Schule }; Result.Add(SchoolMarker); } Organisation [] KlassenListe = WordUp23.DataWrapper.Instance.GetKlassen(Schule); List<Guid> FunktionsPersonen = Data.DbServer3.WordUp.Typen.AllTypIDsForVertreter; if (PhaseToProduce == LogicalAreaType.Combined) { List<DataRow> Schueler = WordUp23.DataWrapper.Instance.GetSchueler(null); //KlassenListe); foreach (Organisation organisation in KlassenListe) { foreach (PersonZuWordUpID SchuelerEntry in Data.DbServer3.WordUp.PersonenZuWordUpID .Find_TypedPersonenInOrganisationsID(FunktionsPersonen, organisation.Id)) { if (SchuelerEntry.Person.WLaenge == double.NaN) { continue; } if (IfExistsBefore(Result, SchuelerEntry) == null) { Marker PupilMarker = new Marker() { Tag = SchuelerEntry, Lon = SchuelerEntry.Person.WLaenge.Value, Lat = SchuelerEntry.Person.WBreite.Value, TypeToDraw = (SchuelerEntry.Person.Sex == "M") ? LogicalAreaType.SchuelerM : LogicalAreaType.SchuelerW }; Result.Add(PupilMarker); } } } } List<LogicalAreaType> PhasenToCreate = new List<LogicalAreaType>() { LogicalAreaType.Wunsch, LogicalAreaType.Planung, LogicalAreaType.Projekt, LogicalAreaType.Realisierung, LogicalAreaType.Fertig }; foreach (LogicalAreaType PhaseToCreate in PhasenToCreate) { DbEntities.dbserver3.wordup.rows.ProjektUebersicht[] DataToDraw = Data.DbServer3.WordUp .ProjektUebersichten .Find_PhasenRelatedProjektUebersichten(PhaseToCreate.ToString()); foreach (DbEntities.dbserver3.wordup.rows.ProjektUebersicht DataEntryToDraw in DataToDraw) { if (DataEntryToDraw.WLaenge == null) { continue; } Marker OldMarker = IfExistsBefore(Result, DataEntryToDraw); if (OldMarker == null) { Marker DrawingMarker = new Marker() { Tag = DataEntryToDraw, Lon = (double)DataEntryToDraw.WLaenge, Lat = (double)DataEntryToDraw.WBreite, TypeToDraw = PhaseToCreate }; Result.Add(DrawingMarker); } else { OldMarker.TypeToDraw = PhaseToCreate; } } } } return Result; }
private List<Marker> CreateMarkerForProjektPhasenDaten(Organisation[] SchulListen, LogicalAreaType PhaseToProduce) { List<Marker> Result = new List<Marker>(); foreach (Organisation schulEntry in SchulListen) { if (schulEntry.Ort.WLaenge == null) { continue; } if (IfExistsBefore(Result, schulEntry) == null) { Marker SchoolMarker = new Marker() { Tag = schulEntry, Lon = (double)schulEntry.Ort.WLaenge, Lat = (double)schulEntry.Ort.WBreite, TypeToDraw = LogicalAreaType.Schule }; Result.Add(SchoolMarker); } List<Organisation> KlassenListe = Data.DbServer3.WordUp.Organisationen .Find_ChildrenOrganisationenWithSpecialTypes (schulEntry.Id, new List<Guid>() { OrganisationenTypen.Klasse }).ToList(); List<Guid> KlassenIDs = KlassenListe.Select(sel => sel.Id).ToList(); DataRowCollection DataToDraw = null; DbEntities.dbserver3.wordup.rows.ProjektUebersicht[] ElementsToDraw = null; ElementsToDraw = Data.DbServer3.WordUp.ProjektUebersichten .Find_OrganisationenRelatedProjektUebersichten(KlassenIDs, PhaseToProduce.ToString()); if (ElementsToDraw == null) { foreach (DataRow RowToDraw in DataToDraw) { if (RowToDraw["WLaenge"] == Convert.DBNull) { continue; } Marker OldMarker = IfExistsBefore(Result, RowToDraw); if (OldMarker == null) { Marker DrawingMarker = new Marker() { Tag = RowToDraw, Lon = Convert.ToDouble(RowToDraw["WLaenge"]), Lat = Convert.ToDouble(RowToDraw["WBreite"]), TypeToDraw = PhaseToProduce }; Result.Add(DrawingMarker); } else { OldMarker.TypeToDraw = PhaseToProduce; } } } else { foreach (DbEntities.dbserver3.wordup.rows.ProjektUebersicht ELementToDraw in ElementsToDraw) { if (ELementToDraw.WLaenge == null) { continue; } Marker OldMarker = IfExistsBefore(Result, ELementToDraw.Id); if (OldMarker == null) { Marker DrawingMarker = new Marker() { Tag = ELementToDraw, Lon = (double)ELementToDraw.WLaenge, Lat = (double)ELementToDraw.WBreite, TypeToDraw = PhaseToProduce }; Result.Add(DrawingMarker); } else { OldMarker.TypeToDraw = PhaseToProduce; } } } } return Result; }
private List<Marker> CreateMarkerForSchueler(Organisation[] SchulListen, LogicalAreaType PhaseToProduce) { List<Marker> Result = new List<Marker>(); foreach (Organisation schulEntry in SchulListen) { if (schulEntry.Ort.WLaenge == null) { continue; } if (IfExistsBefore(Result, schulEntry.Id) == null) { Marker SchoolMarker = new Marker() { Tag = schulEntry, Lon = (double)schulEntry.Ort.WLaenge, Lat = (double)schulEntry.Ort.WBreite, TypeToDraw = LogicalAreaType.Schule }; Result.Add(SchoolMarker); } Organisation[] KlassenListe = Data.DbServer3.WordUp.Organisationen .Find_ChildrenOrganisationenWithSpecialTypes (schulEntry.Id, new List<Guid>() { OrganisationenTypen.Klasse }); Person[] Schueler = Data.DbServer3.WordUp.Personen.Find_VertreterPersonenProSchule(schulEntry.Id); foreach (Person SchuelerEntry in Schueler) { if (SchuelerEntry.WLaenge == null) { continue; } if (IfExistsBefore(Result, SchuelerEntry.Id) == null) { Marker PupilMarker = new Marker() { Tag = SchuelerEntry, Lon = (double)SchuelerEntry.WLaenge, Lat = (double)SchuelerEntry.WBreite, TypeToDraw = (SchuelerEntry.Sex == "M") ? LogicalAreaType.SchuelerM : LogicalAreaType.SchuelerW }; Result.Add(PupilMarker); } } } return Result; }
private List<Marker> CreateMarkerForSchulen(Organisation[] SchulListen, LogicalAreaType PhaseToProduce) { List<Marker> Result = new List<Marker>(); foreach (Organisation schulEntry in SchulListen) { if (schulEntry.Ort.WLaenge == null) { continue; } if (IfExistsBefore(Result, schulEntry.Id) == null) { Marker SchoolMarker = new Marker() { Tag = schulEntry, Lon = (double)schulEntry.Ort.WLaenge, Lat = (double)schulEntry.Ort.WBreite, TextToDraw = schulEntry.CodeName, TypeToDraw = LogicalAreaType.Schule }; Result.Add(SchoolMarker); } } return Result; }