Ejemplo n.º 1
0
        public string GetListJson(HttpContext context)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("{\"status\":1,");
            stringBuilder.Append("\"data\":[");
            int            num   = 1;
            PhotoListOrder order = PhotoListOrder.UpdateTimeDesc;

            if (!string.IsNullOrEmpty(context.Request.Form["sortby"]))
            {
                order = (PhotoListOrder)Enum.Parse(typeof(PhotoListOrder), context.Request.Form["sortby"]);
            }
            int supplierId = 0;

            if (!string.IsNullOrEmpty(context.Request.Form["supplierId"]))
            {
                supplierId = context.Request.Form["supplierId"].ToInt(0);
            }
            DbQueryResult photoList = GalleryHelper.GetPhotoList(context.Request.Form["file_Name"], context.Request.Form["id"].ToInt(0), context.Request.Form["p"].ToInt(0), 36, order, supplierId);
            int           pageCount = TemplatePageControl.GetPageCount(photoList.TotalRecords, 36);

            stringBuilder.Append(this.GetImgItemsJson(photoList, context));
            string str = stringBuilder.ToString().TrimEnd(',');

            str += "],";
            str  = str + "\"page\": \"" + this.GetPageHtml(pageCount, context) + "\",";
            str += "\"msg\": \"\"";
            return(str + "}");
        }
Ejemplo n.º 2
0
        public string GetModelJson(HttpContext context)
        {
            string text       = context.Request["client"];
            int    clientType = 1;

            if (!string.IsNullOrEmpty(text) && text.ToLower().Trim() == "appshop")
            {
                clientType = 2;
            }
            else if (!string.IsNullOrEmpty(text) && text.ToLower().Trim() == "appshoptopic")
            {
                clientType = 3;
            }
            else if (!string.IsNullOrEmpty(text) && text.ToLower().Trim() == "xcxshop")
            {
                clientType = 4;
            }
            DbQueryResult goodsTable = this.GetGoodsTable(context, clientType);
            int           pageCount  = TemplatePageControl.GetPageCount(goodsTable.TotalRecords, 8);

            if (goodsTable != null)
            {
                string str = "{\"status\":1,";
                str = str + this.GetGoodsListJson(goodsTable, clientType) + ",";
                str = str + "\"page\":\"" + this.GetPageHtml(pageCount, context) + "\"";
                return(str + "}");
            }
            return("{\"status\":1,\"list\":[],\"page\":\"\"}");
        }
Ejemplo n.º 3
0
        public string GetListJson(System.Web.HttpContext context)
        {
            int num = 21;

            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            stringBuilder.Append("{\"status\":1,");
            stringBuilder.Append("\"data\":[");
            int    num2    = Globals.RequestFormNum("type");
            int    num3    = Globals.RequestFormNum("id");
            string keyword = Globals.RequestFormStr("file_name");
            int    pageCount;

            if (num2 == 3)
            {
                DbQueryResult goodsTable = this.GetGoodsTable(context, num, keyword, num3);
                pageCount = TemplatePageControl.GetPageCount(goodsTable.TotalRecords, num);
                stringBuilder.Append(this.GetGoodsListJson(goodsTable));
            }
            else
            {
                DbQueryResult photoList = GalleryHelper.GetPhotoList(keyword, new int?(num3), System.Convert.ToInt32(context.Request.Form["p"]), num, PhotoListOrder.UploadTimeDesc, num2);
                pageCount = TemplatePageControl.GetPageCount(photoList.TotalRecords, num);
                stringBuilder.Append(this.GetImgItemsJson(photoList, context));
            }
            string str = stringBuilder.ToString().TrimEnd(new char[]
            {
                ','
            });

            str += "],";
            str  = str + "\"page\": \"" + this.GetPageHtml(pageCount, context) + "\",";
            str += "\"msg\": \"\"";
            return(str + "}");
        }
Ejemplo n.º 4
0
        public string GetListJson(HttpContext context)
        {
            int           pagesize = 0x15;
            StringBuilder builder  = new StringBuilder();

            builder.Append("{\"status\":1,");
            builder.Append("\"data\":[");
            int    type           = Globals.RequestFormNum("type");
            int    maincategoryid = Globals.RequestFormNum("id");
            string keyword        = Globals.RequestFormStr("file_name");
            int    pageCount      = 0;

            if (type == 3)
            {
                DbQueryResult goodsTable = this.GetGoodsTable(context, pagesize, keyword, maincategoryid);
                pageCount = TemplatePageControl.GetPageCount(goodsTable.TotalRecords, pagesize);
                builder.Append(this.GetGoodsListJson(goodsTable));
            }
            else
            {
                DbQueryResult mamagerRecordset = GalleryHelper.GetPhotoList(keyword, new int?(maincategoryid), Convert.ToInt32(context.Request.Form["p"]), pagesize, PhotoListOrder.UploadTimeDesc, type);
                pageCount = TemplatePageControl.GetPageCount(mamagerRecordset.TotalRecords, pagesize);
                builder.Append(this.GetImgItemsJson(mamagerRecordset, context));
            }
            return(((builder.ToString().TrimEnd(new char[] { ',' }) + "],") + "\"page\": \"" + this.GetPageHtml(pageCount, context) + "\",") + "\"msg\": \"\"" + "}");
        }
Ejemplo n.º 5
0
        public string GetModelJson(HttpContext context)
        {
            DbQueryResult graphicesTable = this.GetGraphicesTable(context);
            int           pageCount      = TemplatePageControl.GetPageCount(graphicesTable.TotalRecords, 10);

            if (graphicesTable != null)
            {
                string str = "{\"status\":1,";
                return(((str + this.GetGraphicesListJson(graphicesTable, context) + ",") + "\"page\":\"" + this.GetPageHtml(pageCount, context) + "\"") + "}");
            }
            return("{\"status\":1,\"list\":[],\"page\":\"\"}");
        }
Ejemplo n.º 6
0
        public string GetModelJson(HttpContext context)
        {
            DbQueryResult categoriesTable = this.GetCategoriesTable(context);

            TemplatePageControl.GetPageCount(categoriesTable.TotalRecords, 0x2710);
            if (categoriesTable != null)
            {
                string str = "{\"status\":1,";
                return((str + this.GetGraphicesListJson(categoriesTable, context) + ",") + "\"page\":\"\"" + "}");
            }
            return("{\"status\":1,\"list\":[],\"page\":\"\"}");
        }
Ejemplo n.º 7
0
        public string GetListJson(HttpContext context)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("{\"status\":1,");
            builder.Append("\"data\":[");
            DbQueryResult mamagerRecordset = GalleryHelper.GetPhotoList(context.Request.Form["file_Name"], new int?(Convert.ToInt32(context.Request.Form["id"])), Convert.ToInt32(context.Request.Form["p"]), 0x1c, PhotoListOrder.UploadTimeDesc);
            int           pageCount        = TemplatePageControl.GetPageCount(mamagerRecordset.TotalRecords, 0x1c);

            builder.Append(this.GetImgItemsJson(mamagerRecordset, context));
            return(((builder.ToString().TrimEnd(new char[] { ',' }) + "],") + "\"page\": \"" + this.GetPageHtml(pageCount, context) + "\",") + "\"msg\": \"\"" + "}");
        }
Ejemplo n.º 8
0
        public string GetModelJson(HttpContext context)
        {
            int       pageCount     = 0;
            DataTable exChangeTable = this.GetExChangeTable(context, ref pageCount);
            int       num2          = TemplatePageControl.GetPageCount(pageCount, 10);

            if (exChangeTable != null)
            {
                string str = "{\"status\":1,";
                return(((str + this.GetGamesListJson(exChangeTable, context) + ",") + "\"page\":\"" + this.GetPageHtml(num2, context) + "\"") + "}");
            }
            return("{\"status\":1,\"list\":[],\"page\":\"\"}");
        }
Ejemplo n.º 9
0
        public string GetModelJson(System.Web.HttpContext context)
        {
            DbQueryResult couponsTable = this.GetCouponsTable(context);
            int           pageCount    = TemplatePageControl.GetPageCount(couponsTable.TotalRecords, 10);

            if (couponsTable != null)
            {
                string str = "{\"status\":1,";
                str = str + this.GetCouponsListJson(couponsTable, context) + ",";
                str = str + "\"page\":\"" + this.GetPageHtml(pageCount, context) + "\"";
                return(str + "}");
            }
            return("{\"status\":1,\"list\":[],\"page\":\"\"}");
        }
Ejemplo n.º 10
0
        public string GetModelJson(System.Web.HttpContext context)
        {
            int totalRecords = 0;

            System.Data.DataTable exChangeTable = this.GetExChangeTable(context, ref totalRecords);
            int pageCount = TemplatePageControl.GetPageCount(totalRecords, 10);

            if (exChangeTable != null)
            {
                string str = "{\"status\":1,";
                str = str + this.GetGamesListJson(exChangeTable, context) + ",";
                str = str + "\"page\":\"" + this.GetPageHtml(pageCount, context) + "\"";
                return(str + "}");
            }
            return("{\"status\":1,\"list\":[],\"page\":\"\"}");
        }
Ejemplo n.º 11
0
        public string GetModelJson(HttpContext context)
        {
            LotteryActivityType lotteryActivityType = (LotteryActivityType)Enum.ToObject(typeof(LotteryActivityType), (context.Request.Form["type"] == null) ? 1 : context.Request.Form["type"].ToInt(0));

            if (lotteryActivityType == LotteryActivityType.Wheel || lotteryActivityType == LotteryActivityType.Scratch || lotteryActivityType == LotteryActivityType.SmashEgg)
            {
                EffectiveActivityQuery page = new EffectiveActivityQuery
                {
                    ActivityType = lotteryActivityType,
                    PageIndex    = ((context.Request.Form["p"] == null) ? 1 : Convert.ToInt32(context.Request.Form["p"])),
                    SortOrder    = SortAction.Desc,
                    SortBy       = "ActivityId",
                    PageSize     = 10
                };
                PageModel <ActivityInfo> notEndActivityList = ActivityHelper.GetNotEndActivityList(page);
                int pageCount = TemplatePageControl.GetPageCount(notEndActivityList.Total, 10);
                if (notEndActivityList.Models.Count() > 0)
                {
                    string str = "{\"status\":1,";
                    str = str + this.GetActivityListJosn(notEndActivityList.Models.ToList()) + ",";
                    str = str + "\"page\":\"" + this.GetPageHtml(pageCount, context) + "\"";
                    return(str + "}");
                }
                return("{\"status\":1,\"list\":[],\"page\":\"\"}");
            }
            DbQueryResult gamesTable = this.GetGamesTable(context);
            int           pageCount2 = TemplatePageControl.GetPageCount(gamesTable.TotalRecords, 10);

            if (gamesTable != null)
            {
                string str2 = "{\"status\":1,";
                str2 = str2 + this.GetGamesListJson(gamesTable, context) + ",";
                str2 = str2 + "\"page\":\"" + this.GetPageHtml(pageCount2, context) + "\"";
                return(str2 + "}");
            }
            return("{\"status\":1,\"list\":[],\"page\":\"\"}");
        }