public List<BatteryType> getAllBatteryTypes() { BatteryTypeCtr tCtr = new BatteryTypeCtr(); List<MBatteryType> types = tCtr.getAllRecord(true); List<BatteryType> bts = new List<BatteryType>(); foreach (MBatteryType type in types) { BatteryType bt = new BatteryType(); bt.ID = type.id; bt.name = type.name; bt.producer = type.producer; bt.capacity = (int)type.capacity; bt.exchangeCost = (int)type.exchangeCost; bts.Add(bt); } return bts; }
public List<BatteryType> getAllBatteryType() { List<BatteryType> bts = new List<BatteryType>(); BatteryTypeCtr btCtr = new BatteryTypeCtr(); List<MBatteryType> bt = btCtr.getAllRecord(false); if (bt.Count != 0) { foreach (MBatteryType b in bt) { BatteryType btt = new BatteryType(); btt.ID = b.id; btt.name = b.name; btt.price = Convert.ToDouble(b.exchangeCost); bts.Add(btt); } } return bts; }