protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.ddrProvince.DataSource = bll.GetModelList(); this.ddrProvince.DataValueField = "Id"; this.ddrProvince.DataTextField = "Name"; this.ddrProvince.DataBind(); } }
private void BindShow() { this.ddrcity.Visible = false; this.ddrprovice.DataSource = provincebll.GetModelList(); this.ddrprovice.DataValueField = "Id"; this.ddrprovice.DataTextField = "Name"; this.ddrprovice.DataBind(); this.ddrxingye.DataSource = industrybll.GetModelList(); this.ddrxingye.DataValueField = "Id"; this.ddrxingye.DataTextField = "Name"; this.ddrxingye.DataBind(); ListItem items = new ListItem(); items.Value = "-1"; items.Text = "所有行业"; ddrxingye.Items.Add(items); this.ddrxingye.Items.FindByValue("-1").Selected = true; this.ddrzhiwei.DataSource = positionbll.GetModelList(); this.ddrzhiwei.DataValueField = "Id"; this.ddrzhiwei.DataTextField = "Name"; this.ddrzhiwei.DataBind(); this.ddrzu.DataSource = mialgroupbll.GetModelList(); this.ddrzu.DataValueField = "groupID"; this.ddrzu.DataTextField = "groupname"; this.ddrzu.DataBind(); this.ddrleixing.DataSource = mailtypebll.GetModelList(); this.ddrleixing.DataValueField = "typeID"; this.ddrleixing.DataTextField = "TypeName"; this.ddrleixing.DataBind(); List <Tz888.Model.Mail.City> list = citybll.GetModelList(Convert.ToInt32(this.ddrprovice.SelectedValue)); if (list.Count > 0) { this.ddrcity.Visible = true; this.ddrcity.DataSource = list; this.ddrcity.DataValueField = "Id"; this.ddrcity.DataTextField = "Name"; this.ddrcity.DataBind(); } else { this.ddrcity.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["id"] != null) { Tz888.Common.MessageBox.Show(this.Page, "删除成功!"); } count = 0; par = " "; this.ddrcity.Visible = false; this.ddrprovice.DataSource = provincebll.GetModelList(); this.ddrprovice.DataValueField = "Id"; this.ddrprovice.DataTextField = "Name"; this.ddrprovice.DataBind(); ListItem item = new ListItem(); item.Value = "-1"; item.Text = "--请选择--"; ddrprovice.Items.Add(item); this.ddrprovice.Items.FindByValue("-1").Selected = true; this.ddrxingye.DataSource = industrybll.GetModelList(); this.ddrxingye.DataValueField = "Id"; this.ddrxingye.DataTextField = "Name"; this.ddrxingye.DataBind(); ListItem items = new ListItem(); items.Value = "-1"; items.Text = "所有行业"; ddrxingye.Items.Add(items); this.ddrxingye.Items.FindByValue("-1").Selected = true; this.ddrzu.DataSource = mialgroupbll.GetModelList(); this.ddrzu.DataValueField = "groupID"; this.ddrzu.DataTextField = "groupname"; this.ddrzu.DataBind(); ddrzu.Items.Add(item); this.ddrzu.Items.FindByValue("-1").Selected = true; this.ddrleixing.DataSource = mailtypebll.GetModelList(); this.ddrleixing.DataValueField = "typeID"; this.ddrleixing.DataTextField = "TypeName"; this.ddrleixing.DataBind(); ddrleixing.Items.Add(item); this.ddrleixing.Items.FindByValue("-1").Selected = true; List <Tz888.Model.Mail.City> list = citybll.GetModelList(Convert.ToInt32(this.ddrprovice.SelectedValue)); if (list.Count > 0) { this.ddrcity.Visible = true; this.ddrcity.DataSource = list; this.ddrcity.DataValueField = "Id"; this.ddrcity.DataTextField = "Name"; this.ddrcity.DataBind(); ddrcity.Items.Add(item); this.ddrcity.Items.FindByValue("-1").Selected = true; } else { this.ddrcity.Visible = false; } if (Convert.ToInt32(Request["str"]) != 0) { int Id = Convert.ToInt32(Request["str"].ToString()); Delete(Id); } if (dt == null) { dt = new DataTable("MailInfo"); dt.Columns.Add(new DataColumn("编号", typeof(String))); dt.Columns.Add(new DataColumn("账号", typeof(String))); dt.Columns.Add(new DataColumn("名称", typeof(String))); dt.Columns.Add(new DataColumn("公司名称", typeof(String))); dt.Columns.Add(new DataColumn("职位", typeof(String))); dt.Columns.Add(new DataColumn("地址", typeof(String))); dt.Columns.Add(new DataColumn("网址", typeof(String))); dt.Columns.Add(new DataColumn("类型", typeof(String))); dt.Columns.Add(new DataColumn("地域", typeof(String))); dt.Columns.Add(new DataColumn("行业", typeof(String))); dt.Columns.Add(new DataColumn("状态", typeof(String))); dt.Columns.Add(new DataColumn("邮件", typeof(String))); dt.Columns.Add(new DataColumn("手机", typeof(String))); dt.Columns.Add(new DataColumn("组", typeof(String))); dt.Columns.Add(new DataColumn("备注", typeof(String))); dt.Columns.Add(new DataColumn("时间", typeof(String))); dt.Columns.Add(new DataColumn("操作", typeof(String))); } BindShow(); } }
private void BindShow() { Tz888.Model.Mail.MailInfo model = mailinfobll.GetModel(Id); this.ddrcity.Visible = false; this.ddrprovice.DataSource = provincebll.GetModelList(); this.ddrprovice.DataValueField = "Id"; this.ddrprovice.DataTextField = "Name"; this.ddrprovice.DataBind(); // ddrprovice.Items.FindByValue(model.ProvinceId.ToString().Trim()).Selected = true; ddrprovice.SelectedValue = model.ProvinceId.ToString().Trim(); this.ddrxingye.DataSource = industrybll.GetModelList(); this.ddrxingye.DataValueField = "Id"; this.ddrxingye.DataTextField = "Name"; this.ddrxingye.DataBind(); ListItem items = new ListItem(); items.Value = "-1"; items.Text = "所有行业"; ddrxingye.Items.Add(items); // ddrxingye.Items.FindByValue(model.industry.ToString().Trim()).Selected = true; ddrxingye.SelectedValue = model.industry.ToString().Trim(); this.ddrzhiwei.DataSource = positionbll.GetModelList(); this.ddrzhiwei.DataValueField = "Id"; this.ddrzhiwei.DataTextField = "Name"; this.ddrzhiwei.DataBind(); // ddrzhiwei.Items.FindByValue(model.PositionId.ToString().Trim()).Selected = true; ddrzhiwei.SelectedValue = model.PositionId.ToString().Trim(); this.ddrzu.DataSource = mialgroupbll.GetModelList(); this.ddrzu.DataValueField = "groupID"; this.ddrzu.DataTextField = "groupname"; this.ddrzu.DataBind(); // ddrzu.Items.FindByValue(model.groupID.ToString().Trim()).Selected = true; ddrzu.SelectedValue = model.groupID.ToString().Trim(); this.ddrleixing.DataSource = mailtypebll.GetModelList(); this.ddrleixing.DataValueField = "typeID"; this.ddrleixing.DataTextField = "TypeName"; this.ddrleixing.DataBind(); // ddrleixing.Items.FindByValue(model.typeID.ToString().Trim()).Selected = true; ddrleixing.SelectedValue = model.typeID.ToString().Trim(); List <Tz888.Model.Mail.City> list = citybll.GetModelList(Convert.ToInt32(this.ddrprovice.SelectedValue)); if (list.Count > 0) { this.ddrcity.Visible = true; this.ddrcity.DataSource = list; this.ddrcity.DataValueField = "Id"; this.ddrcity.DataTextField = "Name"; this.ddrcity.DataBind(); if (Convert.ToInt32(model.CityId.ToString()) > 0) { // ddrcity.Items.FindByValue(model.CityId.ToString().Trim()).Selected = true; ddrcity.SelectedValue = model.CityId.ToString().Trim(); } else { this.ddrcity.Visible = false; } } else { this.ddrcity.Visible = false; } txtUserName.Text = model.UserName; txtPanyName.Text = model.PanyName; txtAddress.Text = model.Address; txtLinkUrl.Text = model.LinkUrl; txtMail.Text = model.Mial; txtMoblie.Text = model.Mobile; string Phone = model.phone; if (Phone.Split('-').Length < 3) { txtTelNumber.Value = Phone; } else { txtTelCountry.Value = (Phone.Split('-')[0] == null) ? "" : Phone.Split('-')[0]; txtTelZoneCode.Value = (Phone.Split('-')[1] == null) ? "" : Phone.Split('-')[1]; txtTelNumber.Value = (Phone.Split('-')[2] == null) ? "" : Phone.Split('-')[2]; } txtDescript.Text = model.remark; // this.radioaudit.Items.FindByValue(model.audit.ToString().Trim()).Selected = true; radioaudit.SelectedValue = model.audit.ToString().Trim(); }