/// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public BLLResult Delete()
        {
            if (OnConfirmDelete != null)
            {
                if (!OnConfirmDelete())
                {
                    return new BLLResult()
                           {
                               IsSuccess = false, Message = ""
                           }
                }
                ;                                                              // "删除取消"
            }
            bool needMove = !HasNext && HasPrevious;
            var  result   = MemorableData.Delete();

            if (result.IsSuccess)
            {
                if (needMove)
                {
                    DataIndex = DataIndex - 1;//前移一项
                }
                IsEdited = false;
                Datas.Remove(MemorableData.Data);
                ChangeCurrent(DataIndex);
            }
            return(result);
        }
Exemple #2
0
        private void DeleteAction(object obj)
        {
            var item = (ItemPenjualanModel)obj;

            if (item != null)
            {
                Datas.Remove(item);
                RefreshProductStock();
            }
        }
Exemple #3
0
            public bool Remove(DataType item)
            {
                var res = Datas.Remove(item);

                if (res)
                {
                    CallUpdate();
                }
                return(res);
            }
Exemple #4
0
        public virtual bool Remove(string guid)
        {
            bool isSucess = false;

            if (Datas.TryGetValue(guid, out var t))
            {
                Datas.Remove(guid);
                isSucess = true;
                Event.Notify(EventCall, new ModelEventArgs <T>()
                {
                    Data = t, Status = ModelStatus.Remove
                });
                t.Dispose();
            }
            return(isSucess);
        }
 public void RemoveArticle(TDBaseArticleData data)
 {
     Datas.Remove(data.ID);
 }
 public void RemoveArticle(long id)
 {
     Datas.Remove(id);
 }