Exemplo n.º 1
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)
        {
            GreyFoxEventManager    m = new GreyFoxEventManager(tableName);
            GreyFoxEventCollection greyFoxEventCollection = m.GetCollection(string.Empty, string.Empty, null);

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

            bool   rowflag = false;
            string rowCssClass;

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

                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }
Exemplo n.º 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)
        {
            string whereQuery = string.Empty;

            #region Construct Where Query

            if (ddSource.SelectedValue != "null")
            {
                if (whereQuery != string.Empty)
                {
                    whereQuery += " AND";
                }

                whereQuery += " " + tableName + ".Source='" + ddSource.SelectedValue + "'";
            }

            if (ddCategory.SelectedValue != "null")
            {
                if (whereQuery != string.Empty)
                {
                    whereQuery += " AND";
                }

                whereQuery += " " + tableName + ".Category='" + ddCategory.SelectedValue + "'";
            }

            #endregion

            EnsureChildControls();
            GreyFoxEventManager    m = new GreyFoxEventManager(tableName);
            GreyFoxEventCollection GreyFoxEventCollection = m.GetCollection(50, whereQuery, tableName + ".EventDate DESC", null);
            bool   rowflag = false;
            string rowCssClass;
            //
            // Render Records
            //
            foreach (GreyFoxEvent greyFoxEvent in GreyFoxEventCollection)
            {
                if (!Page.Response.IsClientConnected)
                {
                    return;
                }

                if (greyFoxEvent.ID == selectedID)
                {
                    rowCssClass = selectedRowCssClass;
                }
                else if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteBeginTag("tr");
                output.WriteAttribute("i", greyFoxEvent.ID.ToString());
                output.Write(HtmlTextWriter.TagRightChar);
                output.WriteLine();
                output.Indent++;

                //
                // Render Main Representation of Record
                //
                output.WriteBeginTag("td");
                output.WriteAttribute("valign", "top");
                output.WriteAttribute("class", rowCssClass);
                output.Write(HtmlTextWriter.TagRightChar);
                output.Write(greyFoxEvent.EventDate.ToString());
                output.Write("<br>");
                output.Write(greyFoxEvent.Source);
                output.Write("<br>");
                output.Write(greyFoxEvent.Category);
                output.WriteEndTag("td");
                output.WriteLine();

                //
                // Render ID of Record
                //
                output.WriteBeginTag("td");
                output.WriteAttribute("class", rowCssClass);
                output.WriteAttribute("valign", "top");
                output.WriteAttribute("style", "word-wrap:break-word");
                output.Write(HtmlTextWriter.TagRightChar);
                output.Write(greyFoxEvent.Description.Replace("\n", "<br>"));
                output.WriteEndTag("td");
                output.WriteLine();

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