private void BindDropDown() { #region 绑定用户可管辖的管理片区 Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]); tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity(); if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0) { tr_OrganizeCity.RootValue = "0"; tr_OrganizeCity.SelectValue = "1"; } else { tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString(); tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString(); } #endregion select_Staff.SelectText = staff.Model.RealName; select_Staff.SelectValue = staff.Model.ID.ToString(); ddl_Transport.DataSource = DictionaryBLL.GetDicCollections("FNA_EvectionTransport"); ddl_Transport.DataBind(); ddl_Transport.Items.Insert(0, new ListItem("请选择...", "0")); ddl_Car.DataSource = Car_CarListBLL.GetCarListByOrganizeCity(staff.Model.OrganizeCity); ddl_Car.DataBind(); ddl_Car.Items.Insert(0, new ListItem("请选择", "0")); }
protected void tr_OrganizeCity_Selected(object sender, MCSControls.MCSWebControls.SelectedEventArgs e) { int city = int.Parse(tr_OrganizeCity.SelectValue); ddl_Car.DataSource = Car_CarListBLL.GetCarListByOrganizeCity(city).OrderBy(p => p.CarNo); ddl_Car.DataBind(); ddl_Car.Items.Insert(0, new ListItem("请选择", "0")); }
private void BindDropDown() { int organizecity = new Org_StaffBLL((int)Session["UserID"]).Model.OrganizeCity; ddl_CarID.DataTextField = "CarNo"; ddl_CarID.DataValueField = "ID"; ddl_CarID.DataSource = Car_CarListBLL.GetCarListByOrganizeCity(organizecity).OrderBy(p => p.CarNo).ToList(); ddl_CarID.DataBind(); ddl_CarID.Items.Insert(0, new ListItem("请选择", "0")); }