public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "ClientAccDetail"); if (!loginUser.Pass)//权限验证 { return; } //加载DataGrid if (context.Request["action"] == "gridLoad") { ClientAccDetailBLL bll = new ClientAccDetailBLL(context, loginUser); int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string agentId = context.Request["agentId"]; string siteId = context.Request["siteId"]; string clientQuery = context.Request["clientQuery"]; string clientQueryText = context.Request["clientQueryText"]; string startDate = context.Request["startDate"]; string endDate = context.Request["endDate"]; bll.LoadGrid(page, rows, agentId, siteId, clientQuery, clientQueryText, startDate, endDate); return; } //加载信息 if (context.Request["action"] == "load") { ClientAccDetailBLL bll = new ClientAccDetailBLL(context, loginUser); long flowId = long.Parse(context.Request["flowId"]);//编号 bll.Load(flowId); return; } //用户查找分类 if (context.Request["action"] == "clientQueryListLoad") { Combobox com = new Combobox(context, loginUser); com.ClientQueryCombobox(); } if (context.Request["action"] == "agentListLoad") { Combobox com = new Combobox(context, loginUser); com.AgentCombobox(); } if (context.Request["action"] == "siteListLoad") { string agentId = context.Request["agentId"]; Combobox com = new Combobox(context, loginUser); com.SiteByAgentCombobox(agentId); } } catch (Exception e) { Message.error(context, e.Message); } }
public void ProcessRequest(HttpContext context) { LoginUser loginUser = new LoginUser(context, "ClientTakeCashToBank"); if (!loginUser.Pass)//权限验证 { return; } //加载DataGrid if (context.Request["action"] == "gridLoad") { ClientTakeCashToBankBLL bll = new ClientTakeCashToBankBLL(context, loginUser); int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string agentId = context.Request["agentId"]; string siteId = context.Request["siteId"]; string clientQuery = context.Request["clientQuery"]; string clientQueryText = context.Request["clientQueryText"]; string startDate = context.Request["startDate"]; string endDate = context.Request["endDate"]; bll.LoadGrid(page, rows, agentId, siteId, clientQuery, clientQueryText, startDate, endDate); } //用户查找分类 if (context.Request["action"] == "clientQueryListLoad") { Combobox com = new Combobox(context, loginUser); com.ClientQueryCombobox(); } if (context.Request["action"] == "agentListLoad") { Combobox com = new Combobox(context, loginUser); com.AgentCombobox(); } if (context.Request["action"] == "siteListLoad") { Combobox com = new Combobox(context, loginUser); string agentId = context.Request["agentId"]; com.SiteByAgentCombobox(agentId); } if (context.Request["action"] == "TakeCash") { ClientTakeCashToBankBLL bll = new ClientTakeCashToBankBLL(context, loginUser); string flowid = context.Request["flowid"]; bll.TakeCash(flowid, loginUser.UserName); } }
public void ProcessRequest(HttpContext context) { LoginUser loginUser = new LoginUser(context, "ClientReport"); ClientBLL bll = new ClientBLL(context, loginUser); if (context.Request["action"] == "agentListLoad") { Combobox com = new Combobox(context, loginUser); com.AgentCombobox(); } if (context.Request["action"] == "siteListLoad") { string agentId = context.Request["agentId"]; Combobox com = new Combobox(context, loginUser); com.SiteByAgentCombobox(agentId); } //加载DataGrid if (context.Request["action"] == "gridLoad") { int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string startDate = context.Request["startDate"]; string endDate = context.Request["endDate"]; string agentId = context.Request["agentId"]; string siteId = context.Request["siteId"]; string status = context.Request["status"]; bll.ClientLoadGrid(page, rows, startDate, endDate, agentId, siteId, status); } if (context.Request["action"] == "ToExcel") { AgentBLL agentBLL = new AgentBLL(context, loginUser); SiteBLL siteBLL = new SiteBLL(context, loginUser); string startDate = context.Request["startDate"]; string endDate = context.Request["endDate"]; string agentId = context.Request["agentId"]; string siteId = context.Request["siteId"]; string status = context.Request["status"]; var agentName = ""; var siteName = ""; var usedStatus = "全部"; if (!string.IsNullOrEmpty(agentId)) { agentName = agentBLL.Get(agentId).agentName; } if (!string.IsNullOrEmpty(siteId)) { siteName = siteBLL.Get(siteId).siteName; } if (!string.IsNullOrEmpty(status)) { if (status == "0") { usedStatus = "激活"; } else if (status == "1") { usedStatus = "封存"; } } DataTable dt = bll.ClientReport(startDate, endDate, agentId, siteId, status); context.Response.ContentType = "application/x-excel"; string fileName = HttpUtility.UrlEncode(startDate + "至" + endDate + "客户信息报表.xls"); context.Response.AddHeader("Content-Disposition", "attachment; fileName=" + fileName); IWorkbook workbook = new HSSFWorkbook(); //创建表 ISheet sheet = workbook.CreateSheet("客户信息报表"); //设置单元的宽度 sheet.SetColumnWidth(0, 15 * 256); sheet.SetColumnWidth(1, 15 * 256); sheet.SetColumnWidth(2, 15 * 256); sheet.SetColumnWidth(3, 20 * 256); sheet.SetColumnWidth(4, 20 * 256); sheet.SetColumnWidth(5, 20 * 256); sheet.SetColumnWidth(6, 15 * 256); #region 合并单元格 CellRangeAddress regionTitle = new CellRangeAddress(0, 0, 0, 6); sheet.AddMergedRegion(regionTitle); CellRangeAddress regionDate = new CellRangeAddress(1, 1, 0, 6); sheet.AddMergedRegion(regionDate); //CellRangeAddress()该方法的参数次序是:开始行号,结束行号,开始列号,结束列号。 IRow row0 = sheet.CreateRow(0); row0.Height = 20 * 20; ICell icell1top0 = row0.CreateCell(0); icell1top0.SetCellValue("客户信息报表"); NOPIHelper.RegionMethod(workbook, sheet, regionTitle, NOPIHelper.Stylexls.标题); IRow row1 = sheet.CreateRow(1); row1.Height = 20 * 20; ICell icell1top1 = row1.CreateCell(0); icell1top1.SetCellValue("日期:" + startDate + "至" + endDate + " 代理商:" + agentName + " 执法文书类型:" + siteName + " 使用状态:" + usedStatus + ""); NOPIHelper.RegionMethod(workbook, sheet, regionDate, NOPIHelper.Stylexls.头); #endregion #region 设置表头 int rowsNum = 2; //行号 IRow row2 = sheet.CreateRow(rowsNum); row2.Height = 20 * 20; ICell icell1top = row2.CreateCell(0); icell1top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell1top.SetCellValue("客户编号"); ICell icell2top = row2.CreateCell(1); icell2top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell2top.SetCellValue("客户名称"); ICell icell3top = row2.CreateCell(2); icell3top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell3top.SetCellValue("执法文书类型"); ICell icell4top = row2.CreateCell(3); icell4top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell4top.SetCellValue("卡号"); ICell icell5top = row2.CreateCell(4); icell5top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell5top.SetCellValue("账户余额"); ICell icell6top = row2.CreateCell(5); icell6top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell6top.SetCellValue("冻结金额"); ICell icell7top = row2.CreateCell(6); icell7top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell7top.SetCellValue("使用状态"); #endregion rowsNum = 3; //行号 ICellStyle cellStyleMoney = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.钱); ICellStyle cellStyleDefault = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.默认); foreach (DataRow dr in dt.Rows) { /******************写入字段值*********************/ row2 = sheet.CreateRow(rowsNum); ICell icel1ClientId = row2.CreateCell(0); icel1ClientId.SetCellValue(dr["ClientId"].ToString()); icel1ClientId.CellStyle = cellStyleDefault; ICell icellClientName = row2.CreateCell(1); icellClientName.SetCellValue(dr["ClientName"].ToString()); icellClientName.CellStyle = cellStyleDefault; ICell icellSiteName = row2.CreateCell(2); icellSiteName.SetCellValue(dr["SiteName"].ToString()); icellSiteName.CellStyle = cellStyleDefault; ICell icel1CardId = row2.CreateCell(3); icel1CardId.SetCellValue(dr["CardId"].ToString()); icel1CardId.CellStyle = cellStyleDefault; ICell icel1Balance = row2.CreateCell(4); icel1Balance.SetCellValue(double.Parse(dr["Balance"].ToString())); icel1Balance.CellStyle = cellStyleMoney; ICell icel1LockFee = row2.CreateCell(5); icel1LockFee.SetCellValue(double.Parse(dr["LockFee"].ToString())); icel1LockFee.CellStyle = cellStyleMoney; ICell icel1Status = row2.CreateCell(6); icel1Status.SetCellValue((dr["Status"].ToString() == "0"?"激活":"封存")); icel1Status.CellStyle = cellStyleDefault; rowsNum++; } workbook.Write(context.Response.OutputStream); //输出到流中 } }
public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "SiteAdd"); if (!loginUser.Pass)//权限验证 { return; } SiteBLL bll = new SiteBLL(context, loginUser); if (context.Request["action"] == "gridLoad") { //加载DataGrid int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string siteId = context.Request["siteId"]; string siteName = context.Request["siteName"]; string auditStatus = context.Request["auditStatus"]; bll.LoadGrid(page, rows, siteId, siteName, auditStatus); } else if (context.Request["action"] == "agentListLoad") { //加载代理商列表 Combobox com = new Combobox(context, loginUser); com.AgentCombobox(); } else if (context.Request["action"] == "auditListLoad") { //加载审核状态列表 Combobox com = new Combobox(context, loginUser); com.AuditCombobox(); } else if (context.Request["action"] == "load") { //加载信息 bll.Load(context.Request["siteId"]); } else if (context.Request["action"] == "add") { //增加 TBSite tbSite = new TBSite(); tbSite.siteId = context.Request["siteId"]; tbSite.siteName = context.Request["siteName"]; tbSite.agentId = context.Request["agentId"]; tbSite.contact = context.Request["contact"]; tbSite.pointRule = int.Parse(context.Request["pointRule"]); tbSite.address = context.Request["address"]; tbSite.telephone = context.Request["telephone"]; tbSite.status = "0"; tbSite.specialArea = double.Parse(context.Request["specialArea"]); tbSite.auditStatus = ((int)AuditStauts.NotAudit).ToString(); tbSite.remark = context.Request["remark"]; bll.Add(tbSite); } else if (context.Request["action"] == "edit") { //修改 TBSite tbSite = new TBSite(); tbSite.siteId = context.Request["siteId"]; tbSite.siteName = context.Request["siteName"]; tbSite.agentId = context.Request["agentId"]; tbSite.contact = context.Request["contact"]; tbSite.pointRule = int.Parse(context.Request["pointRule"]); tbSite.address = context.Request["address"]; tbSite.telephone = context.Request["telephone"]; tbSite.status = context.Request["status"]; tbSite.auditStatus = "0"; tbSite.specialArea = double.Parse(context.Request["specialArea"]); tbSite.remark = context.Request["remark"]; bll.Edit(tbSite); } else if (context.Request["action"] == "audit") { //审核 TBSite tbSite = new TBSite(); tbSite.siteId = context.Request["siteId"]; tbSite.auditStatus = context.Request["auditStatus"]; if (tbSite.auditStatus == ((int)AuditStauts.AuditSucces).ToString()) { tbSite.status = "1"; } else { tbSite.status = "0"; } tbSite.remark = context.Request["remark"]; bll.Audit(tbSite); } else if (context.Request["action"] == "delete") { //删除 string siteId = context.Request["siteId"]; bll.Delete(siteId); } } catch (Exception e) { Message.error(context, e.Message); } }
public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "Client"); ClientBLL bll = new ClientBLL(context, loginUser); if (!loginUser.Pass)//权限验证 { return; } if (context.Request["action"] == "agentListLoad") { Combobox com = new Combobox(context, loginUser); com.AgentCombobox(); } //用户查找分类 if (context.Request["action"] == "clientQueryListLoad") { Combobox com = new Combobox(context, loginUser); com.ClientQueryCombobox(); } if (context.Request["action"] == "siteListLoad") { string agentId = context.Request["agentId"]; Combobox com = new Combobox(context, loginUser); com.SiteByAgentCombobox(agentId); } //加载DataGrid if (context.Request["action"] == "gridLoad") { int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string agentId = context.Request["agentId"]; string siteId = context.Request["siteId"]; string clientQuery = context.Request["clientQuery"]; string clientQueryText = context.Request["clientQueryText"]; string status = context.Request["status"]; string startDate = context.Request["startDate"]; string endDate = context.Request["endDate"]; bll.LoadGrid(page, rows, agentId, siteId, clientQuery, clientQueryText, status, startDate, endDate); return; } //获取账户余额积分总计 if (context.Request["action"] == "totalBalanceAndPoints") { string agentId = context.Request["agentId"]; string siteId = context.Request["siteId"]; string clientQuery = context.Request["clientQuery"]; string clientQueryText = context.Request["clientQueryText"]; string status = context.Request["status"]; string startDate = context.Request["startDate"]; string endDate = context.Request["endDate"]; var totalBalance = bll.GetTotalBalanceOrPoints(1, agentId, siteId, clientQuery, clientQueryText, status, startDate, endDate); var totalPoints = bll.GetTotalBalanceOrPoints(2, agentId, siteId, clientQuery, clientQueryText, status, startDate, endDate); context.Response.Write("{\"totalBalance\":" + totalBalance + ",\"totalPoints\":" + totalPoints + "}"); } //加载信息 if (context.Request["action"] == "load") { long clientId = long.Parse(context.Request["clientId"]);//客户编号 bll.Load(clientId); return; } } catch (Exception e) { Message.error(context, e.Message); } }