public static List <TableClassEquipmentStandingBook> RandomClassData(int listCount) { List <TableClassEquipmentStandingBook> rs = new List <TableClassEquipmentStandingBook>(); for (int i = 0; i < listCount; i++) { TableClassEquipmentStandingBook temp = new TableClassEquipmentStandingBook(); temp.No = (i + 1).ToString(); temp.equipmentType = StaticGloableVariable.RandomFromList(DataEnums(DataType.equipmentType)); temp.type = StaticGloableVariable.RandomFromList(DataEnums(DataType.type)); temp.technical = StaticGloableVariable.RandomFromList(DataEnums(DataType.technical)); temp.brand = StaticGloableVariable.RandomFromBrand(); temp.supplier = temp.brand; temp.enterTime = StaticGloableVariable.RandomFromDate(); temp.enterResponsePerson = StaticGloableVariable.RandomFromPerson(); temp.debugStatus = StaticGloableVariable.RandomFromList(DataEnums(DataType.debugStatus)); temp.checkTime = StaticGloableVariable.RandomFromDate(); temp.checkResponsePerson = StaticGloableVariable.RandomFromPerson(); temp.setupLocation = StaticGloableVariable.RandomFromList(DataEnums(DataType.setupLocation)); temp.guaranteePeriod = StaticGloableVariable.RandomFromList(DataEnums(DataType.guaranteePeriod)); temp.transferTime = StaticGloableVariable.RandomFromDate(); rs.Add(temp); } testData = rs; return(rs); }
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); }