Ejemplo n.º 1
0
        private void Page_Load(object sender, EventArgs e)
        {
            if (!Page.ClientScript.IsStartupScriptRegistered("selABC"))
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "selABC", "<script>function SelABCHeader(o,id){document.getElementById(id+\"ABCSelected\").value=o;document.forms[0].submit();}</script>");
            }
            TustenaRepeater ar = (TustenaRepeater)this.Parent;

            ABCSelected.Text = "<input id=\"" + this.ClientID + "ABCSelected\" name=\"" + this.ClientID + "ABCSelected\" style=\"DISPLAY:none\">";

            string ABCSel = Request.Form[this.ClientID + "ABCSelected"];

            if (Digita.Tustena.Core.StaticFunctions.IsBlank(ABCSel) && ar.FilterValue.Length == 1)
            {
                ABCSel = ar.FilterValue;
            }
            ABCLiteral.Text = ABCHeaderHtml(ABCSel, ar.AllowSearching);
            if (Page.IsPostBack && ABCSel != null && ABCSel.Length > 0)
            {
                ar.RepeaterPostEvent();
                if (ABCSel == "!")
                {
                    ar.rs.Visible = true;
                }
                else
                {
                    setFilter(ABCSel);
                }
            }
        }
Ejemplo n.º 2
0
        protected override void OnPreRender(EventArgs e)
        {
            TustenaRepeater cr = (TustenaRepeater)this.Parent.Parent.Parent;

            Elements.Text    = cr.RowCount.ToString();
            footerTd.ColSpan = 10;
            SetPageNums();
            base.OnPreRender(e);
        }
Ejemplo n.º 3
0
        private void NavButton(int increment)
        {
            TustenaRepeater cr = (TustenaRepeater)this.Parent.Parent.Parent;

            int oldPage = cr.OldPage;
            int maxNr   = cr.PageCount;
            int newPage = oldPage + increment;

            cr.DoPageChange(newPage.ToString());
        }
Ejemplo n.º 4
0
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);
            TustenaRepeater cr       = (TustenaRepeater)this.Parent.Parent.Parent;
            string          width    = string.Empty;
            string          cssClass = string.Empty;

            if (cr.CssClass != null && cr.CssClass != "")
            {
                cssClass = " class=\"" + cr.CssClass + "\"";
            }
            if (cr.Width != null && cr.Width != "")
            {
                width = " width=\"" + cr.Width + "\"";
            }
            writer.Write("<table" + cssClass + " cellpadding=0 cellspacing=0" + width + "><tr>");
        }
Ejemplo n.º 5
0
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);
            TustenaRepeater cr = (TustenaRepeater)this.Parent.Parent.Parent.Parent.Parent;

            if (this.DataCol == cr.SortColumn)
            {
                writer.Write("&nbsp;");
                if (cr.SortDirection == "asc")
                {
                    writer.Write("<img src='/images/up.gif' border='0'>");
                }
                else
                {
                    writer.Write("<img src='/images/down.gif' border='0'>");
                }
            }
        }
Ejemplo n.º 6
0
        private void setFilter(string ABCSel)
        {
            TustenaRepeater ar = (TustenaRepeater)this.Parent;


            if (ABCSel == "*")
            {
                ar.RemoveFilter();
            }

            if (ar.rs != null)
            {
                ar.rs.Visible = false;
                ar.DoSearch(ar.rs.SearchCols.Items[ar.rs.SearchCols.SelectedIndex].Value, ABCSel, true);
            }
            else if (ar.ra != null)
            {
                Repeater r = (Repeater)this.Parent.FindControl(this.Parent.ClientID + "_Repeater");
                colName = ar.FilterCol;
                populateSearchList(r);

                ar.DoSearch(colName, ABCSel, true);
            }
        }
Ejemplo n.º 7
0
        internal void SetPageNums()
        {
            if (this.footerTd.Visible)
            {
                TustenaRepeater cr      = (TustenaRepeater)this.Parent.Parent.Parent;
                int             curPage = 1;
                int             PgCount = 1;
                this.numbersHolder.Controls.Clear();
                if (!cr.isDatabinded)
                {
                    if (ViewState[this.ClientID + "CCPC"] != null)
                    {
                        string[] arr = ViewState[this.ClientID + "CCPC"].ToString().Split('|');
                        curPage = int.Parse(arr[0]);
                        PgCount = int.Parse(arr[1]);
                    }
                }
                else
                {
                    curPage = cr.CurrentPage;
                    PgCount = cr.PageCount;
                }

                ViewState[this.ClientID + "CCPC"] = curPage + "|" + PgCount;

                if (curPage == 1)
                {
                    backBtn.Visible = false;
                }
                else
                {
                    backBtn.Visible = true;
                }
                if (curPage == PgCount || PgCount < 1)
                {
                    nextBtn.Visible = false;
                }
                else
                {
                    nextBtn.Visible = true;
                }

                if (PgCount > 1)
                {
                    for (int i = 1; i <= PgCount; i++)
                    {
                        if (i > 30)
                        {
                            HtmlGenericControl spacer = new HtmlGenericControl();
                            spacer.InnerHtml = "...";
                            numbersHolder.Controls.Add(spacer);

                            break;
                        }
                        LinkButton lb = new LinkButton();

                        lb.CssClass = "repItemLink";
                        lb.ID       = cr.ClientID + "GoToPage_" + i;
                        lb.Text     = i.ToString();
                        lb.Click   += new EventHandler(cr.PageChangeHandler);
                        if (i == curPage)
                        {
                            lb.Style.Add("font-weight", "bold");
                        }
                        this.numbersHolder.Controls.Add(lb);
                        if (i != PgCount)
                        {
                            HtmlGenericControl spacer = new HtmlGenericControl();
                            spacer.InnerHtml = "&nbsp;";
                            numbersHolder.Controls.Add(spacer);
                        }
                    }
                }
            }
        }
Ejemplo n.º 8
0
        private void doSearch_Click(object sender, EventArgs e)
        {
            TustenaRepeater cr = (TustenaRepeater)this.Parent;

            cr.DoSearch(searchCols.Items[searchCols.SelectedIndex].Value, txtSearchVal.Text, false);
        }
Ejemplo n.º 9
0
        private void lb_Command(object sender, CommandEventArgs e)
        {
            TustenaRepeater rep = (TustenaRepeater)this.Parent.Parent.Parent;

            rep.innerRepeater_ItemCommand(this, (RepeaterCommandEventArgs)e);
        }