protected void ibtnDeleteAll_Click(object sender, ImageClickEventArgs e) { string delId = ""; //先遍历取得选中项 for (int i = 0; i < this.rpCustomer.Items.Count; i++) { CheckBox cbx = (CheckBox)(rpCustomer.Items[i].FindControl("cbx")); Label lbl = (Label)rpCustomer.Items[i].FindControl("lbl"); if (cbx != null || cbx.Text != "") { if (cbx.Checked) { delId += lbl.Text + ","; } } } //去掉最后一个, delId = (delId + ")").Replace(",)", ""); IList check = delId.Split(','); for (int i = 0; i < check.Count; i++) { Customer customer = CustomerManager.getCustomerById(Convert.ToInt32(check[i])); if (customer != null) { CusBankManager.deleteCusBankByCusId(customer.Id); CusLinkmanManager.deleteCusLinkmanByCusId(customer.Id); CustomerManager.deleteCustomer(customer.Id); } } dataBind(); }
/// <summary> /// 加载营业部信息 /// </summary> private void loadDepart() { string departid = Request.QueryString["departid"]; //营业部id CusLinkman model = CusLinkmanManager.getCusLinkmanById(int.Parse(departid)); departName.Value = model.DepartName; //营业部名称 linkTel.Value = model.Telephone; //电话 linkFax.Value = model.Fax; //传真 linkEmail.Value = model.Email; //邮箱 linkMsn.Value = model.Msn; //qq linkSkype.Value = model.Skype; //skype }
//读取营业部信息 private void loadOtherBank() { string id = Request.QueryString["id"].ToString(); DataTable dt = CusLinkmanManager.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]["departName"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["linkName"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["telephone"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["fax"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["mobile"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["email"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["msn"].ToString(); row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = dt.Rows[i]["skype"].ToString(); row.Controls.Add(cell); // this.tablelanguage.Controls.Add(row); this.tablelink.Controls.Add(row); } } }
private void linkman() { string id = CustomerManager.getLastOneID().Id.ToString(); IList <CusLinkman> cusLinkman = CusLinkmanManager.getCusLinkmanByCusId(Convert.ToInt32(id)); if (cusLinkman.Count == 0) { tip.InnerHtml = "<div style='line-height:60px;height:60px;width:100%;text-align:center;'><p style='color:gray;width:200px;margin:0 auto;background:#FFFFFF;border:solid 0px #ccc; text-algin:center'>暂无联系人信息<p></div>"; } else { linklist.DataSource = cusLinkman; } linklist.DataBind(); }
private void addlinkinfo() { //联系人信息 EtNet_Models.CusLinkman cusLink = new CusLinkman(); cusLink.CustomerId = CustomerManager.getLastOneID().Id; cusLink.LinkName = this.linkname.Value.ToString(); cusLink.Post = this.linkpost.Value.ToString(); cusLink.Telephone = this.linktel.Value.ToString(); cusLink.Fax = this.linkfax.Value.ToString(); cusLink.Email = this.linkemail.Value.ToString(); cusLink.Mobile = this.linkmobile.Value.ToString(); cusLink.Msn = this.linkmsn.Value.ToString(); cusLink.Skype = this.linkskype.Value.ToString(); CusLinkmanManager.addCusLinkman(cusLink); }
protected void rpCustomer_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { int id = Convert.ToInt32(e.CommandArgument); EtNet_Models.Customer model = EtNet_BLL.CustomerManager.getCustomerById(id); if (model != null) { CusBankManager.deleteCusBankByCusId(model.Id); CusLinkmanManager.deleteCusLinkmanByCusId(model.Id); int count = CustomerManager.deleteCustomer(model.Id); if (count <= 0) { ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('删除失败')", true); return; } } } dataBind(); }
private void addlink() { string id = Request.QueryString["id"].ToString(); CusLinkmanManager.deleteCusLinkmanByCusId(Convert.ToInt32(id)); string strList = this.hidlink.Value; if (strList != "") { string[] row = null; string[] cell = null; EtNet_Models.CusLinkman cusLink = null; if (strList.IndexOf(',') >= 0) { row = strList.Split(','); } else { row = new string[1] { strList }; } for (int i = 0; i < row.Length; i++) { cusLink = new EtNet_Models.CusLinkman(); cell = row[i].Split('|'); cusLink.LinkName = cell[0]; cusLink.Post = cell[1]; cusLink.Telephone = cell[2]; cusLink.Fax = cell[3]; cusLink.Mobile = cell[4]; cusLink.Email = cell[5]; cusLink.Msn = cell[6]; cusLink.Skype = cell[7]; cusLink.CustomerId = Convert.ToInt32(id); CusLinkmanManager.addCusLinkman(cusLink); } } }
//次要联系人 private void addlink(int cusid) { string strList = this.hidlink.Value; if (strList != "") { string[] row = null; string[] cell = null; EtNet_Models.CusLinkman cusLink = null; if (strList.IndexOf(',') >= 0) { row = strList.Split(','); } else { row = new string[1] { strList }; } for (int i = 0; i < row.Length; i++) { cusLink = new EtNet_Models.CusLinkman(); cell = row[i].Split('|'); cusLink.DepartName = cell[0]; //营业部名称 cusLink.LinkName = cell[1]; cusLink.Telephone = cell[2]; cusLink.Fax = cell[3]; cusLink.Mobile = cell[4]; cusLink.Email = cell[5]; cusLink.Msn = cell[6]; cusLink.Skype = cell[7]; cusLink.CustomerId = cusid; CusLinkmanManager.addCusLinkman(cusLink); } } }
//加载营业部信息 private void loadlink() { string id = Request.QueryString["id"].ToString(); DataTable tbl = CusLinkmanManager.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.tablelink.Controls[1] as HtmlTableRow; cell = row.Controls[0] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["departName"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[1] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["linkName"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[2] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["telephone"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[3] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["fax"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[4] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["mobile"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[5] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["email"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[6] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["msn"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[7] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["skype"] + "' class='clsblurtxt clsedit' />"; cell = row.Controls[8] as HtmlTableCell; cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["id"] + "' class='clsedit clsdisplay clsLinkID' /><div title='删除' class='clsimgdel'> </div>"; } else { row = new HtmlTableRow(); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["departName"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["linkName"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["telephone"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["fax"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["mobile"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["email"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["msn"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["skype"] + "' class='clsblurtxt clsedit' />"; row.Controls.Add(cell); cell = new HtmlTableCell(); cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["id"] + "' class='clsedit clsdisplay clsLinkID' /><div title='删除' class='clsimgdel'> </div>"; row.Controls.Add(cell); this.tablelink.Controls.Add(row); } } } }
/// <summary> /// 更新营业部信息 /// </summary> private void addlink() { string id = Request.QueryString["id"].ToString(); //CusLinkmanManager.deleteCusLinkmanByCusId(Convert.ToInt32(id)); string strList = this.hidlink.Value; if (strList != "") { string[] row = null; string[] cell = null; if (strList.IndexOf(',') >= 0) { row = strList.Split(','); } else { row = new string[1] { strList }; } if (row.Count() > 0) { for (int i = 0; i < row.Length; i++) { cell = row[i].Split('|'); int linkid = 0; int.TryParse(cell[8], out linkid); EtNet_Models.CusLinkman cusLink = CusLinkmanManager.getCusLinkmanById(linkid); if (cusLink == null) //如果没有就新增 { cusLink = new EtNet_Models.CusLinkman(); cusLink.DepartName = cell[0]; //营业部名称 cusLink.LinkName = cell[1]; //联系人 cusLink.Telephone = cell[2]; //电话 cusLink.Fax = cell[3]; //传真 cusLink.Mobile = cell[4]; //手机 cusLink.Email = cell[5]; //邮箱 cusLink.Msn = cell[6]; //msn cusLink.Skype = cell[7]; //skype cusLink.CustomerId = Convert.ToInt32(id); CusLinkmanManager.addCusLinkman(cusLink); } else { cusLink.DepartName = cell[0]; cusLink.LinkName = cell[1]; cusLink.Telephone = cell[2]; //电话 cusLink.Fax = cell[3]; //传真 cusLink.Mobile = cell[4]; //手机 cusLink.Email = cell[5]; //邮箱 cusLink.Msn = cell[6]; //msn cusLink.Skype = cell[7]; //skype cusLink.CustomerId = Convert.ToInt32(id); CusLinkmanManager.updateCusLinkman(cusLink); } } } } string ids = this.hidlinkdelid.Value.TrimEnd(','); //删除数据 if (ids != "") { string sql = " id in (" + ids + ")"; CusLinkmanManager.deleteCusLinkmanBySql(sql); } }