public void UpdateUnit(T_Unit unit) { UnitList.Remove(UnitList.Find(o => o.Code == unit.Code)); UnitList.Add(unit); }
private void InitUnitList() { UnitList = new List<T_Unit>(); T_Unit unitA = new T_Unit() { Code = "m", Desc = "米" }; T_Unit unitB = new T_Unit() { Code = "t", Desc = "吨" }; T_Unit unitC = new T_Unit() { Code = "g", Desc = "克" }; T_Unit unitD = new T_Unit() { Code = "kg", Desc = "千克" }; T_Unit unitE = new T_Unit() { Code = "¥", Desc = "元" }; T_Unit unitF = new T_Unit() { Code = "$", Desc = "美元" }; UnitList.Add(unitA); UnitList.Add(unitB); UnitList.Add(unitC); UnitList.Add(unitD); UnitList.Add(unitE); UnitList.Add(unitF); }
public void AddUnit(T_Unit unit) { UnitList.Add(unit); }