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

            DbContentCatalogManager    parentCatalogManager    = new DbContentCatalogManager();
            DbContentCatalogCollection parentCatalogCollection = parentCatalogManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DbContentCatalog parentCatalog in parentCatalogCollection)
            {
                ListItem i = new ListItem(parentCatalog.ToString(), parentCatalog.ID.ToString());
                msParentCatalog.Items.Add(i);
            }

            DbContentRatingManager    ratingManager    = new DbContentRatingManager();
            DbContentRatingCollection ratingCollection = ratingManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DbContentRating rating in ratingCollection)
            {
                ComboBoxItem i = new ComboBoxItem();
                i.Text  = rating.Name;
                i.Value = rating.ID.ToString();
                ratingComboBox.Items.Add(i);
            }

            DbContentStatusManager    statusManager    = new DbContentStatusManager();
            DbContentStatusCollection statusCollection = statusManager.GetCollection(string.Empty, string.Empty);
            foreach (DbContentStatus status in statusCollection)
            {
                ListItem i = new ListItem(status.ToString(), status.ID.ToString());
                msStatus.Items.Add(i);
            }

            DbContentClipManager    clipManager = new DbContentClipManager();
            DbContentClipCollection clips       = clipManager.GetCollection(string.Empty, "Title", null);
            foreach (DbContentClip clip in clips)
            {
                referenceComboBox.Items.Add(
                    new ComboBoxItem(
                        Regex.Replace(clip.Title, "<[^>]*>", "")));
            }

            #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)
        {
            DbContentStatusManager    m = new DbContentStatusManager();
            DbContentStatusCollection dbContentStatusCollection = m.GetCollection(string.Empty, string.Empty);

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

            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (DbContentStatus dbContentStatus in dbContentStatusCollection)
            {
                if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteBeginTag("tr");
                output.WriteAttribute("i", dbContentStatus.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)
        {
            DbContentStatusManager    m = new DbContentStatusManager();
            DbContentStatusCollection dbContentStatusCollection = m.GetCollection(string.Empty, string.Empty);
            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (DbContentStatus dbContentStatus in dbContentStatusCollection)
            {
                if (dbContentStatus.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(dbContentStatus.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(dbContentStatus.ID));
                    output.Write(HtmlTextWriter.TagRightChar);
                    output.Write(dbContentStatus.ToString());
                    output.WriteEndTag("a");
                }
                else
                {
                    output.Write(dbContentStatus.ToString());
                }

                output.WriteEndTag("td");
                output.WriteLine();
                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }
Пример #4
0
        private void bindDropDownLists()
        {
            #region Bind General Child Data

            msStatus.Items.Add(new ListItem("Null", "Null"));
            DbContentStatusManager    statusManager    = new DbContentStatusManager();
            DbContentStatusCollection statusCollection = statusManager.GetCollection(string.Empty, string.Empty);
            foreach (DbContentStatus status in statusCollection)
            {
                ListItem i = new ListItem(status.ToString(), status.ID.ToString());
                msStatus.Items.Add(i);
            }

            #endregion

            #region Bind Publishing Child Data

            msParentCatalog.Items.Add(new ListItem("Null", "Null"));
            DbContentCatalogManager    parentCatalogManager    = new DbContentCatalogManager();
            DbContentCatalogCollection parentCatalogCollection = parentCatalogManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DbContentCatalog parentCatalog in parentCatalogCollection)
            {
                ListItem i = new ListItem(parentCatalog.ToString(), parentCatalog.ID.ToString());
                msParentCatalog.Items.Add(i);
            }

            msRating.Items.Add(new ListItem("Null", "Null"));
            DbContentRatingManager    ratingManager    = new DbContentRatingManager();
            DbContentRatingCollection ratingCollection = ratingManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DbContentRating rating in ratingCollection)
            {
                ListItem i = new ListItem(rating.ToString(), rating.ID.ToString());
                msRating.Items.Add(i);
            }

            msReferences.Items.Add(new ListItem("Null", "Null"));
            DbContentClipManager    referencesManager    = new DbContentClipManager();
            DbContentClipCollection referencesCollection = referencesManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DbContentClip references in referencesCollection)
            {
                ListItem i = new ListItem(references.ToString(), references.ID.ToString());
                msReferences.Items.Add(i);
            }

            #endregion

            #region Bind Contributors Child Data

            msAuthors.Items.Add(new ListItem("Null", "Null"));
            GreyFoxUserManager    authorsManager    = new GreyFoxUserManager();
            GreyFoxUserCollection authorsCollection = authorsManager.GetCollection(string.Empty, string.Empty, null);
            foreach (GreyFoxUser authors in authorsCollection)
            {
                ListItem i = new ListItem(authors.ToString(), authors.ID.ToString());
                msAuthors.Items.Add(i);
            }

            msEditors.Items.Add(new ListItem("Null", "Null"));
            GreyFoxUserManager    editorsManager    = new GreyFoxUserManager();
            GreyFoxUserCollection editorsCollection = editorsManager.GetCollection(string.Empty, string.Empty, null);
            foreach (GreyFoxUser editors in editorsCollection)
            {
                ListItem i = new ListItem(editors.ToString(), editors.ID.ToString());
                msEditors.Items.Add(i);
            }

            #endregion
        }