public void DoStartup(Window ParentWindow, Guid informationId) { Data.DbServer3.WPMediaAddOnData.LoadAll_IfHasNotBeenLoaded(); Data.DbServer3.MultiMedia.LoadAll_IfHasNotBeenLoaded(); List<String> SelectedStatementsForPreLoad = null; Data.DbServer3.AltErlaaInfo.PreLoadAddOnsForOneInformation(informationId, out SelectedStatementsForPreLoad); Information information = Data.DbServer3.AltErlaaInfo.Informationen.FindOrLoad(informationId); if (information == null) { ParentWindow.Title = $"Keine Information zu {informationId}"; return; } ParentWindow.Title = "Connected Elemente zu " + information.Titel; _expandedMMUnitTypen = new ObservableCollection<TypedMMUnitModell>(); foreach (ProcessConnector processConnector in Data.DbServer3.AltErlaaInfo.Informationen.Find(informationId).ProcessConnectoren) { if ((processConnector.TableId == null) || (processConnector.TableId == Guid.Empty)) continue; TypedMMUnitModell typedMMUnitModell = null; if (ExpandedMMUnitTypen .Count > 0) typedMMUnitModell = ExpandedMMUnitTypen? .Where(sel => sel.TableName == processConnector.TableName)?.ToArray()?.FirstOrDefault(); if (typedMMUnitModell == null) { typedMMUnitModell = new TypedMMUnitModell (Data.DbServer3.MultiMedia.MMUnitTypen.Find_By_Name(processConnector.TableName), Data.DbServer3.AltErlaaInfo.Informationen.FindOrLoad(informationId)); ExpandedMMUnitTypen.Add(typedMMUnitModell); } } ActuallUsageMode = UsageMode.AllForOneInformation; if (ExpandedMMUnitTypen.Count > 0) SelectedTypedMMUnitModell = ExpandedMMUnitTypen[0]; }
public void DoStartup() { Data.DbServer3.AltErlaaInfo.LoadAll_IfHasNotBeenLoaded(); Data.DbServer3.WPMediaAddOnData.LoadAll_IfHasNotBeenLoaded(); Data.DbServer3.MultiMedia.LoadAll_IfHasNotBeenLoaded(); ExpandedMMUnitTypen = new ObservableCollection<TypedMMUnitModell>(); foreach (MMUnitTyp typToProcess in Data.DbServer3.MultiMedia.MMUnitTypen .Where(sel => String.IsNullOrEmpty(sel.Redaktion) == false)) { TypedMMUnitModell typedMMUnitModell = new TypedMMUnitModell (typToProcess, null); ExpandedMMUnitTypen.Add(typedMMUnitModell); } ActuallUsageMode = UsageMode.AllForOneTyp; if (ExpandedMMUnitTypen.Count > 0) SelectedTypedMMUnitModell = ExpandedMMUnitTypen[0]; }
public void FillAllForSelectedTableDefinition(TypedMMUnitModell typedMMUnitModell) { if (typedMMUnitModell == null) return; switch (ActuallUsageMode) { case UsageMode.AllForOneTyp: if (ExpandedMMUnitTypen.Count == 0) { foreach (MMUnitTyp mmUnitTyp in Data.DbServer3.MultiMedia.MMUnitTypen .Where(sel => sel.Redaktion == "StandBild" || sel.Redaktion == "Banner" || sel.Redaktion == "Video")) ExpandedMMUnitTypen.Add(new TypedMMUnitModell(mmUnitTyp, null)); //foreach (TableDefinition tableDefinition in Data.DbServer3.WPMediaAddOnData.TableDefinitions.AllStandardEntries) // { // if (tableDefinition.Type == "StandBildTV") // ExpandedMMUnitTypen.Add(new TypedMMUnitModell(tableDefinition.Id, null)); // if (tableDefinition.Type == "Banner") // ExpandedMMUnitTypen.Add(new TypedMMUnitModell(tableDefinition.Id, null)); // } } Data.DbServer3.MultiMedia.AcceptChanges(); typedMMUnitModell.UnitsForSelectedMMUnitType = null; typedMMUnitModell.UnitsForSelectedMMUnitType = Data.DbServer3.MultiMedia.MMUnits.Load_via_MMUnitTypId (typedMMUnitModell.UnitTypId, 100).ToList(); break; case UsageMode.AllForOneInformation: { typedMMUnitModell.UnitsForSelectedMMUnitType.Clear(); List<Guid> MMUnitIds = new List<Guid>(); foreach (InformationAddOn informationAddOn in typedMMUnitModell.Information.InformationenAddOnsOrdered .Where(sel => sel.Tabelle == "ProcessConnector")) { ProcessConnector Connector = Data.DbServer3.AltErlaaInfo.ProcessConnectoren.Find(informationAddOn.TabelleId); if ((Connector.TableName == typedMMUnitModell.TableName) && (Connector.TableId != null) && (Connector.TableId != Guid.Empty)) MMUnitIds.Add((Guid)Connector.TableId); } Data.DbServer3.MultiMedia.PreLoadAllForAllMMUnits(MMUnitIds); foreach (Guid mmUnitId in MMUnitIds) { typedMMUnitModell.UnitsForSelectedMMUnitType.Add (Data.DbServer3.MultiMedia.MMUnits.Find(mmUnitId)); } } break; case UsageMode.AllForCreator: break; } }