void BuildDropdown() { List <Dropdown.OptionData> equipmentData = new List <Dropdown.OptionData>(); equipmentData.Add(new Dropdown.OptionData("全部")); foreach (string name in TableClassEquipmentStandingBook.DataEnums(TableClassEquipmentStandingBook.DataType.equipmentType)) { equipmentData.Add(new Dropdown.OptionData(name)); } Equipment.options = equipmentData; List <Dropdown.OptionData> setupData = new List <Dropdown.OptionData>(); setupData.Add(new Dropdown.OptionData("全部")); foreach (string name in TableClassEquipmentStandingBook.DataEnums(TableClassEquipmentStandingBook.DataType.setupLocation)) { setupData.Add(new Dropdown.OptionData(name)); } Setup.options = setupData; List <Dropdown.OptionData> guaranteeData = new List <Dropdown.OptionData>(); guaranteeData.Add(new Dropdown.OptionData("全部")); foreach (string name in TableClassEquipmentStandingBook.DataEnums(TableClassEquipmentStandingBook.DataType.guaranteePeriod)) { guaranteeData.Add(new Dropdown.OptionData(name)); } Guarantee.options = guaranteeData; Equipment.onValueChanged.AddListener(SelectEquipment); Setup.onValueChanged.AddListener(SelectSetup); Guarantee.onValueChanged.AddListener(SelectGuarantee); table.BuildStandingBook(null, TableClick); }
void RebuildData() { if (equipmentIndex == 0 && setupIndex == 0 && guaranteeIndex == 0) { table.BuildStandingBook(null, TableClick); return; } List <TableClassEquipmentStandingBook> datas = TableClassEquipmentStandingBook.TestData; if (equipmentIndex != 0) { string values = TableClassEquipmentStandingBook.DataEnums(TableClassEquipmentStandingBook.DataType.equipmentType)[equipmentIndex - 1]; IEnumerable <TableClassEquipmentStandingBook> rs = from data in datas where data.equipmentType == values select data; datas = rs.ToList(); } if (setupIndex != 0) { string values = TableClassEquipmentStandingBook.DataEnums(TableClassEquipmentStandingBook.DataType.setupLocation)[setupIndex - 1]; IEnumerable <TableClassEquipmentStandingBook> rs = from data in datas where data.setupLocation == values select data; datas = rs.ToList(); } if (guaranteeIndex != 0) { string values = TableClassEquipmentStandingBook.DataEnums(TableClassEquipmentStandingBook.DataType.guaranteePeriod)[guaranteeIndex - 1]; IEnumerable <TableClassEquipmentStandingBook> rs = from data in datas where data.guaranteePeriod == values select data; datas = rs.ToList(); } table.BuildStandingBook(datas, TableClick); }