protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { AgencyBLL aBLL = new AgencyBLL(); Agency agency = aBLL.GetAgency(); if (agency != null) { this.LitAgencyName.Text = agency.AgencyName; this.LitAddressLine1.Text = agency.AddressLine1; this.LitProvinceState.Text = string.Format("{0}, {1}, {2}", agency.City, agency.StateProvince, agency.PostalCode); this.LitPhone1.Text = (!string.IsNullOrEmpty(agency.Phone1))? String.Format("{0:(###) ###-####}", Double.Parse(agency.Phone1)):string.Empty; this.LitFax.Text = (!string.IsNullOrEmpty(agency.Fax))? String.Format("{0:(###) ###-####}", Double.Parse(agency.Fax)):string.Empty; this.rdContact1.Checked = true; this.lblResultMail.Text = String.Empty; } AgentBLL objAgent = new AgentBLL(); Agent agent = objAgent.GetAgentInfo(); if (agent != null) { this.LitAgentName.Text = String.Format("{0} {1}", agent.FirstName, agent.LastName); this.LitPhoneCel.Text = String.Format("{0:(###) ###-####}", Double.Parse(agent.CellPhone)); } } this.txtMailName.Focus(); }
public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "AgentTakeCash"); if (!loginUser.Pass)//权限验证 { return; } //加载DataGrid if (context.Request["action"] == "gridLoad") { AgentBLL bll = new AgentBLL(context, loginUser); //加载DataGrid int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string auditStauts = context.Request["auditStauts"]; string agentId = context.Request["agentId"]; string agentName = context.Request["agentName"]; string bankCardId = context.Request["bankCardId"]; bll.LoadGrid(page, rows, agentName, agentId, bankCardId, auditStauts); return; } if (context.Request["action"] == "handleModeListLoad") { AgentTakeCashBLL bll = new AgentTakeCashBLL(context, loginUser); bll.HandleModeCombobox(); } else if (context.Request["action"] == "load") { AgentBLL bll = new AgentBLL(context, loginUser); //加载信息 bll.Load(context.Request["agentId"]); } //增加 if (context.Request["action"] == "add") { AgentTakeCashBLL bll = new AgentTakeCashBLL(context, loginUser); TTAgentTakeCash ttAgentTakeCash = new TTAgentTakeCash(); ttAgentTakeCash.agentId = context.Request["agentId"]; //代理商编号 ttAgentTakeCash.fee = double.Parse(context.Request["fee"]); //发生金额 ttAgentTakeCash.operatorId = loginUser.UserId;; //操作人编号 ttAgentTakeCash.operatorName = loginUser.UserName; //操作人名称 ttAgentTakeCash.createTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //创建时间 ttAgentTakeCash.handleMode = context.Request["handleMode"]; //充值方式 ttAgentTakeCash.bankAccountId = context.Request["bankCardId"]; //银行账号 ttAgentTakeCash.bankFlowId = context.Request["bankFlowId"]; //银行流水号 ttAgentTakeCash.description = context.Request["description"]; //说明 //bll.Add(ttAgentTakeCash);暂去 return; } } catch (Exception e) { Message.error(context, e.Message); } }
public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "AgentAudit"); if (!loginUser.Pass)//权限验证 { return; } AgentBLL bll = new AgentBLL(context, loginUser); if (context.Request["action"] == "gridLoad") { //加载DataGrid int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string agentId = context.Request["agentId"]; string agentName = context.Request["agentName"]; bll.LoadGrid(page, rows, agentName, agentId, "", ((int)AuditStauts.NotAudit).ToString()); } else if (context.Request["action"] == "areaListLoad") { //加载区域列表 Combobox com = new Combobox(context, loginUser); com.AreaCombobox(); } else if (context.Request["action"] == "auditListLoad") { //加载审核状态列表 Combobox com = new Combobox(context, loginUser); com.AuditCombobox(); } else if (context.Request["action"] == "load") { //加载信息 bll.Load(context.Request["agentId"]); } else if (context.Request["action"] == "audit") { //审核 TBAgent agent = new TBAgent(); agent.agentId = context.Request["agentId"]; agent.auditStatus = context.Request["auditStatus"]; agent.status = "0"; if (agent.auditStatus == ((int)AuditStauts.AuditSucces).ToString()) { agent.status = "1"; } agent.remark = context.Request["remark"]; bll.Audit(agent); } } catch (Exception e) { Message.error(context, e.Message); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { AgentBLL aBll = new AgentBLL(); Agent agent = aBll.GetAgentInfo(); this.LitCell.Text = String.Format("{0:(###) ###-####}", Double.Parse(agent.CellPhone)); //this.LitOffice.Text = String.Format("{0:(###) ###-####}", Double.Parse(agent.WorkPhone)); } }
private void BandingReports(string agentName) { AgentBLL bll = new AgentBLL(context, loginSession); System.Data.DataSet ds = new DataSet(); ds = bll.GetDataSet(agentName); this.ReportViewer1.Reset(); this.ReportViewer1.LocalReport.ReportPath = @"Reports\AgentAccount.rdlc"; this.ReportViewer1.LocalReport.DisplayName = "代理商账户"; ReportDataSource rds = new ReportDataSource("AgentDataSet", ds.Tables[0]); this.ReportViewer1.LocalReport.DataSources.Add(rds); this.ReportViewer1.LocalReport.Refresh(); }
private void LoadData() { AgentEntity oAgent = (AgentEntity)AgentBLL.GetAgent(Convert.ToInt32(hdnAgentID.Value)); //ddlFromLocation.SelectedIndex = Convert.ToInt32(ddlFromLocation.Items.IndexOf(ddlFromLocation.Items.FindByValue(oImportHaulage.LocationFrom))); hdnFPOD.Value = oAgent.FPODID.ToString(); ddlLine.SelectedValue = oAgent.LinerID.ToString(); txtAddress.Text = Convert.ToString(oAgent.AgentAddress); txtContPerson.Text = Convert.ToString(oAgent.ContactPerson); txtPhone.Text = Convert.ToString(oAgent.Phone); txtEmail.Text = Convert.ToString(oAgent.email); txtFax.Text = Convert.ToString(oAgent.FAX); txtAgent.Text = Convert.ToString(oAgent.AgentName); txtFPOD.Text = Convert.ToString(oAgent.FPOD); hdnAgentID.Value = Convert.ToString(oAgent.AgentID); }
private void LoadAgent() { if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null)) { SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; if (!ReferenceEquals(searchCriteria, null)) { BuildSearchCriteria(searchCriteria); CommonBLL commonBll = new CommonBLL(); gvwAgent.PageIndex = searchCriteria.PageIndex; if (searchCriteria.PageSize > 0) { gvwAgent.PageSize = searchCriteria.PageSize; } gvwAgent.DataSource = AgentBLL.GetAgent(searchCriteria, 0); gvwAgent.DataBind(); } } }
public JsonResult LoadData(string companyName, int?countryId, int?stateId, int?cityId, GridPager pager) { List <AgentViewModel> agentList = new AgentBLL().GetAgentPersonPager(companyName, countryId, stateId, cityId, ref pager); if (agentList == null || agentList.Count <= 0) { return(Json(new List <AgentViewModel>().ToGridJson(pager))); } var areaBll = new AreaBLL(); var countryIds = agentList.Select(t => t.CountryId).ToList(); var countryList = areaBll.GetCountrysByIds(countryIds); var stateList = areaBll.GetStatesByCountryIds(countryIds); var stateIds = stateList.Select(t => t.Id).ToList(); var cityList = areaBll.GetCitysByStateIds(stateIds); var obj = agentList.ToGridJson(pager, r => new { id = r.Id, cell = new { Id = r.Id, AgentCode = r.AgentCode, CompanyName = r.CompanyName, CountryName = countryList.Where(t => t.Id == r.CountryId).Select(t => t.Name).FirstOrDefault(), StateName = stateList.Where(t => t.Id == r.StateId).Select(t => t.Name).FirstOrDefault(), CityName = cityList.Where(t => t.Id == r.CityId).Select(t => t.Name).FirstOrDefault(), ContactName = r.ContactName, ContactWay = r.ContactWay, SaleName = r.SaleName, CreateTime = r.CreateTime.ToString("yyyy-MM-dd") } }); return(Json(obj)); }
public void ProcessRequest(HttpContext context) { LoginUser loginUser = new LoginUser(context, "SalesInvoiceSummaryReport"); LotteryOrderBLL bll = new LotteryOrderBLL(context, loginUser); //加载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 city = context.Request["cityId"]; string county = context.Request["countyId"]; string siteId = context.Request["siteId"]; string agentId = context.Request["agentId"]; string terminalId = context.Request["terminalId"]; bll.SalesInvoiceSummaryLoadGrid(page, rows, startDate, endDate, city, county, siteId, agentId, terminalId); } //获取销售总计 if (context.Request["action"] == "totalSale") { string startDate = context.Request["startDate"]; string endDate = context.Request["endDate"]; string city = context.Request["cityId"]; string county = context.Request["countyId"]; string siteId = context.Request["siteId"]; string agentId = context.Request["agentId"]; string terminalId = context.Request["terminalId"]; DataTable dt = bll.GetCommissionTotalSale(startDate, endDate, city, county, siteId, agentId, terminalId); DataRow dr = dt.Rows[0]; context.Response.Write("{\"totalSumbetfee\":" + dr["totalSumbetfee"] + ",\"totalCommissionFee\":" + dr["totalCommissionFee"] + ",\"totalAwardAmount\":" + dr["totalAwardAmount"] + ",\"totalSumTakeCashFee\":" + dr["totalSumTakeCashFee"] + ",\"totalRefundAmount\":" + dr["totalRefundAmount"] + "}"); } //加载市 if (context.Request["action"] == "cityListLoad") { Combobox com = new Combobox(context, loginUser); com.CityCombobox(); } //加载区县 if (context.Request["action"] == "countyListLoad") { string cityId = context.Request["cityId"]; Combobox com = new Combobox(context, loginUser); com.CountyCombobox(cityId); } //加载执法文书类型 if (context.Request["action"] == "siteListLoad") { Combobox com = new Combobox(context, loginUser); string cityId = context.Request["cityId"]; string countyId = context.Request["countyId"]; com.SiteByAreaCombobox(cityId, countyId); } if (context.Request["action"] == "ToExcel") { string startDate = context.Request["startDate"]; string endDate = context.Request["endDate"]; string city = context.Request["cityId"]; string county = context.Request["countyId"]; string siteId = context.Request["siteId"]; string agentId = context.Request["agentId"]; string terminalId = context.Request["terminalId"]; AgentAccDetailBLL agentAccDetailBLL = new AgentAccDetailBLL(context, loginUser); DataTable dt = bll.SalesInvoiceSummaryReport(startDate, endDate, city, county, siteId, agentId, terminalId); //获取预存款余额 List <TTAgentAccDetail> balanceList = agentAccDetailBLL.GetTTAgentAccDetailList(city, county, siteId, agentId, terminalId); int dtRowsCount = dt.Rows.Count + 5; 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, 20 * 256); sheet.SetColumnWidth(1, 20 * 256); sheet.SetColumnWidth(2, 20 * 256); sheet.SetColumnWidth(3, 20 * 256); sheet.SetColumnWidth(4, 20 * 256); sheet.SetColumnWidth(5, 20 * 256); sheet.SetColumnWidth(6, 20 * 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 regionSearch = new CellRangeAddress(2, 2, 0, 6); sheet.AddMergedRegion(regionSearch); //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 + ""); NOPIHelper.RegionMethod(workbook, sheet, regionDate, NOPIHelper.Stylexls.头); IRow row2 = sheet.CreateRow(2); row2.Height = 20 * 20; ICell icell1top2 = row2.CreateCell(0); var cityName = ""; var countyName = ""; var agentName = ""; var siteName = ""; AgentBLL agentBLL = new AgentBLL(context, loginUser); SiteBLL siteBLL = new SiteBLL(context, loginUser); AreaBLL areaBLL = new AreaBLL(context, loginUser); if (!string.IsNullOrEmpty(agentId)) { var agent = agentBLL.Get(agentId); if (agent != null) { agentName = agent.agentName; } } if (!string.IsNullOrEmpty(siteId)) { siteName = siteBLL.Get(siteId).siteName; } if (!string.IsNullOrEmpty(city)) { cityName = areaBLL.Get(city).areaName; } if (!string.IsNullOrEmpty(county)) { countyName = areaBLL.Get(county).areaName; } icell1top2.SetCellValue("市:" + cityName + " 区县:" + countyName + " 执法文书类型:" + siteName + " 代理商编号:" + agentName + " 终端号:" + terminalId + "");//搜索条件 NOPIHelper.RegionMethod(workbook, sheet, regionSearch, NOPIHelper.Stylexls.头); #endregion #region 设置表头 int rowsNum = 3; //行号 IRow row3 = sheet.CreateRow(rowsNum); row3.Height = 20 * 20; ICell icell1top = row3.CreateCell(0); icell1top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell1top.SetCellValue("时间"); ICell icell2top = row3.CreateCell(1); icell2top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell2top.SetCellValue("预存款金额"); ICell icell3top = row3.CreateCell(2); icell3top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell3top.SetCellValue("销售总额"); ICell icell4top = row3.CreateCell(3); icell4top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell4top.SetCellValue("佣金金额"); ICell icell5top = row3.CreateCell(4); icell5top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell5top.SetCellValue("中奖金额"); ICell icell6top = row3.CreateCell(5); icell6top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell6top.SetCellValue("提现金额"); ICell icell7top = row3.CreateCell(6); icell7top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell7top.SetCellValue("退款金额"); #endregion #region 合计 rowsNum = 4; //行号 IRow row4 = sheet.CreateRow(rowsNum); row4.Height = 20 * 20; ICell icell1Total = row4.CreateCell(0); icell1Total.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell1Total.SetCellValue("合计"); ICell icell2Total = row4.CreateCell(1); icell2Total.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头); icell2Total.SetCellValue(""); ICell icell3Total = row4.CreateCell(2); icell3Total.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.钱); icell3Total.SetCellFormula("SUM(C6:C" + dtRowsCount + ")"); ICell icell4Total = row4.CreateCell(3); icell4Total.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.钱); icell4Total.SetCellFormula("SUM(D6:D" + dtRowsCount + ")"); ICell icell5Total = row4.CreateCell(4); icell5Total.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.钱); icell5Total.SetCellFormula("SUM(E6:E" + dtRowsCount + ")"); ICell icell6Total = row4.CreateCell(5); icell6Total.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.钱); icell6Total.SetCellFormula("SUM(F6:F" + dtRowsCount + ")"); ICell icell7Total = row4.CreateCell(6); icell7Total.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.钱); icell7Total.SetCellFormula("SUM(G6:G" + dtRowsCount + ")"); #endregion ICellStyle cellStyleMoney = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.钱); ICellStyle cellStyleTime = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.时间); ICellStyle cellStyleDefault = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.默认); rowsNum = 5; foreach (DataRow dr in dt.Rows) { /******************写入字段值*********************/ row4 = sheet.CreateRow(rowsNum); ICell icel1DateDay = row4.CreateCell(0); icel1DateDay.SetCellValue(dr["dateday"].ToString()); icel1DateDay.CellStyle = cellStyleTime; var balanceGroupList = balanceList.Where(c => DateTime.Parse(c.createTime.Substring(0, 10)) <= DateTime.Parse(dr["dateday"].ToString())) .OrderByDescending(x => x.createTime).GroupBy(x => x.agentId)//必须排序 .Select(g => new { g, count = g.Count() }) .SelectMany(t => t.g.Select(b => b) .Zip(Enumerable.Range(1, t.count), (j, i) => new { j.balance, j.createTime, rn = i })); var advanceBalance = balanceGroupList.Where(c => c.rn == 1).Sum(c => c.balance); ICell icellAdvanceBalance = row4.CreateCell(1); icellAdvanceBalance.SetCellValue(advanceBalance); icellAdvanceBalance.CellStyle = cellStyleMoney; ICell icellSumBetFee = row4.CreateCell(2); icellSumBetFee.SetCellValue(double.Parse(dr["sumBetFee"].ToString())); icellSumBetFee.CellStyle = cellStyleMoney; ICell icel1CommissionFee = row4.CreateCell(3); icel1CommissionFee.SetCellValue(double.Parse(dr["commissionFee"].ToString())); icel1CommissionFee.CellStyle = cellStyleMoney; ICell icel1AwardAmount = row4.CreateCell(4); icel1AwardAmount.SetCellValue(double.Parse(dr["awardAmount"].ToString())); icel1AwardAmount.CellStyle = cellStyleMoney; ICell icel1SumTakeCashFee = row4.CreateCell(5); icel1SumTakeCashFee.SetCellValue(double.Parse(dr["sumTakeCashFee"].ToString())); icel1SumTakeCashFee.CellStyle = cellStyleMoney; ICell icel1RefundAmount = row4.CreateCell(6); icel1RefundAmount.SetCellValue(double.Parse(dr["refundAmount"].ToString())); icel1RefundAmount.CellStyle = cellStyleMoney; rowsNum++; } workbook.Write(context.Response.OutputStream); //输出到流中 } }
private void DeleteAgent(int locId) { AgentBLL.DeleteAgent(locId); LoadAgent(); ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00010") + "');</script>", false); }
public JsonResult Delete(int id) { var sr = new AgentBLL().Delete(id, UserId, UserName); return(Json(sr.toJson())); }
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, "AgentAdd"); if (!loginUser.Pass)//权限验证 { return; } AgentBLL bll = new AgentBLL(context, loginUser); if (context.Request["action"] == "gridLoad") { //加载DataGrid int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string agentName = context.Request["agentName"]; string agentId = context.Request["agentId"]; string auditStatus = context.Request["auditStatus"]; bll.LoadGrid(page, rows, agentName, agentId, "", auditStatus); } else if (context.Request["action"] == "areaListLoad") { //加载区域列表 Combobox com = new Combobox(context, loginUser); com.AreaCombobox(); } else if (context.Request["action"] == "auditListLoad") { //加载审核状态列表 Combobox com = new Combobox(context, loginUser); com.AuditCombobox(); } else if (context.Request["action"] == "load") { //加载信息 bll.Load(context.Request["agentId"]); } else if (context.Request["action"] == "add") { //增加 TBAgent agent = new TBAgent(); TSAgentUser tsAgentUser = new TSAgentUser(); agent.agentId = context.Request["agentId"]; agent.agentName = context.Request["agentName"]; agent.rebate = double.Parse(context.Request["rebate"]); agent.warnValue = double.Parse(context.Request["warnValue"]); agent.contact = context.Request["contact"]; agent.telephone = context.Request["telephone"]; agent.areaId = context.Request["areaId"]; agent.address = context.Request["address"]; agent.IDNumber = context.Request["IDNumber"]; agent.bankCardId = context.Request["bankCardId"]; agent.bankName = context.Request["bankName"]; agent.status = "0"; agent.fixedLine = context.Request["fixedLine"]; agent.remark = context.Request["remark"]; tsAgentUser.roleId = "001"; tsAgentUser.userCode = context.Request["agentUserCode"]; tsAgentUser.userPwd = tsAgentUser.userCode; bll.Add(agent, tsAgentUser); } else if (context.Request["action"] == "edit") { //修改 TBAgent agent = new TBAgent(); agent.agentId = context.Request["agentId"]; agent.agentName = context.Request["agentName"]; agent.rebate = double.Parse(context.Request["rebate"]); agent.contact = context.Request["contact"]; agent.telephone = context.Request["telephone"]; agent.areaId = context.Request["areaId"]; agent.address = context.Request["address"]; agent.IDNumber = context.Request["IDNumber"]; agent.bankCardId = context.Request["bankCardId"]; agent.bankName = context.Request["bankName"]; agent.status = context.Request["status"]; agent.warnValue = double.Parse(context.Request["warnValue"]); agent.auditStatus = "0"; agent.fixedLine = context.Request["fixedLine"]; agent.remark = context.Request["remark"]; bll.Edit(agent); } else if (context.Request["action"] == "delete") { //删除 string agentId = context.Request["agentId"]; bll.Delete(agentId); } } catch (Exception e) { Message.error(context, e.Message); } }
public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "AgentPreRechg"); if (!loginUser.Pass)//权限验证 { return; } //加载DataGrid if (context.Request["action"] == "gridLoad") { AgentBLL bll = new AgentBLL(context, loginUser); //加载DataGrid int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string agentId = context.Request["agentId"]; string agentName = context.Request["agentName"]; string bankCardId = context.Request["bankCardId"]; bll.LoadGrid(page, rows, agentName, agentId, bankCardId, ((int)AuditStauts.AuditSucces).ToString()); return; } if (context.Request["action"] == "handleModeListLoad") { Combobox com = new Combobox(context, loginUser); com.HandleModeCombobox(); } //加载信息 if (context.Request["action"] == "load") { AgentBLL bll = new AgentBLL(context, loginUser); //加载信息 bll.Load(context.Request["agentId"]); } //增加 if (context.Request["action"] == "add") { AgentPreRechgBLL bll = new AgentPreRechgBLL(context, loginUser); TTAgentPreRechg ttAgentPreRechg = new TTAgentPreRechg(); ttAgentPreRechg.agentId = context.Request["agentId"]; //代理商编号 ttAgentPreRechg.agentName = context.Request["agentName"]; //代理商名称 ttAgentPreRechg.fee = double.Parse(context.Request["fee"]); //发生金额 ttAgentPreRechg.handleMode = context.Request["handleMode"]; //充值方式 ttAgentPreRechg.operatorId = loginUser.UserId;; //操作人编号 ttAgentPreRechg.operatorName = loginUser.UserName; //操作人名称 ttAgentPreRechg.bankAccountId = context.Request["bankCardId"]; //银行账号 ttAgentPreRechg.bankFlowId = context.Request["bankFlowId"]; //银行流水号 ttAgentPreRechg.description = context.Request["description"]; //说明 bll.Add(ttAgentPreRechg); return; } //修改 if (context.Request["action"] == "edit") { AgentPreRechgBLL bll = new AgentPreRechgBLL(context, loginUser); TTAgentPreRechg ttAgentPreRechg = new TTAgentPreRechg(); ttAgentPreRechg.flowId = long.Parse(context.Request["flowId"]); //流水号 ttAgentPreRechg.agentId = context.Request["agentId"]; //代理商编号 ttAgentPreRechg.agentName = context.Request["agentName"]; //代理商名称 ttAgentPreRechg.fee = double.Parse(context.Request["fee"]); //发生金额 ttAgentPreRechg.operatorId = context.Request["operatorId"]; //操作人编号 ttAgentPreRechg.operatorName = context.Request["operatorName"]; //操作人名称 ttAgentPreRechg.createTime = context.Request["createTime"]; //创建时间 ttAgentPreRechg.handleMode = context.Request["handleMode"]; //充值方式 ttAgentPreRechg.bankAccountId = context.Request["bankAccountId"]; //银行账号 ttAgentPreRechg.bankFlowId = context.Request["bankFlowId"]; //银行流水号 ttAgentPreRechg.description = context.Request["description"]; //说明 ttAgentPreRechg.auditStatus = context.Request["auditStatus"]; //审核状态 bll.Edit(ttAgentPreRechg); return; } //删除 if (context.Request["action"] == "delete") { AgentPreRechgBLL bll = new AgentPreRechgBLL(context, loginUser); long flowId = long.Parse(context.Request["flowId"]);//流水号 bll.Delete(flowId); return; } } catch (Exception e) { Message.error(context, e.Message); } }
public void ProcessRequest(HttpContext context) { try { LoginUser loginUser = new LoginUser(context, "AgentOam"); if (!loginUser.Pass)//权限验证 { return; } AgentBLL bll = new AgentBLL(context, loginUser); if (context.Request["action"] == "gridLoad") { //加载DataGrid int page = int.Parse(context.Request["page"]); int rows = int.Parse(context.Request["rows"]); string agentId = context.Request["agentId"]; string agentName = context.Request["agentName"]; bll.LoadGrid(page, rows, agentName, agentId, "", ((int)AuditStauts.AuditSucces).ToString()); } else if (context.Request["action"] == "areaListLoad") { //加载区域列表 bll.AreaCombobox(); } else if (context.Request["action"] == "auditListLoad") { //加载审核状态列表 bll.AuditCombobox(); } else if (context.Request["action"] == "load") { //加载信息 bll.Load(context.Request["agentId"]); } else if (context.Request["action"] == "edit") { //修改 TBAgent agent = new TBAgent(); agent.agentId = context.Request["agentId"]; agent.agentName = context.Request["agentName"]; agent.rebate = double.Parse(context.Request["rebate"]); agent.contact = context.Request["contact"]; agent.telephone = context.Request["telephone"]; agent.areaId = context.Request["areaId"]; agent.address = context.Request["address"]; agent.IDNumber = context.Request["IDNumber"]; agent.bankCardId = context.Request["bankCardId"]; agent.bankName = context.Request["bankName"]; agent.status = context.Request["status"]; agent.auditStatus = ((int)AuditStauts.AuditSucces).ToString(); agent.fixedLine = context.Request["fixedLine"]; agent.remark = context.Request["remark"]; bll.Edit(agent); } } catch (Exception e) { Message.error(context, e.Message); } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { //if (Convert.ToDecimal(txtWFrom.Text) > Convert.ToDecimal(txtWTo.Text)) //{ // ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00077") + "');</script>", false); // return; //} oAgentBll = new AgentBLL(); oAgentEntity = new AgentEntity(); //oUserEntity = (UserEntity)Session[Constants.SESSION_USER_INFO]; // This section has been commented temporarily oAgentEntity.LinerID = ddlLine.SelectedValue.ToInt(); oAgentEntity.FPODID = hdnFPOD.Value; oAgentEntity.AgentAddress = txtAddress.Text.ToString(); oAgentEntity.AgentName = Convert.ToString(txtAgent.Text.Trim()); oAgentEntity.ContactPerson = Convert.ToString(txtContPerson.Text.Trim()); oAgentEntity.AgentStatus = true; oAgentEntity.Phone = Convert.ToString(txtPhone.Text); oAgentEntity.FAX = Convert.ToString(txtFax.Text); oAgentEntity.email = Convert.ToString(txtEmail.Text); if (hdnAgentID.Value == "0") // Insert { oAgentEntity.CreatedBy = _userId; // oUserEntity.Id; oAgentEntity.CreatedOn = DateTime.Today.Date; oAgentEntity.ModifiedBy = _userId; // oUserEntity.Id; oAgentEntity.ModifiedOn = DateTime.Today.Date; switch (oAgentBll.AddEditAgent(oAgentEntity, _CompanyId)) { case -1: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00076"); break; case 0: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00011"); ClearAll(); break; case 1: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00009"); ClearAll(); break; } } else // Update { oAgentEntity.AgentID = Convert.ToInt32(hdnAgentID.Value); oAgentEntity.ModifiedBy = _userId;// oUserEntity.Id; oAgentEntity.ModifiedOn = DateTime.Today.Date; oAgentEntity.Action = true; // switch (oAgentBll.AddEditAgent(oAgentEntity, _CompanyId)) { case -1: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00076"); break; case 0: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00011"); break; case 1: Response.Redirect("~/Export/ManageAgent.aspx"); break; } } } }