// public int RunningIndex { get; set; } public MMUnitPresentationDataEntry(Information infoParent, ProcessConnector connector) { InfoParent = infoParent; Connector = connector; MMUnitToPresent = InfoParent.DataContext.MultiMedia.MMUnits.FindOrLoad(Connector.TableId); }
public InformationAddOn InsertNew(Information informationToCreateFor, DataDependency dataDependencyToCreateFor, String userName = "******") { InformationAddOn newAddOn = DataContext.AltErlaaInfo.InformationenAddOns.NewRow(); newAddOn.Id = Guid.NewGuid(); newAddOn.InformationenId = informationToCreateFor.Id; newAddOn.ActuallBezeichner = dataDependencyToCreateFor.ActuallBezeichner; newAddOn.Tabelle = dataDependencyToCreateFor.DataElementeTemplate.PhysicalDataElement.TabellenName; int? SortOrder = informationToCreateFor.Get_LastUsedSortOrder(dataDependencyToCreateFor); if ((SortOrder == null) || (SortOrder == 0)) newAddOn.SortOrder = dataDependencyToCreateFor.SortOrder; else newAddOn.SortOrder = (int)SortOrder + 1; newAddOn.CreatedBy = userName; newAddOn.HasBeenProcessedBefore = null; newAddOn.ModifyTimeStamp = informationToCreateFor.ModifyTimeStamp; newAddOn.DataDependency = dataDependencyToCreateFor; newAddOn.Table.Rows.Add(newAddOn); return newAddOn; }
private EntryGroupPresentationModel FillDescriptionalInformationData(Information information) { MainGroupEntry = new EntryGroupPresentationModel() { HeadLine = information.Titel, TypeOfThisGroup = DbBasics.GroupTyp.Information }; foreach (InformationAddOn infoAddOn in information.InformationenAddOnsOrdered) { if (DbBasics.DataDependenciesNotToDisplay[DbBasics.NotToDisplayTypen.InternetSimple] .Contains((Guid)infoAddOn.DataDependencyId)) continue; MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = infoAddOn.ActuallBezeichner, Content = infoAddOn.FreiText }); } return MainGroupEntry; }
private static String GetAddOnContent(Information information, Guid DataDependencyID) { List<String> SelectedStatementsForPreLoad = null; Data.DbServer3.AltErlaaInfo.PreLoadAddOnsForOneInformation(information.Id, out SelectedStatementsForPreLoad); foreach (InformationAddOn AddOn in information.InformationenAddOnsOrdered .Where(sel => String.IsNullOrEmpty(sel.FreiText) == false)) { if (AddOn.DataDependencyId == DataDependencyID) return AddOn.FreiText.Replace("\r\n", ",").Replace(";", ","); } return String.Empty; }
public void FillMeAsInformationEntry(Information information, bool ExpandFull) { if (ExpandFull) { // List<String> SelectStatementsForPreload = null; // Data.DbServer3.AltErlaaInfo.PreLoadTablesForOneInformation //(information, out SelectStatementsForPreload); Titel = information.Titel; SubTyp = information.Typ.NameId; FillDescriptionalInformationData(information); SetFramedZielGruppenDaten(information); SetFramedInformationKommunikationsDaten(information); SetFramedConnectedDaten(information); LastUpdateTime = (DateTime)information.ModifyTimeStamp; } // FramedMaterialDaten = FullInfo.CreateConnectedMaterialThumbs(); }
private int SetFramedZielGruppenDaten(Information information) { int NumberOfEntries = 0; if (information.InformationenZuZielGruppen.Count > 0) { EntryGroupPresentationModel Group = new EntryGroupPresentationModel() { HeadLine = "Zielgruppen", TypeOfThisGroup = DbBasics.GroupTyp.Zielgruppen }; DescriptionalContent[DbBasics.GroupTyp.Zielgruppen] = Group; EntryItemPresentationModel Item = new EntryItemPresentationModel(); Group.Items.Add(Item); List<String> ZielGruppenDaten = new List<string>(); foreach (InformationZuZielGruppe informationZuZielGruppe in information.InformationenZuZielGruppen) { NumberOfEntries++; ZielGruppenDaten.Add(informationZuZielGruppe.ZielGruppe.ZielGruppeColumn); } Item.Content = String.Join("\r\n", ZielGruppenDaten); } return NumberOfEntries; }
private int SetFramedStandBildTVKommunikationsDaten(Information information) { EntryGroupPresentationModel Group = new EntryGroupPresentationModel() { HeadLine = "KommunikationsDaten", TypeOfThisGroup = DbBasics.GroupTyp.Kommunikation }; int NumberOfEntries = 0; return NumberOfEntries; }
public void FillMeAsExternesProgrammEntry(Information SearchRoot) { SetFramedZielGruppenDaten(SearchRoot); SetFramedVideoKommunikationsDaten(SearchRoot); FillDescriptionalExternesProgrammData(SearchRoot); LoadConnectedPictures(SearchRoot); }
public void LoadConnectedPictures(Information SearchRoot) { if (Typ == "Information") { SetFramedConnectedDaten(SearchRoot); return; } if (Typ == "Presse") { FramedMaterialDaten = LoadPicturesFOrPresseEntry(SearchRoot); return; } if (Typ == "Video") { FramedMaterialDaten = LoadPicturesForVideoEntry(SearchRoot); return; } if (Typ == "ExternesProgramm") { FramedMaterialDaten = LoadPicturesForVideoEntry(SearchRoot); return; } if (Typ == "StandBildTV") { FramedMaterialDaten = LoadPicturesForStandBildTVEntry(SearchRoot); return; } }
private void FillDescriptionalPresseData(Information SearchRoot) { //TODO String SubPathName = String.Empty; //Path.Combine(SearchRoot.TableName, SearchRoot.NameID); String PictureFileName = Path.Combine(WMB.Basics.FileLocationsForPressMaterial, SubPathName); MainGroupEntry = new EntryGroupPresentationModel() { HeadLine = Path.GetFileNameWithoutExtension(SubPathName), TypeOfThisGroup = DbBasics.GroupTyp.Presse }; MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Typ", Content = "Bild Archiv" }); if (File.Exists(PictureFileName) == false) { MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Fehler", Content = "Der File (\"" + PictureFileName + "\") konnte nicht gefunden werden" }); return; } FileInfo FInfo = new FileInfo(PictureFileName); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Im Bereich ", Content = Path.GetDirectoryName(SubPathName) }); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Zuletzt geändert: ", Content = FInfo.LastWriteTime.ToString(WMB.Basics.ISO_DATE_TIME_FORMAT) }); }
private void FillDescriptionalExternesProgrammData(Information SearchRoot) { List<Guid> ExtProgrammIds = new List<Guid>(); foreach (ProcessConnector processConnector in Data.DbServer3.AltErlaaInfo.ProcessConnectoren .Where(sel => sel.InformationenId == SearchRoot.Id && sel.Redaktion == "Programm" && sel.TableId != null)) { ExtProgrammIds.Add(processConnector.TableId.Value); } Guid BeitragID = ExtProgrammIds.FirstOrDefault(); List<String> SelectedStatementsForPreload; Data.DbServer3.WPMedia.PreLoadAllForOneBeitrag(BeitragID, out SelectedStatementsForPreload); //VideoDataSet = WMB.DataWrapper.Instance.GetAllVideoDaten(BeitragID.ToString( )); //DataRow BeitraegeRow = VideoDataSet.Tables["Beitraege"].Rows[0]; Beitrag beitrag = Data.DbServer3.WPMedia.Beitraege.Find(BeitragID); MainGroupEntry = new EntryGroupPresentationModel() { HeadLine = beitrag.Name, TypeOfThisGroup = DbBasics.GroupTyp.ExternesProgramm }; MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Typ", Content = "StandBildSerie" }); InsertDataFromOneEntry(beitrag, MainGroupEntry); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Zuordnung", Content = String.Join("\r\n", beitrag.GetZuordnungenVonBeitrag()) }); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Autor", Content = beitrag.Autor.Name }); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Timings", Content = Data.DbServer3.MultiMedia.MMUnits.FindOrLoad(beitrag.BeitragId).DescriptionalMMUnitTimingsDataString }); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "SendeZeiten", Content="Not Implement Up To Now" //ToDo Content = GetSendeZeitenDisplayString(VideoDataSet.Tables["BeitraegezuSendernZugeordnet"]) }); }
private void InformationInstanceChanged(Information OldValue, Information NewValue) { if (NewValue != null) { ProcessConnectorGroupContainerModell helper = new ProcessConnectorGroupContainerModell() { ParentInformation = NewValue, ParentTypId = NewValue.TypId, AutoCreationTypUsed = NewValue.Typ.GetAutoCreationTyp }; helper.Create(NewValue); ProcessConnectorGroupContainerModellInstance = helper; } }
private MMInformation CreateNewDummyBannerInformation(Information relatedInformation) { return Parent.CheckOrInsertMMInformation(relatedInformation); }
public ProcessConnector CheckOrInsertProcessConnector(Information information, Guid mmUnitId, String redaktion, DateTime dateTimeToUse, String userName = "******") { ProcessConnector processConnector = ProcessConnectoren.FindOrLoad_via_ForeignId(mmUnitId); if (processConnector != null) return processConnector; DataDependency dataDependencyToUse = null; switch (redaktion) { case "Banner": dataDependencyToUse = DataDependencies.Find_via_NameId("Connector Banner"); break; case "Video": dataDependencyToUse = DataDependencies.Find_via_NameId("Connector Beitrag"); break; case "StandBildTV": dataDependencyToUse = DataDependencies.Find_via_NameId("Connector StandBild"); break; case "Button": throw new Exception($"Für die Redaktion {redaktion} kann " + $"keine Dummy Information angelegt werden"); break; case "Timings": throw new Exception($"Für die Redaktion {redaktion} kann " + $"keine Dummy Information angelegt werden"); break; case "Wetter": throw new Exception($"Für die Redaktion {redaktion} kann " + $"keine Dummy Information angelegt werden"); break; default: throw new Exception($"Für die Redaktion {redaktion} kann " + $"keine Dummy Information angelegt werden"); } InformationAddOn dummyProcessConnectorInformationAddOn = InformationenAddOns.InsertNew(information, dataDependencyToUse, userName); processConnector = dummyProcessConnectorInformationAddOn .GetOrCreate_ConnectedProcessConnector(); InformationenAddOns.SaveChanges(); InformationenAddOns.AcceptChanges(); processConnector.TableId = mmUnitId; processConnector.InformationenAddOnId = dummyProcessConnectorInformationAddOn.Id; ProcessConnectoren.SaveChanges(); ProcessConnectoren.AcceptChanges(); return processConnector; }
private bool CreateTypedInformationAddOnsForInformation(Information information, Typ typToCreate, String UserName) { List<DataDependency> UsedDataDependencies = new List<DataDependency>(); foreach (UseFor useFor in DataContext.AltErlaaInfo.UseFors .Where(sel => ((sel.TypId != null && sel.TypId == typToCreate.Id) || (sel.RootDataTemplatesId != null && sel.RootDataTemplatesId == typToCreate.RootFormat)) && sel.Usage == "Mandatory" && sel.DataDependency.DataElementeTemplate .PhysicalDataElement.TabellenName != "Informationen")) { UsedDataDependencies.Add(useFor.DataDependency); } foreach (DataDependency dataDependency in UsedDataDependencies.OrderBy(ord => ord.SortOrder)) { InformationAddOn newAddOn = DataContext.AltErlaaInfo.InformationenAddOns.InsertNew(information, dataDependency, UserName); } foreach (InformationAddOn informationenAddOn in information.InformationenAddOnsOrdered) { informationenAddOn.ProcessBeforeFirstAccessedDefaultFilling(); } return true; }
public bool PreLoadTablesForOneInformation(Information information, out List<String> SelectedStatementsForPreLoad) { SelectedStatementsForPreLoad = new List<string>(); Dictionary<String,List<String>> TableSearches = new Dictionary<string, List<String>>(); foreach (InformationAddOn informationenAddOn in information.InformationenAddOns) { if ((informationenAddOn.TabelleId == null) || (informationenAddOn.TabelleId == Guid.Empty) || (informationenAddOn.Tabelle == "ProcessConnector") || (informationenAddOn.Tabelle == "Timings")) continue; if (!TableSearches.ContainsKey(informationenAddOn.Tabelle)) TableSearches [informationenAddOn.Tabelle] = new List<String>(); TableSearches[informationenAddOn.Tabelle].Add($"{informationenAddOn.TabelleId}"); } foreach (string key in TableSearches.Keys) { switch (key) { case "Adressen": SelectedStatementsForPreLoad.Add($"Select * from {AdressenTable.NativeName} where " + $"{AdressenTable.IdCol} = '" + String.Join($"' or {AdressenTable.IdCol} = '", TableSearches[key]) + "' "); break; case "Events": SelectedStatementsForPreLoad.Add($"Select * from {EventsTable.NativeName} where " + $"{EventsTable.IdCol} = '" + String.Join($"' or {EventsTable.IdCol} = '", TableSearches[key]) + "' "); break; case "Remarks": SelectedStatementsForPreLoad.Add($"Select * from {RemarksTable.NativeName} where " + $"{RemarksTable.IdCol} = '" + String.Join($"' or {RemarksTable.IdCol} = '", TableSearches[key]) + "' "); break; case "Organisationen": SelectedStatementsForPreLoad.Add($"Select * from {OrganisationenTable.NativeName} where " + $"{OrganisationenTable.IdCol} = '" + String.Join($"' or {OrganisationenTable.IdCol} = '", TableSearches[key]) + "' "); break; case "Materialien": SelectedStatementsForPreLoad.Add($"Select * from {MaterialienTable.NativeName} where " + $"{MaterialienTable.IdCol} = '" + String.Join($"' or {MaterialienTable.IdCol} = '", TableSearches[key]) + "' "); break; case "Personen": SelectedStatementsForPreLoad.Add($"Select * from {TimingsTable.NativeName} where " + $"{TimingsTable.TimingsIdCol} = '" + String.Join($"' or {TimingsTable.TimingsIdCol} = '", TableSearches[key]) + "' "); break; } } try { if (SelectedStatementsForPreLoad.Count == 0) return true; DownloadTables(String.Join(";", SelectedStatementsForPreLoad)); } catch (Exception Excp) { return false; } foreach (string key in TableSearches.Keys) { switch (key) { case "Adressen": Adressen.HasBeenLoaded = true; break; case "Events": Events.HasBeenLoaded = true; break; case "Remarks": Remarks.HasBeenLoaded = true; break; case "Organisationen": Organisationen.HasBeenLoaded = true; break; case "Materialien": Materialien.HasBeenLoaded = true; break; case "Personen": Personen.HasBeenLoaded = true; break; } } AcceptChanges(); return true; }
public bool PreLoadTablesForOneInformation(Information information) { List<String> SelectedStatementsForPreLoad = null; return PreLoadTablesForOneInformation(information, out SelectedStatementsForPreLoad); }
private void StartTimingsTogetherWindow(Information information) { CsWindow timingsGroupWindow = new CsWindow(); timingsGroupWindow.Width = 1200; timingsGroupWindow.Height = 600; CsGlobal.Wpf.Storage.Window.Handle(timingsGroupWindow, "ShowTimingsToghetherWindow"); timingsGroupWindow.Title = $"Zeigen aller Timings für {information.Titel}"; TimingsGroupContainerModell timingsGroupContainerModell = new TimingsGroupContainerModell() { ParentInformation = information, ParentTypId = information.TypId, AutoCreationTypUsed = information.Typ.GetAutoCreationTyp }; timingsGroupContainerModell.Create(information); timingsGroupWindow.SizeToContent = SizeToContent.Height; timingsGroupWindow.Content = new TimingsGroupContainer(); ((TimingsGroupContainer)timingsGroupWindow.Content) .TimingsGroupContainerModellInstance = timingsGroupContainerModell; ((TimingsGroupContainer)timingsGroupWindow.Content).UpdateAllowed = false; timingsGroupWindow.Closing += (sender, args) => { }; timingsGroupWindow.ShowDialog(); }
private void FillDescriptionalVideoData(Information SearchRoot) { List<Guid> VideoBeitragIds = new List<Guid>(); foreach (ProcessConnector processConnector in Data.DbServer3.AltErlaaInfo.ProcessConnectoren .Where(sel => sel.InformationenId == SearchRoot.Id && sel.Redaktion == "Video" && sel.TableName == "Beitraege" && sel.TableId != null)) { VideoBeitragIds.Add(processConnector.TableId.Value); } foreach (Guid videoBeitragId in VideoBeitragIds) { List<String> SelectedStatementsForPreLoad = null; Data.DbServer3.WPMedia.PreLoadAllForOneBeitrag (videoBeitragId, out SelectedStatementsForPreLoad); MainGroupEntry = new EntryGroupPresentationModel() { HeadLine = Data.DbServer3.WPMedia.Beitraege.Find(videoBeitragId).Name, TypeOfThisGroup = DbBasics.GroupTyp.Video }; InsertDataFromOneEntry((DataRow)Data.DbServer3.WPMedia.Beitraege .Find(videoBeitragId), MainGroupEntry); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Zuordnung", Content = String.Join(", ", Data.DbServer3.WPMedia.Beitraege .Find(videoBeitragId).GetZuordnungenVonBeitrag ()) }); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Autor", Content = Data.DbServer3.WPMedia.Beitraege .Find(videoBeitragId).GetAutorVonBeitrag() }); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Timings", Content = GetTimingsDisplayString(Data.DbServer3.MultiMedia .MMUnitTimings.FindOrLoad_By_MMUnitId((Guid) videoBeitragId).ToArray()) }); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "SendeZeiten", Content = GetSendeZeitenDisplayString(Data.DbServer3.WPMedia.Beitraege .Find(videoBeitragId)) }); } }
public MMInformation CheckOrInsertMMInformation(Information information) { MMInformation mmInfo = Data.DbServer3.MultiMedia.MMInformationen.FindOrLoad(information.Id); if (mmInfo == null) { mmInfo = Data.DbServer3.MultiMedia.MMInformationen.NewRow(); mmInfo.Id = information.Id; mmInfo.Title = information.Titel; mmInfo.NameId = information.NameId; mmInfo.TypId = information.TypId; mmInfo.Table.Rows.Add(mmInfo); mmInfo.Table.SaveChanges(); mmInfo.Table.AcceptChanges(); } return mmInfo; }
/* private void FillDescriptionalStandBildTVData(CommonSearchClass SearchRoot) { String TableName = SearchRoot.TableName; String BeitragID = SearchRoot.ID.ToString(); OldStandBildTVDataSet = WMB.DataWrapper.Instance.GetAllStandBildTVDaten(TableName, BeitragID); DataRow StandBildRow = OldStandBildTVDataSet.Tables[TableName].Rows[0]; MainGroupEntry = new EntryGroupPresentationModel() { HeadLine = StandBildRow["NameID"].ToString(), TypeOfThisGroup = DbBasics.GroupTyp.StandBildTV }; MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Typ", Content = SearchRoot.TableName.ToString() + " (StandBild) Eintrag" }); InsertDataFromOneEntry(StandBildRow, MainGroupEntry, new string[] {"NameID", "ModifyTimeStamp;Letzte (Tabellen-)Änderung"}); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Änderung gefunden in", Content = Path.GetFileName(Path.GetDirectoryName(SearchRoot.FileFoundInDirectory.ToString())) }); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Zuletzt geändert", Content = SearchRoot.ModifyTimeStamp.ToString() }); MainGroupEntry.Items.Add(new EntryItemPresentationModel() { NameID = "Timings", Content = GetTimingsDisplayString(OldStandBildTVDataSet.Tables["Timings"]) }); } */ public void FillMeAsPresseEntry(Information SearchRoot) { SetFramedZielGruppenDaten(SearchRoot); SetFramedPresseKommunikationsDaten(SearchRoot); FillDescriptionalPresseData(SearchRoot); LoadConnectedPictures(SearchRoot); }
public bool? UpdateForMMUnitsForInformationenIsRequired(Information informationInstance, MMUnit unit) { if (unit == null) return true; if (informationInstance != null) { unit.MMInformationenId = CheckOrInsertMMInformation(informationInstance).Id; } if ((unit.MMInformationenId != null) && (unit.MMInformation.Version != null) && (unit.Version != unit.MMInformation.Version)) { unit.Version = unit.MMInformation.Version; return true; } return false; }
public void FillMeAsStandBildTVEntry(Information SearchRoot, bool ExpandFull) { //TODO //StringID = WMB.DataWrapper.Instance.GetConnectedInformationenID // (SearchRoot.ID.ToString(), // SearchRoot.TableName, // SearchRoot.NameID); //if (String.IsNullOrEmpty(StringID)) // { // Titel = "Zu diesem StandBild Eintrag \"" + SearchRoot.NameID // + "\" gibt es keinen Informations Eintrag"; // return; // } FillMeAsInformationEntry(SearchRoot, ExpandFull); }
public DataCollection<String[]> LoadPicturesFOrPresseEntry(Information SearchRoot) { DataCollection<String[]> FramedMaterial = new DataCollection<String[]>(); //TODO String SubDirectoryName = String.Empty; //Path.Combine(SearchRoot.TableName, SearchRoot.NameID); String PictureFileName = Path.Combine(WMB.Basics.FileLocationsForPressMaterial, SubDirectoryName); if (File.Exists(PictureFileName) == false) return FramedMaterial; String ThumbPictureFileName = Path.Combine(Path.GetDirectoryName(PictureFileName), "Small_" + Path.GetFileName(PictureFileName)); if (!File.Exists(ThumbPictureFileName)) { WMB.Basics.CheckIfAllPicturesHasSmallSiblings(Path.GetDirectoryName(PictureFileName), 1); if (File.Exists(ThumbPictureFileName) == false) throw new Exception("Thumbnail Creation Error"); } String[] PressePictureEntries = new String[] { "Presse", ThumbPictureFileName, PictureFileName, WMB.DataWrapper.Instance.GetPictureDataFromFileName(ThumbPictureFileName, new System.Windows.Size(200, 100)) }; FramedMaterial.Add(PressePictureEntries); return FramedMaterial; }
private int GetFramedKommunikationsDaten(Information SearchRoot = null) { if (Typ == "Information") { return SetFramedInformationKommunikationsDaten(SearchRoot); } if (Typ == "Presse") { return SetFramedPresseKommunikationsDaten(SearchRoot); } if (Typ == "Video") { return SetFramedVideoKommunikationsDaten(SearchRoot); } if (Typ == "ExternesProgramm") { return SetFramedExternesProgrammKommunikationsDaten(SearchRoot); } if (Typ == "StandBildTV") { return SetFramedStandBildTVKommunikationsDaten(SearchRoot); } return 0; }
public DataCollection<String[]> LoadPicturesForStandBildTVEntry(Information SearchRoot) { DataCollection<String[]> FramedMaterial = new DataCollection<String[]>(); //FramedMaterial.AddRange(StandBildLinks(SearchRoot.TableName, // SearchRoot.ID.ToString( ))); return FramedMaterial; }
private int SetFramedInformationKommunikationsDaten(Information information) { EntryGroupPresentationModel Group = new EntryGroupPresentationModel() { HeadLine = "KommunikationsDaten", TypeOfThisGroup = DbBasics.GroupTyp.Kommunikation }; DescriptionalContent[DbBasics.GroupTyp.Kommunikation] = Group; List<String> KommunikationsDaten = information.GetKommunikationsDaten(); int NumberOfEntries = 0; foreach (String Entry in KommunikationsDaten) { if (Entry.IndexOf("eMail", StringComparison.CurrentCultureIgnoreCase) != -1) { String[] Elements = Entry.Replace(": ", ";").Split(';'); String NewEntry = "<a href=\"mailto:" + Elements[1].Trim() + "\" target=\"_blank\">" + Elements[1].Trim() + "</a>"; Group.Items.Add(new EntryItemPresentationModel() { Content = "<b>" + Elements[0].Replace("0", "").Replace("1", "") + "</b>" + ": " + NewEntry }); NumberOfEntries++; continue; } else if (Entry.IndexOf("@", StringComparison.CurrentCultureIgnoreCase) != -1) { String[] Elements = Entry.Replace(": ", ";").Split(';'); String NewEntry = "<a href=\"mailto:" + Entry.Trim() + "\" target=\"_blank\">" + Entry.Trim() + "</a>"; Group.Items.Add(new EntryItemPresentationModel() { Content = NewEntry }); NumberOfEntries++; continue; } else if ((Entry.IndexOf("www", StringComparison.CurrentCultureIgnoreCase) != -1) || (Entry.IndexOf(".at", StringComparison.CurrentCultureIgnoreCase) != -1) || (Entry.IndexOf(".de", StringComparison.CurrentCultureIgnoreCase) != -1) || (Entry.IndexOf("http", StringComparison.CurrentCultureIgnoreCase) != -1) || (Entry.IndexOf(".com", StringComparison.CurrentCultureIgnoreCase) != -1)) { String NewEntry = "<a href=\"" + Entry.Trim() + "\" target=\"_blank\">" + Entry.Replace("http://", "").Replace("www.", "").Trim() + "</a>"; Group.Items.Add(new EntryItemPresentationModel() { Content = NewEntry }); NumberOfEntries++; continue; } else { String[] Elements = Entry.Replace(": ", ";").Split(';'); Group.Items.Add(new EntryItemPresentationModel() { Content = ((Elements.Length > 1)) ? "<b>" + Elements[0].Replace("0", "").Replace("1", "") + "</b>" + ": " + Elements[1] : Elements [0] }); NumberOfEntries++; continue; } } return NumberOfEntries; }
public DataCollection<String[]> LoadPicturesForVideoEntry(Information SearchRoot) { DataCollection<String[]> FramedMaterial = new DataCollection<String[]>(); BitmapSource ThumbBitmapSource = Data.DbServer3.WPMedia.Beitraege .FindOrLoad(SearchRoot.Id).ThumbBitmapSource; if (ThumbBitmapSource == null) return FramedMaterial; FramedMaterial.Add(new String[] { "Video", "Beitraege", SearchRoot.Id.ToString(), "True", DbBasics.ConvertBitmapSourceToDataString(Data.DbServer3.WPMedia.Beitraege .FindOrLoad(SearchRoot.Id).ThumbBitmapSource.ResizeToMaximum(200, 100)) }); return FramedMaterial; }
/* public DataRow GetTableRow(DataRow InformationenAddOnRow) { String TableName = InformationenAddOnRow["Tabelle"].ToString(); String MMPartID = InformationenAddOnRow["TabelleID"].ToString(); DataTable ContentTable = OldEntryDataSet.Tables[TableName]; if (ContentTable == null) { ContentTable = OldEntryDataSet.Tables[TableName + "Full"]; if (ContentTable == null) return null; } String IDName = GetTableIDName(TableName); return ContentTable.Select(IDName + " = '" + MMPartID + "'")[0]; } public DataRow GetMaterialTableRow(DataRow InformationenAddOnRow) { String TableName = InformationenAddOnRow["Tabelle"].ToString(); String MMPartID = InformationenAddOnRow["TabelleID"].ToString(); DataTable ContentTable = OldMaterialDataSet.Tables[TableName]; if (ContentTable == null) { ContentTable = OldMaterialDataSet.Tables[TableName + "Full"]; if (ContentTable == null) return null; } String IDName = GetTableIDName(TableName); DataRow[] Rows = ContentTable.Select(IDName + " = '" + MMPartID + "'"); if (Rows.Length == 0) return null; return Rows[0]; } */ public void SetFramedConnectedDaten (Information SearchRoot) { EntryGroupPresentationModel AllConnectors = new EntryGroupPresentationModel() { TypeOfThisGroup = DbBasics.GroupTyp.Connectors, HeadLine = "Connected Daten" }; DescriptionalContent[DbBasics.GroupTyp.Connectors] = AllConnectors; int ElementIndex = 0; Dictionary<String,int> RedaktionenCounter = new Dictionary<string, int>(); foreach (InformationAddOn informationAddOn in SearchRoot.InformationenAddOnsOrdered .Where(sel => sel.Tabelle == "ProcessConnector" && sel.TabelleId != null && sel.TabelleId != Guid.Empty)) { ProcessConnector connector = Data.DbServer3.AltErlaaInfo .ProcessConnectoren.Find(informationAddOn.TabelleId); if ((connector.TableId == null) || (connector.TableId == Guid.Empty) || (String.IsNullOrEmpty(connector.Redaktion))) continue; if (!RedaktionenCounter.Keys.Contains(connector.Redaktion)) RedaktionenCounter[connector.Redaktion] = 0; int connectionNumber = RedaktionenCounter[connector.Redaktion]; RedaktionenCounter[connector.Redaktion]++; EntryGroupPresentationModel OneConnector = AllConnectors.GetNewChildEntryGroupPresentationModel (DbBasics.GroupTyp.Connector, $"{informationAddOn.ActuallBezeichner} - {DbBasics.ConnectorText[connectionNumber]}"); int PageIndex = 0; foreach (String [] DataLinesForOnePicture in StandBildLinks((Guid) connector.TableId)) { String PictureName = "BildNummer " + Convert.ToString(++PageIndex); EntryGroupPresentationModel ConnectorForOnePicture = OneConnector.GetNewChildEntryGroupPresentationModel (DbBasics.GroupTyp.ConnectorElement, PictureName); ConnectorForOnePicture.Items.Add(new EntryItemPresentationModel() { Content = connector.Redaktion }); ConnectorForOnePicture.Items.Add(new EntryItemPresentationModel() { Content = connector.TableName }); ConnectorForOnePicture.Items.Add(new EntryItemPresentationModel() { Content = DataLinesForOnePicture [0] }); ConnectorForOnePicture.Items.Add(new EntryItemPresentationModel() { Content = DataLinesForOnePicture[1] }); ConnectorForOnePicture.Items.Add(new EntryItemPresentationModel() { Content = DataLinesForOnePicture[2] }); ConnectorForOnePicture.Items.Add(new EntryItemPresentationModel() { Content = DataLinesForOnePicture[3] }); } //"Video", "Beitraege", SearchRoot.Id.ToString(), "True", // WMB.Basics.ConvertBase64ImagBytesToDataString(BildPixel, 200, 100) } }
//public void FillMeFromBeitragBeschreibung(MMUnit mmUnit) // { // StringID = BeitragBeschreibungID; //TODO FillMeFromBeitragBeschreibung(RootInformationEntry, true); //} public void FillMeFromBeitragBeschreibung(Information SearchRoot, CommonSearchClass.TypeOfEntry entryType, bool ExpandFull) { if (SearchRoot == null) return; // String TableName = SearchRoot.TypNameID; String NameID = SearchRoot.Titel; if (SearchRoot.ModifyTimeStamp != null) LastUpdateTime = (DateTime) SearchRoot.ModifyTimeStamp; Titel = SearchRoot.Titel; switch (entryType) { case CommonSearchClass.TypeOfEntry.Information: FillMeAsInformationEntry(SearchRoot, ExpandFull); break; case CommonSearchClass.TypeOfEntry.Presse: FillMeAsPresseEntry(SearchRoot); break; case CommonSearchClass.TypeOfEntry.Video: FillMeAsVideoEntry(SearchRoot); break; case CommonSearchClass.TypeOfEntry.ExternesProgramm: FillMeAsExternesProgrammEntry(SearchRoot); break; case CommonSearchClass.TypeOfEntry.StandBildTV: FillMeAsStandBildTVEntry(SearchRoot, ExpandFull); break; } }