Ejemplo n.º 1
0
        public static string GetPageBar(int mode, string stype, int stepNum, int totalCount, int pageSize, int currentPage, string Http1, string HttpM, string HttpN, int limitPage)
        {
            string result = "";
            int    num    = (totalCount % pageSize == 0) ? (totalCount / pageSize) : (totalCount / pageSize + 1);

            currentPage = ((currentPage > num) ? num : currentPage);
            currentPage = ((currentPage < 1) ? 1 : currentPage);
            int num2 = stepNum * 2;

            num = ((num == 0) ? 1 : num);
            int num3;
            int num4;

            if (num - num2 < 1)
            {
                num3 = 1;
                num4 = num;
            }
            else
            {
                num3 = ((currentPage - stepNum > 1) ? (currentPage - stepNum) : 1);
                num4 = ((num3 + num2 > num) ? num : (num3 + num2));
                num3 = ((num4 - num2 < num3) ? (num4 - num2) : num3);
            }
            if (mode <= 81)
            {
                switch (mode)
                {
                case 1:
                    result = PageBar.getbar1(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                    break;

                case 2:
                    result = PageBar.getbar2(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                    break;

                case 3:
                    result = PageBar.getbar3(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                    break;

                case 4:
                    result = PageBar.getbar4(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage, "cn");
                    break;

                case 5:
                    result = PageBar.getbar4(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage, "en");
                    break;

                case 6:
                    result = PageBar.getbar6(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                    break;

                default:
                    switch (mode)
                    {
                    case 80:
                        result = PageBar.getbarFFApp(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                        break;

                    case 81:
                        result = PageBar.getbarFFApp(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                        break;
                    }
                    break;
                }
            }
            else if (mode != 1004)
            {
                switch (mode)
                {
                case 1010:
                    result = PageBar.getbarHanGuo(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                    break;

                case 1011:
                    break;

                case 1012:
                    result = PageBar.getbarXinJiaPo(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                    break;

                default:
                    if (mode == 1016)
                    {
                        result = PageBar.getbarDongjing(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                    }
                    break;
                }
            }
            else
            {
                result = PageBar.getbarNiuYue(stype, stepNum, num3, num4, num, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static string GetPageBar(int mode, string stype, int stepNum, int totalCount, int pageSize, int currentPage, string Http1, string HttpM, string HttpN, int limitPage)
        {
            string str  = "";
            int    num1 = totalCount % pageSize == 0 ? totalCount / pageSize : totalCount / pageSize + 1;

            currentPage = currentPage > num1 ? num1 : currentPage;
            currentPage = currentPage < 1 ? 1 : currentPage;
            int num2      = stepNum * 2;
            int pageCount = num1 == 0 ? 1 : num1;
            int pageRoot;
            int pageFoot;

            if (pageCount - num2 < 1)
            {
                pageRoot = 1;
                pageFoot = pageCount;
            }
            else
            {
                int num3 = currentPage - stepNum > 1 ? currentPage - stepNum : 1;
                pageFoot = num3 + num2 > pageCount ? pageCount : num3 + num2;
                pageRoot = pageFoot - num2 < num3 ? pageFoot - num2 : num3;
            }
            switch (mode)
            {
            case 1:
                str = PageBar.getbar1(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;

            case 2:
                str = PageBar.getbar2(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;

            case 3:
                str = PageBar.getbar3(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;

            case 4:
                str = PageBar.getbar4(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage, "cn");
                break;

            case 5:
                str = PageBar.getbar4(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage, "en");
                break;

            case 6:
                str = PageBar.getbar6(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;

            case 80:
                str = PageBar.getbarFFApp(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;

            case 81:
                str = PageBar.getbarFFApp(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;

            case 1004:
                str = PageBar.getbarNiuYue(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;

            case 1010:
                str = PageBar.getbarHanGuo(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;

            case 1012:
                str = PageBar.getbarXinJiaPo(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;

            case 1016:
                str = PageBar.getbarDongjing(stype, stepNum, pageRoot, pageFoot, pageCount, totalCount, pageSize, currentPage, Http1, HttpM, HttpN, limitPage);
                break;
            }
            return(str);
        }