Esempio n. 1
0
        // Undo标记删除
        // return:
        //      false   没有必要Undo
        //      true    已经Undo
        public bool UndoMaskDeleteItem(OrderItem orderitem)
        {
            if (orderitem.ItemDisplayState != ItemDisplayState.Deleted)
            {
                return(false);   // 要Undo的事项根本就不是Deleted状态,所以谈不上Undo
            }
            // 因为不知道上次标记删除前数据是否改过,因此全当改过
            orderitem.ItemDisplayState = ItemDisplayState.Changed;
            orderitem.Changed          = true;

            // 刷新
            orderitem.RefreshListView();
            return(true);
        }
Esempio n. 2
0
        // 标记删除
        public void MaskDeleteItem(
            bool bRemoveFromList,
            OrderItem orderitem)
        {
            if (orderitem.ItemDisplayState == ItemDisplayState.New)
            {
                PhysicalDeleteItem(orderitem);
                return;
            }


            orderitem.ItemDisplayState = ItemDisplayState.Deleted;
            orderitem.Changed          = true;

            // 从listview中消失?
            if (bRemoveFromList == true)
            {
                orderitem.DeleteFromListView();
            }
            else
            {
                orderitem.RefreshListView();
            }
        }
Esempio n. 3
0
        // Undo标记删除
        // return:
        //      false   没有必要Undo
        //      true    已经Undo
        public bool UndoMaskDeleteItem(OrderItem orderitem)
        {
            if (orderitem.ItemDisplayState != ItemDisplayState.Deleted)
                return false;   // 要Undo的事项根本就不是Deleted状态,所以谈不上Undo

            // 因为不知道上次标记删除前数据是否改过,因此全当改过
            orderitem.ItemDisplayState = ItemDisplayState.Changed;
            orderitem.Changed = true;

            // 刷新
            orderitem.RefreshListView();
            return true;
        }
Esempio n. 4
0
        // 标记删除
        public void MaskDeleteItem(
            bool bRemoveFromList,
            OrderItem orderitem)
        {
            if (orderitem.ItemDisplayState == ItemDisplayState.New)
            {
                PhysicalDeleteItem(orderitem);
                return;
            }


            orderitem.ItemDisplayState = ItemDisplayState.Deleted;
            orderitem.Changed = true;

            // 从listview中消失?
            if (bRemoveFromList == true)
                orderitem.DeleteFromListView();
            else
            {
                orderitem.RefreshListView();
            }
        }