Exemple #1
0
        private void FormatFourNum(int pageCount)
        {
            if (PageIndex > 1)
            {
                doc.Set("labFirst", SetType.Href, URLPara.Replace("{0}", "1"));
                doc.Set("labPrev", SetType.Href, URLPara.Replace("{0}", (PageIndex - 1).ToString()));
            }

            if (PageIndex < pageCount)
            {
                doc.Set("labNext", SetType.Href, URLPara.Replace("{0}", (_PageIndex + 1).ToString()));
                doc.Set("labLast", SetType.Href, URLPara.Replace("{0}", pageCount.ToString()));
            }
        }
Exemple #2
0
        protected override void Render(HtmlTextWriter output)
        {
            if (Page.IsPostBack || f == null)
            {
                return;
            }

            //若未指定URL格式 则按系统默认提取
            if (cs.Length == 0)
            {
                URLPara urlp = new URLPara();
                urlp.QueryStringToURLPara();
                cs = urlp.ToString("p", "{0}");
            }

            page_index    = f.um.page_index;
            page_count    = f.um.page_count;
            query_param   = "p";
            records_count = f.um.records_count;

            SetStartPage();
            SetEndPage();


            if (Style.Length == 0)
            {
                OnLoad_Default();
                Render_Default(output);
            }
            else
            {
                switch (Style.ToLower())
                {
                case "style1":
                    OnLoad_Style1();
                    Render_Style1(output);
                    break;

                case "ajax_style_1":
                    OnLoad_Ajax_Style_1();
                    Render_Ajax_Style_1(output);
                    break;

                default:
                    OnLoad_Default();
                    Render_Default(output);
                    break;
                }
            }
        }
Exemple #3
0
        public string AOnClick(string pFieldName)
        {
            string a = "location.href='{0}'";

            int fieldIndex = FnData.GetTableFieldIndex(structDt, pFieldName);

            URLPara urlp = new URLPara();

            urlp.QueryStringToURLPara();

            int searchOrderValue = Req.GetID("SearchOrderValue", 0);//0降序 1升序

            //HttpContext.Current.Response.Write(searchOrderValue + ",");

            foreach (DataColumn s in structDt.Columns)
            {
                if (string.Compare(s.ColumnName, pFieldName, true) == 0)
                {
                    searchOrderValue = searchOrderValue == 1 ? 0 : 1;
                    break;
                }
            }

            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("SearchOrderBy", fieldIndex.ToString());
            d.Add("SearchOrderValue", searchOrderValue.ToString());

            if (!urlp.d.ContainsKey("SearchOrderBy"))
            {
                urlp.d.Add("SearchOrderBy", "");
            }

            if (!urlp.d.ContainsKey("SearchOrderValue"))
            {
                urlp.d.Add("SearchOrderValue", "");
            }

            a = string.Format(a, urlp.ToString(d));

            return(a);
        }
Exemple #4
0
        private void SetNumLink(int start, int end)
        {
            string numLinks = string.Empty;

            System.Xml.XmlNode node = doc.GetByID("labForNum");
            if (node != null)
            {
                string             activeCss = doc.GetAttrValue(node, "active");
                System.Xml.XmlNode newNode   = null;
                for (int i = end; i >= start; i--)
                {
                    doc.Set("labNum", SetType.A, i.ToString(), URLPara.Replace("{0}", i.ToString()));
                    newNode = node.Clone();
                    if (i == PageIndex && activeCss.Length > 0)
                    {
                        doc.Set(newNode, SetType.Class, activeCss);
                    }
                    doc.InsertAfter(newNode, node);
                }
                doc.Remove(node);
            }
        }