int CreateVideoPlusBackGroundProgrammGenerationEntry (String BackGroundID, Table MaterialTable) { Dh = new DataHandling (); if (!Dh.SetBeitrag (BackGroundID)) { Label MessageLabel = new Label (); this.LinkToVideosContentPlace.Controls.Add (MessageLabel); MessageLabel.Text = "Für die mitgegebene BackGroundBeitragsID war kein Beitrag zu finden\r\n" + Dh.GetErrorMessage (); MessageLabel.Width = Unit.Percentage (99); return 0; } DataTable MaterialDataTable = Dh.GetMaterialDataTable (); DataTable MaterialTypeDataTable = Dh.GetMaterialTypeDataTable (); DataView MaterialTypenDataView = new DataView (MaterialTypeDataTable, "ShowInInternetOrder > '00'", "ShowInInternetOrder", DataViewRowState.CurrentRows); TableRow MaterialTableRow = new TableRow (); MaterialTableRow.CssClass = "CSS_MaterialRow"; MaterialTable.Controls.Add (MaterialTableRow); DataTable VideoFiles = Dh.GetFileDataTable (); int NumberOfPresentedRows = 0; int MaterialIndex = 0; foreach (DataRow VideoFile in VideoFiles.Rows) { NumberOfPresentedRows += FillTheFileEntries (Dh, VideoFile, MaterialTypenDataView, MaterialDataTable, MaterialTable, MaterialIndex, VideoFiles.Rows.Count, ""); MaterialIndex++; } return NumberOfPresentedRows; }
void PerformBeitragSelected (String BeitragID) { Dh = new DataHandling (); if (!Dh.SetBeitrag (BeitragID)) { Label MessageLabel = new Label (); this.LinkToVideosContentPlace.Controls.Add (MessageLabel); MessageLabel.Text = "Für die mitgegebene BeitragsID war kein Beitrag zu finden\r\n" + Dh.GetErrorMessage (); MessageLabel.Width = Unit.Percentage (99); return; } Table GlobalTable = new Table (); GlobalTable.CssClass = "CSS_GlobalTable"; this.LinkToVideosContentPlace.Controls.Add (GlobalTable); { TableRow GlobalTableRow = new TableRow (); GlobalTableRow.CssClass = "CSS_GlobalTableRow"; GlobalTable.Controls.Add (GlobalTableRow); { TableCell BeitragsPictureCell = new TableCell (); GlobalTableRow.Controls.Add (BeitragsPictureCell); BeitragsPictureCell.CssClass = "CSS_BeitragsPictureCell"; { Image BeitragsImage = new Image (); BeitragsPictureCell.Controls.Add (BeitragsImage); String ApplPath = Server.MapPath ("~"); BeitragsImage.ImageUrl = String.Format ("GetThumbnailPicture.aspx?BeitragID={0}&Width=400", BeitragID); } TableCell BeitragsTextCell = new TableCell (); GlobalTableRow.Controls.Add (BeitragsTextCell); BeitragsTextCell.Attributes ["valign"] = "top"; BeitragsTextCell.CssClass = "CSS_BeitragsTextCell"; Table BeitragsTextTable = new Table (); BeitragsTextTable.CssClass = "CSS_BeitragsTextTable"; BeitragsTextCell.Controls.Add (BeitragsTextTable); { TableRow BeitragsTitleTableRow = new TableRow (); BeitragsTitleTableRow.CssClass = "CSS_BeitragsTitleTableRow"; BeitragsTextTable.Controls.Add (BeitragsTitleTableRow); { TableCell BeitragsTitleCell = new TableCell (); BeitragsTitleTableRow.Controls.Add (BeitragsTitleCell); BeitragsTitleCell.CssClass = "CSS_BeitragsTitleCell"; BeitragsTitleCell.Text = Dh.GetTitle (); } } { TableRow BeitragsShortDescTableRow = new TableRow (); BeitragsShortDescTableRow.CssClass = "CSS_BeitragsShortDescTableRow"; BeitragsTextTable.Controls.Add (BeitragsShortDescTableRow); { TableCell BeitragsShortDescCell = new TableCell (); BeitragsShortDescTableRow.Controls.Add (BeitragsShortDescCell); BeitragsShortDescCell.CssClass = "CSS_BeitragsShortDescCell"; BeitragsShortDescCell.Text = Dh.GetShortDescription (); } } { TableRow BeitragsLongDescTableRow = new TableRow (); BeitragsLongDescTableRow.CssClass = "CSS_BeitragsLongDescTableRow"; BeitragsTextTable.Controls.Add (BeitragsLongDescTableRow); { TableCell BeitragsLongDescCell = new TableCell (); BeitragsLongDescTableRow.Controls.Add (BeitragsLongDescCell); BeitragsLongDescCell.CssClass = "CSS_BeitragsLongDescCell"; BeitragsLongDescCell.Text = Dh.GetLongDescription (); } } { TableRow BeitragsAdditionalTableRow = new TableRow (); BeitragsAdditionalTableRow.CssClass = "CSS_BeitragsAdditionalTableRow"; BeitragsTextTable.Controls.Add (BeitragsAdditionalTableRow); { TableCell BeitragsAdditionalCell = new TableCell (); BeitragsAdditionalTableRow.Controls.Add (BeitragsAdditionalCell); BeitragsAdditionalCell.CssClass = "CSS_BeitragsAdditionalCell"; BeitragsAdditionalCell.Text = "Beitrag von: " + Dh.GetAuthor () + "<br>\r\n" + "Länge: " + Dh.GetDurationString () + "\r\n"; } } } } { TableRow MaterialTableRow = new TableRow (); MaterialTableRow.CssClass = "CSS_GlobalTableRow"; GlobalTable.Controls.Add (MaterialTableRow); TableCell MaterialTableCell = new TableCell (); MaterialTableCell.CssClass = "CSS_MaterialTableCell"; MaterialTableCell.Attributes ["colspan"] = "2"; MaterialTableRow.Controls.Add (MaterialTableCell); DataTable MaterialDataTable = Dh.GetMaterialDataTable (); DataTable MaterialTypeDataTable = Dh.GetMaterialTypeDataTable(); DataView MaterialTypenDataView = new DataView(MaterialTypeDataTable, "ShowInInternetOrder > '00'", "ShowInInternetOrder", DataViewRowState.CurrentRows); Table MaterialTable = new Table(); MaterialTable.CssClass = "CSS_MaterialTable"; MaterialTableCell.Controls.Add(MaterialTable); DataTable VideoFiles = Dh.GetFileDataTable (); int NumberOfPresentedRows = 0; int MaterialIndex = 0; String BackGroundID = Dh.GetBackGroundBeitragID (); foreach (DataRow VideoFile in VideoFiles.Rows) { NumberOfPresentedRows += FillTheFileEntries(Dh, VideoFile, MaterialTypenDataView, MaterialDataTable, MaterialTable, MaterialIndex, VideoFiles.Rows.Count, BackGroundID); MaterialIndex++; } if (NumberOfPresentedRows == 0) { Label NoMaterialMessage = new Label(); NoMaterialMessage.CssClass = "CSS_NoMaterialMessage"; MaterialTableCell.Controls.Add(NoMaterialMessage); NoMaterialMessage.Text = "Für diesen Beitrag sind im Internet keine VideoTeile verfügbar"; } } }