yzh
2021-10-11 6c4ea53f92500f49959013c36b5c67fed25cd791
产品分配账户
2个文件已添加
22个文件已修改
526 ■■■■■ 已修改文件
web/.vs/Web/v16/.suo 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/Dao.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwClientDao.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwClientProductDao.cs 196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/GwProductDao.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.csproj.CoreCompileInputs.cache 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Dao/obj/Debug/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Lib/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/Model.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/Model/GwClientProduct.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/obj/Debug/Model.csproj.CoreCompileInputs.cache 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/obj/Debug/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/Model/obj/Debug/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Dao.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
web/web/Bin/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwClient.ashx 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwClient.aspx 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/web/GwClient.aspx.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/.vs/Web/v16/.suo
Binary files differ
web/Dao/Dao.csproj
@@ -75,6 +75,7 @@
    <Compile Include="GwClientCertificationDao.cs" />
    <Compile Include="GwClientPayLogDao.cs" />
    <Compile Include="GwClientPayMentDao.cs" />
    <Compile Include="GwClientProductDao.cs" />
    <Compile Include="GwMobileAreaDao.cs" />
    <Compile Include="GwMoRouteDao.cs" />
    <Compile Include="GwProductDao.cs" />
web/Dao/GwClientDao.cs
@@ -24,7 +24,7 @@
        /// <param name="telphone">联系电话</param>
        /// <param name="agent">业务员</param>
        /// <returns></returns>
        public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telphone, string agent)
        public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string company, string clientName, string telphone, string agent)
        {
            List<GwClient> list = new List<GwClient>();
@@ -39,6 +39,12 @@
                    oracleParameterArray[0] = new OracleParameter(":ClientID", (OracleDbType)126);
                    ((DbParameter)oracleParameterArray[0]).Value = (object)('%' + clientID + '%');
                    stringBuilder.Append(" and CLIENT_ID like :ClientID");
                }
                if (company != null && company != "")
                {
                    oracleParameterArray[1] = new OracleParameter(":Company", (OracleDbType)126);
                    ((DbParameter)oracleParameterArray[1]).Value = (object)('%' + company + '%');
                    stringBuilder.Append(" and Company like :Company");
                }
                if (clientName != null && clientName != "")
                {
@@ -331,6 +337,7 @@
            }
            return true;
        }
    }
}
web/Dao/GwClientProductDao.cs
New file
@@ -0,0 +1,196 @@
// Decompiled with JetBrains decompiler
// Type: Dao.GwStatisV3Dao
// Assembly: Dao, Version=3.2.1.428, Culture=neutral, PublicKeyToken=c1a16487c920c3dc
// MVID: 22E6EB3F-6D25-4B57-BE09-AD2F5391CFA5
// Assembly location: C:\Users\Administrator\Desktop\wwww\bin\Dao.dll
using Common;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Oracle.DataAccess.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using Model;
namespace Dao
{
  public class GwClientProductDao : IDisposable
  {
    /**
     * 根据客户ID获取客户产品列表
     */
    public List<GwClientProduct> getClientProduct(string clientID)
    {
            string sql = "";
            sql += "select aa.*, c.balance, (c.basic_num + c.giving_num ) available_num from "
                + "( "
                + " select a.id client_product_id, a.client_id, a.sp_id, a.activate_status, "
                + " b.id product_id, b.name, b.icon, b.instructions, b.classes, b.parent_id, "
                + " b.path, b.is_default, b.is_enable, b.sort, b.giving_num, b.remark, b.api_sp_xh_id "
                + " from gw_client_product a, gw_product b "
                + " where a.product_id = b.id "
                + " ) aa "
                + " left join gw_sp c "
                + " on aa.sp_id = c.sp_id and aa.client_id = :clientId "  //参数:客户ID
                + " order by sort ";
            //return OracleHelper.Execute(sql, OracleHelper.Connection, new OracleParameter(":clientId", (object)clientID));
            List<GwClientProduct> list = new List<GwClientProduct>();
            using (OracleDataReader reader = OracleHelper.ExecuteReader(sql, OracleHelper.Connection, new OracleParameter(":clientId", (object)clientID)))
            {
                while (reader != null && ((DbDataReader)reader).Read())
                {
                    GwClientProduct gwClientProduct = new GwClientProduct();
                    OracleReaderWrapper oracleReaderWrapper = new OracleReaderWrapper(reader);
                    gwClientProduct.client_product_id = oracleReaderWrapper.GetString("client_product_id", "");
                    gwClientProduct.client_id = oracleReaderWrapper.GetString("client_id", "");
                    gwClientProduct.sp_id = oracleReaderWrapper.GetString("sp_id", "");
                    gwClientProduct.activate_status = oracleReaderWrapper.GetInt("activate_status", 0);
                    gwClientProduct.product_id = oracleReaderWrapper.GetString("product_id", "");
                    gwClientProduct.product_name = oracleReaderWrapper.GetString("name", "");
                    gwClientProduct.icon = oracleReaderWrapper.GetString("icon", "");
                    gwClientProduct.instructions = oracleReaderWrapper.GetString("instructions", "");
                    gwClientProduct.classes = oracleReaderWrapper.GetInt("classes", 0);
                    gwClientProduct.parent_id = oracleReaderWrapper.GetString("parent_id", "");
                    gwClientProduct.path = oracleReaderWrapper.GetString("path", "");
                    gwClientProduct.is_default = oracleReaderWrapper.GetInt("is_default", 0);
                    gwClientProduct.is_enable = oracleReaderWrapper.GetInt("is_enable", 0);
                    gwClientProduct.sort = oracleReaderWrapper.GetInt("sort", 0);
                    gwClientProduct.balance = oracleReaderWrapper.GetInt("balance", 0);
                    gwClientProduct.giving_num = oracleReaderWrapper.GetInt("giving_num", 0);
                    gwClientProduct.available_num = oracleReaderWrapper.GetInt("available_num", 0);
                    gwClientProduct.remark = oracleReaderWrapper.GetString("remark", "");
                    gwClientProduct.api_sp_xh_id = oracleReaderWrapper.GetString("api_sp_xh_id", "");
                    list.Add(gwClientProduct);
                }
            }
            return list;
        }
        public bool Add(GwClientProduct o)
        {
            return OracleHelper.ExecuteSql("INSERT INTO GW_CLIENT_PRODUCT(ID, CLIENT_ID, SP_ID, PRODUCT_ID, ACTIVATE_STATUS) VALUES(:ID,:CLIENT_ID,:SP_ID,:PRODUCT_ID,:ACTIVATE_STATUS)", OracleHelper.Connection,
                new OracleParameter(":ID", (object)o.client_product_id),
                new OracleParameter(":CLIENT_ID", (object)o.client_id),
                new OracleParameter(":SP_ID", (object)o.sp_id),
                new OracleParameter(":PRODUCT_ID", (object)o.product_id),
                new OracleParameter(":ACTIVATE_STATUS", (object)o.activate_status)
                ) > 0;
        }
        public bool update(GwClientProduct o)
        {
            string sql = "";
            sql += " update gw_client_product set CLIENT_ID=:CLIENT_ID, SP_ID=:SP_ID, PRODUCT_ID=:PRODUCT_ID,ACTIVATE_STATUS=:ACTIVATE_STATUS ";
            sql += " where ID=:ID ";
            return OracleHelper.ExecuteSql(sql, OracleHelper.Connection,
                new OracleParameter(":CLIENT_ID", (object)o.client_id),
                new OracleParameter(":SP_ID", (object)o.sp_id),
                new OracleParameter(":PRODUCT_ID", (object)o.product_id),
                new OracleParameter(":ACTIVATE_STATUS", (object)o.activate_status),
                new OracleParameter(":ID", (object)o.client_product_id)
                ) > 0;
        }
        /**
         * 根据客户ID获取客户产品列表
         */
        public GwClientProduct find(GwClientProduct o)
        {
            string sql = "";
            //sql += "select * from Gw_Client_Product a where a.id = :client_product_id ";
            sql += " select a.id client_product_id, a.client_id, a.sp_id, a.activate_status ";
            sql += " , b.id product_id, b.name product_name, b.icon ,b.instructions, b.classes, b.parent_id ";
            sql += " , b.path, b.is_default, b.is_enable, b.sort, b.giving_num, b.remark, b.api_sp_xh_id ";
            sql += " from gw_client_product a ";
            sql += " left join gw_product b ";
            sql += " on a.product_id = b.id ";
            sql += " where b.is_enable = :is_enable and a.id = :client_product_id ";
            //return OracleHelper.Execute(sql, OracleHelper.Connection, new OracleParameter(":clientId", (object)clientID));
            GwClientProduct gwClientProduct = new GwClientProduct();
            using (OracleDataReader reader = OracleHelper.ExecuteReader(sql, OracleHelper.Connection,
                new OracleParameter(":is_enable", (object)o.is_enable),
                new OracleParameter(":client_product_id", (object)o.client_product_id)
                ))
            {
                if (((DbDataReader)reader).Read())
                {
                    this.ReadInfo(reader, gwClientProduct);
                    return gwClientProduct;
                }
            }
            return gwClientProduct;
        }
    //数据转换封装
    private bool ReadInfo(OracleDataReader reader, GwClientProduct gwClientProduct)
    {
        OracleReaderWrapper oracleReaderWrapper = new OracleReaderWrapper(reader);
        gwClientProduct.client_product_id = oracleReaderWrapper.GetString("client_product_id", "");
        gwClientProduct.client_id = oracleReaderWrapper.GetString("client_id", "");
        gwClientProduct.sp_id = oracleReaderWrapper.GetString("sp_id", "");
        gwClientProduct.activate_status = oracleReaderWrapper.GetInt("activate_status", 0);
        gwClientProduct.product_id = oracleReaderWrapper.GetString("product_id", "");
        gwClientProduct.product_name = oracleReaderWrapper.GetString("name", "");
        gwClientProduct.icon = oracleReaderWrapper.GetString("icon", "");
        gwClientProduct.instructions = oracleReaderWrapper.GetString("instructions", "");
        gwClientProduct.classes = oracleReaderWrapper.GetInt("classes", 0);
        gwClientProduct.parent_id = oracleReaderWrapper.GetString("parent_id", "");
        gwClientProduct.path = oracleReaderWrapper.GetString("path", "");
        gwClientProduct.is_default = oracleReaderWrapper.GetInt("is_default", 0);
        gwClientProduct.is_enable = oracleReaderWrapper.GetInt("is_enable", 0);
        gwClientProduct.sort = oracleReaderWrapper.GetInt("sort", 0);
        gwClientProduct.giving_num = oracleReaderWrapper.GetInt("giving_num", 0);
        gwClientProduct.remark = oracleReaderWrapper.GetString("remark", "");
        gwClientProduct.api_sp_xh_id = oracleReaderWrapper.GetString("api_sp_xh_id", "");
            return true;
    }
    public void Dispose()
    {
    }
    public DataTable GetClientCount(string clientID)
    {
      return OracleHelper.Execute("select * from gw_client_product a where a.client_id = :clientId", OracleHelper.Connection, new OracleParameter(":clientId", (object) clientID) );
    }
        /// <summary>
        /// 检查账户产品是否存在
        /// </summary>
        /// <param name="clientID">账户</param>
        /// <returns></returns>
        public bool IsClientProductExists(string clientID, string productId)
        {
            if (string.IsNullOrEmpty(clientID) || string.Equals("0", clientID))
                return true;
            if (string.IsNullOrEmpty(productId) || string.Equals("0", productId))
                return true;
            using (OracleDataReader oracleDataReader = OracleHelper.ExecuteReader(string.Format("select * from GW_CLIENT_PRODUCT where CLIENT_ID=:CLIENT_ID AND PRODUCT_ID=:PRODUCT_ID"), OracleHelper.Connection, new OracleParameter(":CLIENT_ID", (object)clientID), new OracleParameter(":PRODUCT_ID", (object)productId)))
            {
                if (((DbDataReader)oracleDataReader).Read())
                    return true;
            }
            return false;
        }
    }
}
web/Dao/GwProductDao.cs
@@ -118,6 +118,24 @@
        }
        /**
         * 获取产品列表
         * */
        public List<GwProduct> getGwProductList()
        {
            List<GwProduct> list = new List<GwProduct>();
            using (OracleDataReader reader = OracleHelper.ExecuteReader(string.Format("select * from GW_PRODUCT where IS_ENABLE = 1 AND CLASSES=1 "), OracleHelper.Connection))
            {
                while (reader != null && ((DbDataReader)reader).Read())
                {
                    GwProduct o = new GwProduct();
                    if (this.ReadInfo(reader, o))
                        list.Add(o);
                }
            }
            return list;
        }
        /**
         * 根据产品ID获取产品信息
         * */
        public GwProduct find(string productId)
web/Dao/obj/Debug/Dao.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
99191e045427b8c77772d20e0f9eacbeab5c5bd3
2f4ee5a304a64e1617ed59777b36c0169fa3e828
web/Dao/obj/Debug/Dao.dll
Binary files differ
web/Dao/obj/Debug/Dao.pdb
Binary files differ
web/Lib/Dao.dll
Binary files differ
web/Lib/Dao.pdb
Binary files differ
web/Lib/Model.dll
Binary files differ
web/Lib/Model.pdb
Binary files differ
web/Model/Model.csproj
@@ -64,6 +64,7 @@
    <Compile Include="Model\GwClientCertification.cs" />
    <Compile Include="Model\GwClientPayLog.cs" />
    <Compile Include="Model\GwClientPayMent.cs" />
    <Compile Include="Model\GwClientProduct.cs" />
    <Compile Include="Model\GwMobileArea.cs" />
    <Compile Include="Model\GwMoRoute.cs" />
    <Compile Include="Model\GwOpGroupItem.cs" />
web/Model/Model/GwClientProduct.cs
New file
@@ -0,0 +1,51 @@

namespace Model
{
    /**
     * 账户产品信息
     */
  public class GwClientProduct
  {
        //public int id { get; set; } //账户产品表ID
        public string client_product_id { get; set; }  //账户产品ID
        public string client_id { get; set; }  //账户ID
        public string sp_id { get; set; }  //API账号ID
        public int activate_status { get; set; }    //激活状态
        public string product_id { get; set; }    //产品ID
        public string product_name { get; set; }    //产品名称
        public string icon { get; set; }    //产品图标
        public string instructions { get; set; }    //使用说明
        public int classes { get; set; }    //类别
        public string parent_id { get; set; }
        public string path { get; set; }    //产品分类路径
        public int is_default { get; set; } //是否默认
        public int is_enable { get; set; }  //是否启用
        public int sort { get; set; }   //在账户信息显示顺序,值越小越排前
        public int giving_num { get; set; } //默认赠送条数
        public string remark { get; set; }  //备注
        public int balance { get; set; } //余额
        public int available_num { get; set; }   //可用条数,基本数 + 赠送数
        public string api_sp_xh_id { get; set; }  //API账号生成规则
    }
}
web/Model/obj/Debug/Model.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
386caef0a68152082007ea9053d4fd5b4b62f129
00bfb7d603acc6cb6309f95b0c5c17d4ff8f2b67
web/Model/obj/Debug/Model.dll
Binary files differ
web/Model/obj/Debug/Model.pdb
Binary files differ
web/web/Bin/Dao.dll
Binary files differ
web/web/Bin/Dao.pdb
Binary files differ
web/web/Bin/Model.dll
Binary files differ
web/web/Bin/Model.pdb
Binary files differ
web/web/GwClient.ashx
@@ -8,6 +8,7 @@
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using Newtonsoft.Json;
@@ -25,6 +26,12 @@
            case "loadGwClientPageList":
                return LoadGwClientPageList(context);
            //待推送账户查询列表
            case "loadGwClientAllPageList":
                return LoadGwClientAllPageList(context);
            //确定推送
            case "saveClientProduct":
                return SaveClientProduct(context);
            case "save":
                return Save(context);
@@ -54,6 +61,8 @@
        }
    }
    private Dao.GwClientDao _Dao = new Dao.GwClientDao();
    private Dao.GwClientProductDao gwClientProductDao = new Dao.GwClientProductDao();
    private Dao.SysXhDao sysXhDao = new Dao.SysXhDao();
    private GwSpDao _GwSpDao = new GwSpDao();
@@ -65,6 +74,7 @@
    private JsonPageResult LoadGwClientPageList(PageContext<Model.SysUser> context)
    {
        string ClientID = context.GetString("ClientID");
        string Company = context.GetString("Company");
        string ClientName = context.GetString("ClientName");
        string Telephone = context.GetString("Telephone");
        int pageIndex = context.GetInt("pageIndex", 1);
@@ -77,7 +87,7 @@
        string str = "";
        using (GwClientDao dao = new GwClientDao())
        {
            var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent);
            var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, Company, ClientName, Telephone, Agent);
            if (list != null && list.Count > 0)
            {
@@ -124,6 +134,72 @@
    }
    /// <summary>
    /// 加载待推送产品的代理商账号列表
    /// </summary>
    /// <param name="context"></param>
    /// <returns></returns>
    private JsonPageResult LoadGwClientAllPageList(PageContext<Model.SysUser> context)
    {
        int pageIndex = context.GetInt("pageIndex", 1);
        int recordCount = 0;
        int pageSize = context.GetInt("pageSize", 20);
        string serverIp = ConfigurationManager.AppSettings["serverIp"];
        string clientPort = ConfigurationManager.AppSettings["clientPort"];
        string str = "";
        using (GwClientDao dao = new GwClientDao())
        {
            var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, null, null, null, null, null);
            if (list != null && list.Count > 0)
            {
                foreach (Model.GwClient item in list)
                {
                    string Certification_StatusResult = "未认证";
                    if (item.Certification_Status == 1)
                    {
                            Certification_StatusResult = "已认证";
                     }
                    str += "<tr><td  rowspan=\"1\" ><input type=\"checkbox\"name=\"checkbox\" value=\"" + item.ClientID + "\"/></td>" ;
                    str += @"<td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Top_up_Amount_Total + "元</td><td>" + item.Agent + "</td><td>" + Certification_StatusResult + "</td>";
                    str += @"</tr>";
                }
            }
            else
            {
                str += @"<tr><td colspan=""8"">暂无信息</td></tr>";
            }
        }
        return new JsonPageResult(true, new { Table = str.ToString(), TotalCount = recordCount });
    }
    //确定推送
    private JsonPageResult SaveClientProduct(PageContext<Model.SysUser> context)
    {
        string product_id = context.GetString("product_id");
        if (string.IsNullOrEmpty(product_id))
            throw new ArgumentException("请选择要分配的产品!");
        foreach (string clientId in JsonConvert.DeserializeObject<string[]>(context.GetString("idArray"))) {
                if(gwClientProductDao.IsClientProductExists(clientId, product_id))
            {
                    continue;
            }else {
                Model.GwClientProduct gwClientProduct = new Model.GwClientProduct();
                string client_product_id = sysXhDao.getXh("GW_CLIENT_PRODUCT");
                gwClientProduct.client_product_id = client_product_id;
                gwClientProduct.client_id = clientId;
                gwClientProduct.product_id = product_id;
                gwClientProduct.activate_status = 0;
                //保存产品分配给账户
                this.gwClientProductDao.Add(gwClientProduct);
             }
        }
        return new JsonPageResult(true, (object)"确定分配账户产品成功!");
    }
    //add 2017-10-21
web/web/GwClient.aspx
@@ -15,13 +15,14 @@
            function loadPageList() {
                var ClientID = $("#ClientID").val();
                var Company = $("#Company").val();
                var ClientName = $("#ClientName").val();
                var Telephone = $("#Telephone").val();
                var Agent = $("#Agent").val();
                $.ajax({
                    url: "GwClient.ashx",
                    type: "POST",
                    data: { action: "loadGwClientPageList", ClientID: ClientID, ClientName: ClientName, Telephone: Telephone, Agent: Agent, pageSize: $("#pager").Pager("getPageSize"), pageIndex: $("#pager").Pager("getPageIndex") },
                    data: { action: "loadGwClientPageList", ClientID: ClientID, Company: Company, ClientName: ClientName, Telephone: Telephone, Agent: Agent, pageSize: $("#pager").Pager("getPageSize"), pageIndex: $("#pager").Pager("getPageIndex") },
                    success: function(result) {
                        if (result.OK) {
                            $("#gwclientTable tbody").html(result.Message.Table);
@@ -32,6 +33,67 @@
                    }
                });
            }
            //待推送账户产品-显示账户列表
            function loadClientList() {
                $.ajax({
                    url: "GwClient.ashx",
                    type: "POST",
                    data: { action: "loadGwClientAllPageList", pageSize: $("#clientProductPager").Pager("getPageSize"), pageIndex: $("#clientProductPager").Pager("getPageIndex") },
                    success: function (result) {
                        if (result.OK) {
                            $("#gwclientProductTable tbody").html(result.Message.Table);
                            $("#clientProductPager").Pager("setTotalCount", result.Message.TotalCount);
                        } else {
                            mytek.alert(result.Message, result.OK);
                        }
                    }
                });
                $("#clientProductDialog .modal-title").text("推送账户产品");
                $("#clientProductDialog input[name=action]").val("loadGwClientAllPageList");
                $("#clientProductDialog").modal("show");
            }
            //全选
            $("#checkAll").click(function () {
                $("input[name='checkbox']").prop("checked", $(this).is(":checked"));
            });
            //保存待推送的账户
            $(document).on("click", ".action-client-save", function () {
                var idArray = [];
                $("input[name='checkbox']:checkbox:checked").each(function () {
                    var id = $(this).val();
                    idArray.push(id);
                });
                if (idArray.length == 0) {
                    mytek.alert("请选择要分配的账户!", false);
                    return false;
                }
                var product_id = $("#product_id").val();
                if (product_id == "") {
                    mytek.alert("请选择要分配的产品!", false);
                    return false;
                }
                $.ajax({
                    url: "GwClient.ashx",
                    type: "POST",
                    data: { action: "saveClientProduct", idArray: $.toJSON(idArray), product_id: product_id },
                    success: function (result) {
                        if (r.OK) {
                            $("#clientProductDialog").modal("show");
                        }
                        else {
                            mytek.alert(r.Message, r.OK);
                        }
                    }
                });
            });
            function randomString(len) {
                len = len || 32;
@@ -57,6 +119,11 @@
                    $("#clientDialog input").attr("readonly", false);
                    $("#clientDialog input[name=action]").val("save");
                    $("#clientDialog").modal("show");
                });
                //推送账户产品
                $(document).on("click", ".action-modal-client-product", function () {
                    loadClientList();
                });
                $(document).on("click", ".action-generate-password", function() {
@@ -335,6 +402,77 @@
        </form>
    </div>
    <!--推送账户产品面板 -->
    <div class="modal inmodal fade" id="clientProductDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <form name="clientProductForm" method="post" action="gwclient.ashx" id="clientProductForm" class="form-horizontal">
        <div class="modal-dialog modal-lg">
            <div class="modal-content ">
                <input name="action" value="client-product" type="hidden" />
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">
                        推送账户产品
                    </h4>
                </div>
                <div class="form-group">
                    <label class="col-sm-4 control-label">
                        选择产品</label>
                    <div class="col-sm-6  input-group">
                        <select class="form-control" name="product_id" id="product_id">
                            <%=GetGwProductOptionsAll() %>
                        </select>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover" id="gwclientProductTable">
                        <thead>
                            <tr class="header">
                                <th>
                                    <input type='checkbox' name='checkAll' id='checkAll' />
                                </th>
                                <th>
                                    客户账号
                                </th>
                                <th>公司名称</th>
                                <th>
                                    联系人
                                </th>
                                <th>
                                    联系电话
                                </th>
                                <th>
                                    累计充值
                                </th>
                                <th>
                                    业务员
                                </th>
                                <th>
                                    认证状态
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
                <div id="clientProductPager">
                </div>
                <div class="modal-footer">
                    <button class="btn btn-warning" data-dismiss="modal" aria-hidden="true">
                        取消</button>&nbsp;&nbsp;
                    <button class="btn btn-primary action-client-save">
                        确定推送</button>
                </div>
            </div>
        </div>
        </form>
    </div>
    <form name="queryForm" method="post" id="queryForm" class="form-inline">
    <div class="form-group">
        <div class="input-group m-b">
@@ -368,8 +506,9 @@
    </div>
    <div class="form-group">
        <div class="input-group m-b">
            <input type="button" value="查询" class="btn btn-primary action-query" />&nbsp
            <input class="btn btn-success action-modal-create" value="创建客户" type="button" />
            <input type="button" value="查询" class="btn btn-primary action-query" />&nbsp;&nbsp;
            <input class="btn btn-success action-modal-create" value="创建客户" type="button" />&nbsp;&nbsp;
            <input class="btn btn-success action-modal-client-product" value="推送账户产品" type="button" />
        </div>
        
    </div>
web/web/GwClient.aspx.cs
@@ -5,12 +5,35 @@
using System.Web;
using System.Web.Profile;
using System.Web.SessionState;
using Dao;
using System.Text;
using System.Collections.Generic;
public partial class _GwClient : PageBase<SysUser>, IRequiresSessionState
    protected List<GwProduct> getGwProductList;    //产品分类
    protected void Page_Load(object sender, EventArgs e)
    {
        //权限校验
        this.CheckRight("301", FailedOperation.ErrorMsgOnly);
        //获取产品
        using (GwProductDao gwProductDao = new GwProductDao())
            this.getGwProductList = gwProductDao.getGwProductList();
    }
    //产品分类下拉框数据
    public string GetGwProductOptionsAll()
    {
        StringBuilder stringBuilder = new StringBuilder();
        if (this.getGwProductList.Count == 0)
            return "<option value=''>无产品信息</option>";
        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", "", "--请选择产品--");
        foreach (GwProduct gwProduct in this.getGwProductList)
        {
            stringBuilder.AppendFormat("<option value=\"{0}\" >{0}-{1}-{2}</option>", gwProduct.id, gwProduct.name, gwProduct.is_default==0 ? "否":"默认");
        }
        return stringBuilder.ToString();
    }
}