//读取其他银行信息 private void loadOtherLink() { string id = Request.QueryString["id"].ToString(); DataTable dt = CusBankManager.getList(Convert.ToInt32(id)); if (dt.Rows.Count > 0) { HtmlTableRow row = null; HtmlTableCell cell = null; for (int i = 0; i < dt.Rows.Count; i++) { row = new HtmlTableRow(); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["bank"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["cardId"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["cardName"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["remark"].ToString(); row.Controls.Add(cell); this.tablebank.Controls.Add(row); } } }
/// <summary> /// 获取客户银行列表 /// </summary> /// <param name="customerID"></param> /// <returns></returns> private string GetCustomerBankList(int customerID) { DataTable dtBankList = CusBankManager.getList(customerID); StringBuilder htmlBuilder = new StringBuilder(); EtNet_Models.Customer customer = CustomerManager.getCustomerById(customerID); if (customer != null && customer.Bank.Trim() != string.Empty) { htmlBuilder.AppendFormat("<option value=\"{0}\">", customer.CardId + "$" + customer.CardName + "$" + customer.Remark); //htmlBuilder.Append("<option value=\"0\">"); htmlBuilder.Append(customer.Bank); htmlBuilder.Append("</option>"); } if (dtBankList.Rows.Count > 0) { int rowCount = dtBankList.Rows.Count; for (int i = 0; i < rowCount; i++) { DataRow currentRow = dtBankList.Rows[i]; htmlBuilder.AppendFormat("<option value=\"{0}\">", currentRow["id"]); htmlBuilder.Append(currentRow["bank"]); htmlBuilder.Append("</option>"); } } return(htmlBuilder.ToString()); }
//加载银行信息 private void loadbank() { string id = Request.QueryString["id"].ToString(); DataTable tbl = CusBankManager.getList(Convert.ToInt32(id)); if (tbl.Rows.Count >= 1) { HtmlTableRow row = null; HtmlTableCell cell = null; for (int i = 0; i < tbl.Rows.Count; i++) { if (i == 0) { row = this.tablebank.Controls[1] as HtmlTableRow; cell = row.Controls[0] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["bank"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[1] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["cardId"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[2] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["cardName"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[3] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["remark"] + "' class='clsblurtxt clsedit' />"; } else { row = new HtmlTableRow(); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["bank"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["cardId"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["cardName"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["remark"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<div title='删除' class='clsimgdel'> </div>"; row.Controls.Add(cell); this.tablebank.Controls.Add(row); } } } }
/// <summary> /// 绑定客户银行列表 /// </summary> private void FillCustomerBank(DataTable dtBankList, int customerID) { EtNet_Models.Customer customer = CustomerManager.getCustomerById(customerID); if (customer != null && customer.Bank.Trim() != string.Empty) { DataRow newRow = dtBankList.NewRow(); newRow["bankId"] = 0; newRow["bankName"] = customer.Bank;// string.Format("{0}(主银行)", customer.Bank); newRow["bankAccount"] = customer.CardId; newRow["bankUser"] = customer.CardName; newRow["bankMark"] = customer.Remark; dtBankList.Rows.Add(newRow); } DataTable dtCustomerBankList = CusBankManager.getList(customerID); if (dtCustomerBankList.Rows.Count > 0) { int rowCount = dtCustomerBankList.Rows.Count; for (int i = 0; i < rowCount; i++) { DataRow currentRow = dtCustomerBankList.Rows[i]; DataRow newRow = dtBankList.NewRow(); newRow["bankId"] = currentRow["id"]; newRow["bankName"] = currentRow["bank"]; newRow["bankAccount"] = currentRow["cardId"]; newRow["bankUser"] = currentRow["cardName"]; newRow["bankMark"] = currentRow["remark"]; dtBankList.Rows.Add(newRow); } } }