Пример #1
0
        private void bindDropDownLists()
        {
            #region Bind Default Child Data

            YariMediaTypeManager    mediaTypeManager    = new YariMediaTypeManager();
            YariMediaTypeCollection mediaTypeCollection = mediaTypeManager.GetCollection(string.Empty, string.Empty);
            foreach (YariMediaType mediaType in mediaTypeCollection)
            {
                ListItem i = new ListItem(mediaType.ToString(), mediaType.ID.ToString());
                msMediaType.Items.Add(i);
            }

            YariMediaKeywordManager    keywordsManager    = new YariMediaKeywordManager();
            YariMediaKeywordCollection keywordsCollection = keywordsManager.GetCollection(string.Empty, "Keyword");
            foreach (YariMediaKeyword keywords in keywordsCollection)
            {
                ListItem i = new ListItem(keywords.ToString(), keywords.ID.ToString());
                msKeywords.Items.Add(i);
            }

            #endregion
        }
Пример #2
0
        /// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void RenderContent(HtmlTextWriter output)
        {
            YariMediaKeywordManager    m = new YariMediaKeywordManager();
            YariMediaKeywordCollection yariMediaKeywordCollection = m.GetCollection(string.Empty, string.Empty);

            // Render Header Row
            this.headerLockEnabled = true;
            RenderRow(this.HeaderRowCssClass, );

            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (YariMediaKeyword yariMediaKeyword in yariMediaKeywordCollection)
            {
                if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteBeginTag("tr");
                output.WriteAttribute("i", yariMediaKeyword.ID.ToString());
                output.WriteLine(HtmlTextWriter.TagRightChar);
                output.Indent++;

                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }
Пример #3
0
        /// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void RenderContent(HtmlTextWriter output)
        {
            YariMediaKeywordManager    m = new YariMediaKeywordManager();
            YariMediaKeywordCollection yariMediaKeywordCollection = m.GetCollection(string.Empty, string.Empty);
            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (YariMediaKeyword yariMediaKeyword in yariMediaKeywordCollection)
            {
                if (yariMediaKeyword.ID == selectedID)
                {
                    rowCssClass = selectedRowCssClass;
                }
                else if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteFullBeginTag("tr");
                output.WriteLine();
                output.Indent++;
                //
                // Render ID of Record
                //
                // output.WriteBeginTag("td");
                // output.WriteAttribute("class", rowCssClass);
                // output.Write(HtmlTextWriter.TagRightChar);
                // output.Write(yariMediaKeyword.ID);
                // output.WriteEndTag("td");
                // output.WriteLine();
                //
                // Render Main Representation of Record
                //
                output.WriteBeginTag("td");
                output.WriteAttribute("valign", "top");
                output.WriteAttribute("class", rowCssClass);
                output.Write(HtmlTextWriter.TagRightChar);

                if (selectEnabled)
                {
                    output.WriteBeginTag("a");
                    output.WriteAttribute("href", "javascript:" + GetSelectReference(yariMediaKeyword.ID));
                    output.Write(HtmlTextWriter.TagRightChar);
                    output.Write(yariMediaKeyword.ToString());
                    output.WriteEndTag("a");
                }
                else
                {
                    output.Write(yariMediaKeyword.ToString());
                }

                output.WriteEndTag("td");
                output.WriteLine();
                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }