public void SetData (System.Web.UI.WebControls.PlaceHolder Anchor, DataHandling DhExisting, int NumberOfDisplayableEntries) { m_Anchor = Anchor; m_Dh = DhExisting; m_NumberOfDisplayableEntries = NumberOfDisplayableEntries; }
protected void Page_Load (object sender, EventArgs e) { Dh = new DataHandling (); Dh.DataBase.ConnectionStringName = "WPMediaAddOnDataConnectionString"; if (Request.QueryString ["Search"] != null) { ProcessTreeSearchEntered (); return; } if (!IsPostBack) ShowSelectionTree (); // ShowCalendarFrame (DateTime.Now); }
protected void Page_Load (object sender, EventArgs e) { if ((Request.QueryString ["BeitragID"] != null) && (Request.QueryString ["Width"] != null)) { String BeitragID = Request.QueryString ["BeitragID"].ToString (); String WidthString = Request.QueryString ["Width"].ToString (); if ((BeitragID != "") && (WidthString != "")) { DataHandling Dh = new DataHandling (); if (!Dh.SetBeitrag (BeitragID)) { return; } int Width = Convert.ToInt32 (WidthString); Response.ContentType = "image/jpeg"; byte [] PictureString = Dh.GetJPEGImageBytes (BeitragID, Width); if (PictureString != null) Response.BinaryWrite (PictureString); } } }
List<String> GetStandBildIndizessFiles (DataHandling Dh, WPMediaStandbildPlayingData StandBildPlayingData) { List<String> Names = WMB.Basics.GetFilesFromDirectory (WMB.Basics.GetRemoteWPMediaRoot () + "\\WPMediaFinalInternetSource\\" + StandBildPlayingData.TableName, new string[ ] {"*StandBildArchiv*.xml"}, 1); Names.Sort (); return Names; }
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; }
int FillTheFileEntries(DataHandling Dh, DataRow VideoFile, DataView MaterialTypenDataView, DataTable MaterialDataTable, Table MaterialTable, int MaterialIndex, int NumberOfVideoFiles, String BackGroundID) { int NumberOfPresentedFiles = 0; int TypenIndex = 0; while (TypenIndex < MaterialTypenDataView.Count) { DataRow TypenRow = MaterialTypenDataView[TypenIndex].Row; TypenIndex++; String TechnicalTyp = TypenRow["TechnicalTyp"].ToString(); DataRow[] ShowAbleFiles = MaterialDataTable.Select ("FileID = '" + VideoFile ["FileID"].ToString () + "' and TechnicalTyp = '" + TechnicalTyp + "'"); if (ShowAbleFiles.Length == 0) { continue; } NumberOfPresentedFiles++; } if (NumberOfPresentedFiles == 0) return NumberOfPresentedFiles; TypenIndex = 0; while (TypenIndex < MaterialTypenDataView.Count) { DataRow TypenRow = MaterialTypenDataView[TypenIndex].Row; TypenIndex++; String TechnicalTyp = TypenRow["TechnicalTyp"].ToString(); DataRow[] ShowAbleFiles = MaterialDataTable.Select ("FileID = '" + VideoFile["FileID"].ToString() + "' and TechnicalTyp = '" + TechnicalTyp + "'"); if (ShowAbleFiles.Length == 0) { continue; } if ((TechnicalTyp == "SCALAGeneration") || (TechnicalTyp == "BilderGalerie")) { //CreateSCALAGenerationEntry (ShowAbleFiles, MaterialTable.Controls); CreateExternesProgrammGenerationEntry (ShowAbleFiles, MaterialTable.Controls); continue; } if (TechnicalTyp == "ExternesProgramm") { CreateExternesProgrammGenerationEntry (ShowAbleFiles, MaterialTable.Controls); continue; } TableRow MaterialRow = new TableRow (); MaterialRow.CssClass = "CSS_MaterialRow"; MaterialTable.Controls.Add(MaterialRow); if (TypenIndex == 1) { TableCell FileNameCell = new TableCell(); FileNameCell.CssClass = "CSS_FileNameCell"; MaterialRow.Controls.Add(FileNameCell); if (NumberOfVideoFiles == 1) FileNameCell.Text = "Das Video in folgenden Qualitäten"; else { FileNameCell.Text = "Das Video - Teil " + Convert.ToString(MaterialIndex + 1) + " in folgenden Qualitäten"; } FileNameCell.RowSpan = NumberOfPresentedFiles; } TableCell MaterialFormatCell = new TableCell(); MaterialFormatCell.CssClass = "CSS_MaterialFormatCell"; MaterialRow.Controls.Add(MaterialFormatCell); if (String.Compare(TypenRow ["StorageFormat"].ToString (), "*.wmv", true) == 0) { Image WindowsMediaPlayer = new Image(); WindowsMediaPlayer.ImageUrl = "WMV_Logo.png"; WindowsMediaPlayer.ToolTip = TypenRow ["TechnicalDescription"].ToString (); MaterialFormatCell.Controls.Add(WindowsMediaPlayer); } else { MaterialFormatCell.Text = TypenRow["StorageFormat"].ToString(); } TableCell MaterialNameCell = new TableCell(); MaterialNameCell.CssClass = "CSS_MaterialNameCell"; MaterialRow.Controls.Add(MaterialNameCell); MaterialNameCell.Text = "<a href=\"" + Request.Url + "&BeitragQuality=" + TechnicalTyp + "&FileIndex=" + Convert.ToString(MaterialIndex) + "\" target=\"_self\">" + TypenRow ["ReadableDescription"].ToString () + "</a>"; MaterialNameCell.ToolTip = TypenRow["TechnicalDescription"].ToString(); TableCell MaterialQualityCell = new TableCell(); MaterialQualityCell.CssClass = "CSS_MaterialQualityCell"; MaterialRow.Controls.Add(MaterialQualityCell); MaterialQualityCell.Text = TechnicalTyp; TableCell MaterialSizeCell = new TableCell(); MaterialSizeCell.CssClass = "CSS_MaterialSizeCell"; MaterialRow.Controls.Add(MaterialSizeCell); MaterialSizeCell.Text = ShowAbleFiles [0] ["FileSizeInkB"].ToString () + "kB"; } if (String.IsNullOrEmpty (BackGroundID) == false) { NumberOfPresentedFiles += CreateVideoPlusBackGroundProgrammGenerationEntry (BackGroundID, MaterialTable); } return NumberOfPresentedFiles; }
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"; } } }
void PerformDirectLink (String BeitragID, String BeitragQuality, int FileIndex) { 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; } DataTable VideoFilesDataTable = Dh.GetFileDataTable (); if (FileIndex >= VideoFilesDataTable.Rows.Count) return; DataRow FileEntry = VideoFilesDataTable.Rows[FileIndex]; DataTable MaterialDataTable = Dh.GetMaterialDataTable(); DataRow[] ShowAbleFiles = MaterialDataTable.Select ("FileID = '" + FileEntry["FileID"].ToString() + "' and TechnicalTyp = '" + BeitragQuality + "'"); if (ShowAbleFiles.Length == 0) FillForIlegalUse(); //if (BeitragQuality == "ExternesProgramm") // { // String ResponsePath = GetExternesProgrammMaterial (ShowAbleFiles [0] ["SubPathAndName"].ToString ()); // } Response.Redirect (CVM.CommonValues.WEB_ROOT_SITE + "BeitragsMaterial/" + ShowAbleFiles [0] ["SubPathAndName"].ToString ()); return; }
void PerformShowProgramm (String SenderNameID) { Dh = new DataHandling (); //XmlDocument XmlSchema = Dh.GetSenderProgrammDescription (SenderNameID); Label HeadLineLabel = new Label (); this.LinkToVideosContentPlace.Controls.Add (HeadLineLabel); String SenderName = Dh.GetXSenderName (); String SenderEMail = Dh.GetXSenderEMail (); String SenderHomePage = Dh.GetXSenderHomePage (); String SenderImmediateRemark = Dh.GetXSenderImmediateRemark (); String SenderHomePageEntry = "<a href=\"" + SenderHomePage + "\">zur " + SenderName + " Homepage - </a>"; String SenderImmediateRemarkElement = ""; if (SenderImmediateRemark != "") { SenderImmediateRemarkElement = "<p align=\"center\"><b><font size=\"2\" color=\"#0080C0\">" + SenderImmediateRemark + "</font></b></p>\r\n"; } String AktualisierungsZeit = "<font size=\"1\" color=\"#0080C0\"> (per " + DateTime.Now.ToShortDateString () + " " + DateTime.Now.ToShortTimeString () + ")</font>"; String HeadLine = "Das aktuelle " + SenderName + "-Programm"; String WPTVeMail = "<a href=\"mailto:" + SenderEMail + "\">eMail an " + SenderName + "</a>"; HeadLineLabel.Text = "<a Name=\"TopPosition\"> </a>\r\n" + "<p align=\"center\"><b><font size=\"4\" color=\"#0080C0\">" + HeadLine + "</font>" + AktualisierungsZeit + "</b></p>\r\n" + "<p align=\"center\"><b><font size=\"2\" >" + SenderHomePageEntry + WPTVeMail + "</font> </b></p>\r\n" + SenderImmediateRemarkElement + CVM.CommonValues.ORDER_MESSAGE; HeadLineLabel.Width = Unit.Percentage (99); CreateBeitraege Formatieren = new CreateBeitraege (); Formatieren.SetData (this.LinkToVideosContentPlace, Dh); }
void PerformShowSelectionFull (String [] Selectionen, DateTime FromDate, DateTime ToDate, int StartingIndex) { Dh = new DataHandling (); CreateSelectionTree (Dh); int NumberOfUnifiedEntries = Dh.LoadSelections (Selectionen, 100, FromDate, ToDate, "Full"); if (NumberOfUnifiedEntries == 0) { return; } int NumberOfPages = 5; int NumberOfEntriesPerPage = NumberOfUnifiedEntries / NumberOfPages; while ((NumberOfEntriesPerPage < 15) && (NumberOfPages > 1)) { NumberOfPages--; NumberOfEntriesPerPage = NumberOfUnifiedEntries / NumberOfPages; } int [] TableForEntriesPerPage = new int [NumberOfPages]; String [] ReturnDates = new String [NumberOfPages]; int Reminder = NumberOfUnifiedEntries - (NumberOfEntriesPerPage * NumberOfPages); int AddOnPerPage = Reminder / NumberOfPages; int RunningLastDateIndex = 0; int Index = 0; while (Index < NumberOfPages) { if (Reminder > AddOnPerPage) TableForEntriesPerPage [Index] = NumberOfEntriesPerPage + AddOnPerPage; else TableForEntriesPerPage [Index] = NumberOfEntriesPerPage + Reminder; Reminder -= AddOnPerPage; ReturnDates [Index] = Dh.GetFromDate (RunningLastDateIndex); RunningLastDateIndex += TableForEntriesPerPage [Index]; Index++; } if (Index == 0) return; String PagingMessage = ""; if (TableForEntriesPerPage.Length > 1) PagingMessage = CreatePagingMessage (ReturnDates, FromDate, Dh.MoreEntriesAvailable (), false, StartingIndex); Label FollowUpStartLabel = new Label (); this.LinkToVideosContentPlace.Controls.Add (FollowUpStartLabel); FollowUpStartLabel.Text = PagingMessage; FollowUpStartLabel.Width = Unit.Percentage (99); FollowUpStartLabel.CssClass = "CSS_FollowUpLabel"; InternetTV.CreateBeitragCover Formatieren = new InternetTV.CreateBeitragCover (); Formatieren.SetData (this.LinkToVideosContentPlace, Dh, TableForEntriesPerPage [0]); Formatieren.Create (CreateBeitragCover.FormatingStyle.ARCHIV); Label FollowUpLabel = new Label (); this.LinkToVideosContentPlace.Controls.Add (FollowUpLabel); FollowUpLabel.Text = PagingMessage; FollowUpLabel.Width = Unit.Percentage (99); FollowUpLabel.CssClass = "CSS_FollowUpLabel"; }
void PerformShowSelectionGrid (String [] Selectionen, DateTime FromDate, DateTime ToDate, int StartingIndex) { Dh = new DataHandling (); CreateSelectionTree (Dh); int NumberOfUnifiedEntries = Dh.LoadSelections (Selectionen, 0, FromDate, ToDate, "Grid"); if (NumberOfUnifiedEntries == 0) { return; } DataGrid BeitraegeGrid = new DataGrid (); this.LinkToVideosContentPlace.Controls.Add (BeitraegeGrid); BeitraegeGrid.Width = Unit.Percentage (99); BeitraegeGrid.CssClass = "CSS_BeitraegeGrid"; BeitraegeGrid.AutoGenerateColumns = true; //BeitraegeGrid.AllowPaging = true; BeitraegeGrid.AllowSorting = true; DataTable BeitraegeTable = Dh.GetBeitraegeAusArchiv (); BeitraegeGrid.DataSource = BeitraegeTable; BeitraegeGrid.DataBind (); }
void CreateSelectionTree (DataHandling Dh) { DataTable ZuordnungenUndDerenHaeufigkeit = Dh.GetZuordnungenUndDerenHaeufigkeit (); Label SelectedIs = new Label (); SelectedIs.CssClass = "CSS_SelectionLabel"; SelectedIs.Text = Session ["Selection"].ToString (); this.SelectionContentPlace.Controls.Add (SelectedIs); Label DateFromLabel = new Label (); DateFromLabel.CssClass = "CSS_SelectionLabel"; String Von = Session ["PrimaryFromDate"].ToString ().Substring (0, 10); if (Von == "01.01.0001") Von = "Beginn an"; DateFromLabel.Text = "<br>Zeit von: " + Von; this.SelectionContentPlace.Controls.Add (DateFromLabel); Label DateToLabel = new Label (); DateToLabel.CssClass = "CSS_SelectionLabel"; DateToLabel.Text = "<br>Zeit bis: " + Session ["PrimaryToDate"].ToString ().Substring (0, 10); this.SelectionContentPlace.Controls.Add (DateToLabel); TreeView AuswahlTree = new TreeView (); AuswahlTree.CssClass = "CSS_AuswahlTree"; this.SelectionContentPlace.Controls.Add (AuswahlTree); foreach (DataRow Entry in ZuordnungenUndDerenHaeufigkeit.Rows) { TreeNode Node = new TreeNode (Entry ["Name"].ToString () + " (" + Convert.ToString (Entry ["AnzahlDerEintraege"]) + ")", "", "", "Default.aspx?Selection=" + Entry ["Name"].ToString (), "_self"); AuswahlTree.Nodes.Add (Node); } AuswahlTree.Nodes.Add (new TreeNode ("Alle", "", "", "Default.aspx?Selection=All", "_self")); }
public void SetData (System.Web.UI.WebControls.PlaceHolder Anchor, DataHandling DhExisting) { }
double CalculateLengthOfProgrammAnnouncement (DataHandling.OptionsType Type) { if (!m_DataHandling.IsOptionSet (Type)) return 0; switch (Type) { case DataHandling.OptionsType.ShortAsPreText: return 8; case DataHandling.OptionsType.ShortAsPostText: return 10; case DataHandling.OptionsType.LongAsPreText: return 18; case DataHandling.OptionsType.LongAsPostText: return 20; } return 0; }
public bool SetData (String ManagedProgrammDataFileName) { m_CVM = new CommonValues(); m_ManagedProgrammDataFileName = ManagedProgrammDataFileName; m_ManagedProgrammData = WMB.Basics.DeSerializeObjectFromFile (m_ManagedProgrammDataFileName) as ManagedProgrammData; if (m_ManagedProgrammData == null) { WMB.Basics.ReportErrorToEventViewer ("HTMLCreator.SetData", "Aus dem File \"" + m_ManagedProgrammDataFileName + "\" konnte kein \"ManagedProgrammManagement\" Element erzeugt werden"); return false; } m_HTMLDirectory = Path.Combine(System.IO.Path.GetDirectoryName (System.IO.Path.GetDirectoryName (ManagedProgrammDataFileName)), CVM.CommonValues.SENDER_SUB_PATH_HTML_PROGRAMM); //m_HTMLDirectory = Path.Combine (m_HTMLDirectory, "NewVersion"); if (!Directory.Exists (m_HTMLDirectory)) Directory.CreateDirectory (m_HTMLDirectory); m_HTMLFileNameToCreate = Path.Combine (m_HTMLDirectory, HTML_PROGRAMM_SCHEMA_NAME); m_DataHandling = new DataHandling (); return true; }