Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public BindingList <MaterialPermitItem> GetItemList(EPVDatabase database)
        {
            if (itemList == null)
            {
                itemList = new BindingList <MaterialPermitItem>(MaterialPermitItem.LoadList(this, database));
            }

            return(itemList);
        }
Exemplo n.º 3
0
        public void RemoveItem(MaterialPermitItem item)
        {
            if (itemList != null)
            {
                itemList.Remove(item);
            }

            if (removedItemList == null)
            {
                removedItemList = new List <MaterialPermitItem>();
            }

            removedItemList.Add(item);

            SetState();
        }