コード例 #1
0
        private void GetBalanceWithdrawList(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();
            string     s             = "{\"success\":\"false\"}";
            int        type          = Globals.RequestFormNum("type");
            int        page          = Globals.RequestFormNum("page");
            int        pagesize      = Globals.RequestFormNum("pagesize");

            if (pagesize < 5)
            {
                pagesize = 10;
            }
            if (page < 1)
            {
                page = 1;
            }
            DbQueryResult result = MemberAmountProcessor.GetBalanceWithdrawListRequest(type, page, pagesize, currentMember.UserId);
            object        data   = result.Data;

            if (data != null)
            {
                DataTable     table   = (DataTable)data;
                StringBuilder builder = new StringBuilder();
                int           count   = table.Rows.Count;
                if (count > 0)
                {
                    table.Rows[0]["State"].ToString();
                    int num5 = 0;
                    builder.Append("{\"State\":" + table.Rows[num5]["State"].ToString() + ",\"id\":" + table.Rows[num5]["ID"].ToString() + ",\"Amount\":\"" + Globals.String2Json(Math.Round((decimal)table.Rows[num5]["Amount"], 2).ToString()) + "\",\"RequestTime\":\"" + DateTime.Parse(table.Rows[num5]["RequestTime"].ToString()).ToString("yyyy-MM-dd") + "\",\"RequestType\":\"" + VShopHelper.GetCommissionPayType(table.Rows[num5]["RequestType"].ToString()) + "\"}");
                    for (num5 = 1; num5 < count; num5++)
                    {
                        builder.Append(",{\"State\":" + table.Rows[num5]["State"].ToString() + ",\"id\":" + table.Rows[num5]["ID"].ToString() + ",\"Amount\":\"" + Globals.String2Json(Math.Round((decimal)table.Rows[num5]["Amount"], 2).ToString()) + "\",\"RequestTime\":\"" + DateTime.Parse(table.Rows[num5]["RequestTime"].ToString()).ToString("yyyy-MM-dd") + "\",\"RequestType\":\"" + VShopHelper.GetCommissionPayType(table.Rows[num5]["RequestType"].ToString()) + "\"}");
                    }
                }
                s = string.Concat(new object[] { "{\"success\":\"true\",\"rowtotal\":\"", table.Rows.Count, "\",\"total\":\"", result.TotalRecords, "\",\"lihtml\":[", builder.ToString(), "]}" });
            }
            context.Response.Write(s);
            context.Response.End();
        }
コード例 #2
0
        private void GetBalanceWithdrawList(System.Web.HttpContext context)
        {
            context.Response.ContentType = "application/json";
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();
            string     s             = "{\"success\":\"false\"}";
            int        type          = Globals.RequestFormNum("type");
            int        num           = Globals.RequestFormNum("page");
            int        num2          = Globals.RequestFormNum("pagesize");

            if (num2 < 5)
            {
                num2 = 10;
            }
            if (num < 1)
            {
                num = 1;
            }
            DbQueryResult balanceWithdrawListRequest = MemberAmountProcessor.GetBalanceWithdrawListRequest(type, num, num2, currentMember.UserId);
            object        data = balanceWithdrawListRequest.Data;

            if (data != null)
            {
                System.Data.DataTable     dataTable     = (System.Data.DataTable)data;
                System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
                int    count    = dataTable.Rows.Count;
                string arg_91_0 = string.Empty;
                string arg_97_0 = string.Empty;
                if (count > 0)
                {
                    dataTable.Rows[0]["State"].ToString();
                    int i = 0;
                    stringBuilder.Append(string.Concat(new string[]
                    {
                        "{\"State\":",
                        dataTable.Rows[i]["State"].ToString(),
                        ",\"id\":",
                        dataTable.Rows[i]["ID"].ToString(),
                        ",\"Amount\":\"",
                        Globals.String2Json(System.Math.Round((decimal)dataTable.Rows[i]["Amount"], 2).ToString()),
                        "\",\"RequestTime\":\"",
                        System.DateTime.Parse(dataTable.Rows[i]["RequestTime"].ToString()).ToString("yyyy-MM-dd"),
                        "\",\"RequestType\":\"",
                        VShopHelper.GetCommissionPayType(dataTable.Rows[i]["RequestType"].ToString()),
                        "\"}"
                    }));
                    for (i = 1; i < count; i++)
                    {
                        stringBuilder.Append(string.Concat(new string[]
                        {
                            ",{\"State\":",
                            dataTable.Rows[i]["State"].ToString(),
                            ",\"id\":",
                            dataTable.Rows[i]["ID"].ToString(),
                            ",\"Amount\":\"",
                            Globals.String2Json(System.Math.Round((decimal)dataTable.Rows[i]["Amount"], 2).ToString()),
                            "\",\"RequestTime\":\"",
                            System.DateTime.Parse(dataTable.Rows[i]["RequestTime"].ToString()).ToString("yyyy-MM-dd"),
                            "\",\"RequestType\":\"",
                            VShopHelper.GetCommissionPayType(dataTable.Rows[i]["RequestType"].ToString()),
                            "\"}"
                        }));
                    }
                }
                s = string.Concat(new object[]
                {
                    "{\"success\":\"true\",\"rowtotal\":\"",
                    dataTable.Rows.Count,
                    "\",\"total\":\"",
                    balanceWithdrawListRequest.TotalRecords,
                    "\",\"lihtml\":[",
                    stringBuilder.ToString(),
                    "]}"
                });
            }
            context.Response.Write(s);
            context.Response.End();
        }