protected void ddlType_SelectedIndexChanged(object sender, EventArgs e) { int _type = Convert.ToInt32(ddlType.SelectedItem.Value); Equipment_Type[] Equipment_Types = null; ClassSet.LoadType(out Equipment_Types, _type); if (Equipment_Types != null && Equipment_Types.Any()) { this.ddlCategory.Items.Clear(); this.ddlCategory.Items.Add(new ListItem("กรุณาเลือก", "-1")); foreach (Equipment_Type en in Equipment_Types) { this.ddlCategory.Items.Add(new ListItem(en.TypeName, en.ID.ToString())); } this.ddlCategory.SelectedIndex = 0; } }
private void LoadConfig() { this.ddlType.Items.Add(new ListItem("กรุณาเลือก", "-1")); this.ddlCategory.Items.Add(new ListItem("กรุณาเลือก", "-1")); this.ddlEquipmentList.Items.Add(new ListItem("กรุณาเลือก", "-1")); Equipment_Type[] Equipment_Types = null; ClassSet.LoadType(out Equipment_Types, 0); if (Equipment_Types != null && Equipment_Types.Any()) { foreach (Equipment_Type en in Equipment_Types) { this.ddlType.Items.Add(new ListItem(en.TypeName, en.ID.ToString())); } ddlType_SelectedIndexChanged(null, null); ddlCategory.SelectedIndex = 0; ddlEquipmentList.SelectedIndex = 0; } }