public MaterialPermitItem AddItem() { if (itemList == null) { itemList = new BindingList <MaterialPermitItem>(); } int id = -1; foreach (MaterialPermitItem item in itemList) { if (id >= item.Id) { id = item.Id - 1; } } MaterialPermitItem newItem = new MaterialPermitItem(this); newItem.Id = id; itemList.Add(newItem); SetState(); return(newItem); }
public BindingList <MaterialPermitItem> GetItemList(EPVDatabase database) { if (itemList == null) { itemList = new BindingList <MaterialPermitItem>(MaterialPermitItem.LoadList(this, database)); } return(itemList); }
public void RemoveItem(MaterialPermitItem item) { if (itemList != null) { itemList.Remove(item); } if (removedItemList == null) { removedItemList = new List <MaterialPermitItem>(); } removedItemList.Add(item); SetState(); }