コード例 #1
0
        public void Remove(Guid id)
        {
            var ship = _Repository.Get(id);

            if (ship == null)
            {
                throw new DataNotFoundException(BaseMessagesResources.Ship_NotExists);
            }

            var shipDto = ship.ToDto();

            _Repository.Remove(ship);

            #region 操作日志

            OperateRecorder.RecordOperation(shipDto.Sn,
                                            BaseMessagesResources.Remove_Ship,
                                            shipDto.GetOperationLog());

            #endregion

            //commit unit of work
            _Repository.UnitOfWork.Commit();
        }