public PresentationTree GetSendStatisticsForOneTableEntry(String TableName, Guid? ID) { PresentationTree Result = new PresentationTree(); return Result; }
/* public PresentationTree GetSendStatisticsForOneTableEntry(String TableName, System.Guid? ID) { PresentationTree StatisticRoot = new PresentationTree(); StatisticRoot.TypeOfLeaf = PresentationTree.TypeOfLeafEntry.StatisticRoot; if ((String.IsNullOrEmpty(TableName)) || (TableName == "BannerData") || (ID == null) || (ID == System.Guid.Empty)) return StatisticRoot; DataTable StatisticInformationTable = TemplateManagement.GetStatisticInformationTable (TableName, ((System.Guid)ID).ToString()); foreach (DataRow SenderRow in AvailableSender.Values) { System.Guid SenderID = (System.Guid)SenderRow["SenderID"]; PresentationTree SenderLeaf = new PresentationTree(); SenderLeaf.TypeOfLeaf = PresentationTree.TypeOfLeafEntry.StatisticSender; StatisticRoot.Children.Add(SenderLeaf); SenderLeaf.MyDataRow = SenderRow; SenderLeaf.DisplayableHead = SenderRow["Name"].ToString(); double CumulativeSendTime = 0; int NumberOfOccurencies = 0; foreach (DataRow StatistikRow in StatisticInformationTable.Rows) { String ComputerName = StatistikRow["ComputerName"].ToString(); if (TemplateManagement.PlayerToSender.ContainsKey(ComputerName) == false) continue; if (TemplateManagement.PlayerToSender[ComputerName] != SenderLeaf.DisplayableHead) continue; CumulativeSendTime += Convert.ToDouble(StatistikRow["Duration"]); NumberOfOccurencies += Convert.ToInt32(StatistikRow["NumberOfOccurences"]); PresentationTree PlayerLeaf = new PresentationTree(); PlayerLeaf.TypeOfLeaf = PresentationTree.TypeOfLeafEntry.StatisticPlayer; SenderLeaf.Children.Add(PlayerLeaf); PlayerLeaf.MyDataRow = StatistikRow; PlayerLeaf.DisplayableHead = "Computer"; PlayerLeaf.DisplayableContent = String.Format("{0} Einschaltungen am Computer {1} mit {2} Sekunden Sendezeit", Convert.ToInt32(StatistikRow["NumberOfOccurences"]), ComputerName, Convert.ToDouble(StatistikRow["Duration"])); } SenderLeaf.DisplayableContent = String.Format("{0} Einschaltungen mit insgesamt {1} Sekunden Sendezeit", NumberOfOccurencies, CumulativeSendTime); } return StatisticRoot; } */ public PresentationTree GetUsedSendungsIDsForOneTableEntry(String TableName, System.Guid? ID) { PresentationTree Root = new PresentationTree(); Root.TypeOfLeaf = PresentationTree.TypeOfLeafEntry.Root; if ((String.IsNullOrEmpty(TableName)) || (TableName == "BannerData") || (ID == null) || (ID == System.Guid.Empty)) return Root; List<System.Guid> BeitragIDsForTable = SchedulingFunctionsData.Instance.GetBeitragsIDForStandBildTable(TableName); foreach (DataRow SenderRow in AvailableSender.Values) { System.Guid SenderID = (System.Guid)SenderRow["SenderID"]; PresentationTree SenderLeaf = new PresentationTree(); SenderLeaf.TypeOfLeaf = PresentationTree.TypeOfLeafEntry.Sender; Root.Children.Add(SenderLeaf); SenderLeaf.MyDataRow = SenderRow; SenderLeaf.DisplayableHead = SenderRow["Name"].ToString(); // SenderLeaf.DisplayableContent = SenderRow ["ShortDescription"].ToString (); foreach (DataRow SendungsRow in AvailableSendungenPerSender(SenderID)) { System.Guid SendungID = (System.Guid)SendungsRow["SendungID"]; PresentationTree SendungLeaf = new PresentationTree(); SendungLeaf.TypeOfLeaf = PresentationTree.TypeOfLeafEntry.Sendung; SenderLeaf.Children.Add(SendungLeaf); SendungLeaf.MyDataRow = SendungsRow; SendungLeaf.DisplayableHead = SendungsRow["Name"].ToString(); // SendungLeaf.DisplayableContent = SendungsRow ["ShortDescription"].ToString (); // bool BeitragAssigned = false; foreach (System.Guid BeitragID in BeitragIDsForTable) { if (IsBeitragAssigned(BeitragID, SendungID) == true) { // BeitragAssigned = true; PresentationTree BeitragLeaf = new PresentationTree(); BeitragLeaf.TypeOfLeaf = PresentationTree.TypeOfLeafEntry.StandBildBeitrag; SendungLeaf.Children.Add(BeitragLeaf); BeitragLeaf.MyDataRow = SendungsRow; BeitragLeaf.DisplayableHead = "Auf Sendung"; // BeitragID.ToString (); BeitragLeaf.IsAssigned = true; DataRowCollection TimingsRows = SchedulingFunctionsData.Instance.GetDisplayableTimingsForTableEntry (TableName, (System.Guid)ID); foreach (DataRow TimingsEntry in TimingsRows) { if (TimingsEntry["TimingTypID"].ToString() != "VonBis") continue; PresentationTree TimingsLeaf = new PresentationTree(); TimingsLeaf.TypeOfLeaf = PresentationTree.TypeOfLeafEntry.VonBisTiming; BeitragLeaf.Children.Add(TimingsLeaf); TimingsLeaf.MyDataRow = TimingsEntry; TimingsLeaf.DisplayableContent = TimingsEntry["DisplayText"].ToString(); TimingsLeaf.DisplayableHead = TimingsEntry["TimingTypID"].ToString(); TimingsLeaf.IsAssigned = true; foreach (DataRow AddOnTimingsEntry in TimingsRows) { if (TimingsEntry["TimingTypID"].ToString() == "VonBis") continue; PresentationTree AddOnTimingsLeaf = new PresentationTree(); AddOnTimingsLeaf.TypeOfLeaf = PresentationTree.TypeOfLeafEntry.AdditionalTiming; TimingsLeaf.Children.Add(AddOnTimingsLeaf); AddOnTimingsLeaf.MyDataRow = AddOnTimingsEntry; TimingsLeaf.DisplayableContent = TimingsEntry["DisplayText"].ToString(); AddOnTimingsLeaf.DisplayableHead = TimingsEntry["TimingTypID"].ToString(); AddOnTimingsLeaf.IsAssigned = true; } } } } } } return Root; }