| | |
| | | switch (this.AppContext.GetString("action")) |
| | | { |
| | | case "exPortGwSp": |
| | | this.ExPortGwSp(); |
| | | this.ExPortGwSp(); |
| | | break; |
| | | case "exPortGwSm": |
| | | this.ExportGwSmData(); |
| | | break; |
| | | case "exportGwStatisV3"://导出统计报表 |
| | | this.ExprortGwStatisV3(); |
| | | break; |
| | | case "exportGwClient": //导出客户信息 |
| | | this.ExportGwClientData(); |
| | | break; |
| | | } |
| | | } |
| | |
| | | webTool.Export(dataTable, dictionary, "日志_" + sDate, this.Context.Response); |
| | | } |
| | | } |
| | | |
| | | //导出客户信息 |
| | | private void ExportGwClientData() |
| | | { |
| | | |
| | | string ClientID = this.AppContext.GetString("ClientID"); |
| | | string Company = this.AppContext.GetString("Company"); |
| | | string ClientName = this.AppContext.GetString("ClientName"); |
| | | string Telephone = this.AppContext.GetString("Telephone"); |
| | | string Salesman = this.AppContext.GetString("Salesman"); |
| | | string SupportStaff = this.AppContext.GetString("SupportStaff"); |
| | | string ProductId = this.AppContext.GetString("ProductId"); |
| | | string Agent = this.AppContext.GetString("Agent"); |
| | | int IsEnable = this.AppContext.GetInt("IsEnable", -1); |
| | | |
| | | int pageIndex = this.AppContext.GetInt("pageIndex", 1); |
| | | int recordCount = 0; |
| | | int pageSize = this.AppContext.GetInt("pageSize", 999999999); |
| | | |
| | | string str = ""; |
| | | using (GwClientDao dao = new GwClientDao()) |
| | | { |
| | | string permissionsSQL = dao.GetClientPermissions(_userId, _userType, "gwc"); |
| | | var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, SupportStaff, ProductId, IsEnable, permissionsSQL); |
| | | if (recordCount> 1000000) |
| | | { |
| | | this.Response.Write("<script type='text/javascript'>alert('导出数据不能大于100万条!');location.href='GwClient.aspx?IsEnable=" + IsEnable + "';</script>"); |
| | | this.Response.End(); |
| | | |
| | | } |
| | | |
| | | DataTable dataTable = dao.LoadClientDataTable(ClientID, ClientName, Telephone, Agent, Company, Salesman, SupportStaff, ProductId, IsEnable, permissionsSQL); |
| | | |
| | | WebTool webTool = new WebTool(); |
| | | Dictionary<string, string> dictionary = new Dictionary<string, string>(); |
| | | dictionary["客户账号"] = "CLIENT_ID"; |
| | | dictionary["公司名称"] = "COMPANY"; |
| | | dictionary["联系人"] = "CLIENT_NAME"; |
| | | dictionary["联系电话"] = "TELEPHONE"; |
| | | dictionary["账户余额(元)"] = "BALANCE"; //已除以1000 |
| | | dictionary["累计充值(元)"] = "TOP_UP_AMOUNT_TOTAL"; //已除以1000 |
| | | dictionary["业务员"] = "SALESMAN_NAME"; |
| | | dictionary["已分配个性产品(多个按“,”分隔) "] = "PRODUCT_IDS"; |
| | | dictionary["状态 "] = "Is_Enable"; |
| | | |
| | | string isEnableStr = ""; |
| | | if (IsEnable == 1) |
| | | { |
| | | isEnableStr = "正常"; |
| | | } |
| | | else |
| | | { |
| | | isEnableStr = "停用"; |
| | | } |
| | | webTool.Export(dataTable, dictionary, isEnableStr + "客户信息_" + DateTime.Now, this.Context.Response); |
| | | } |
| | | } |
| | | } |