Пример #1
0
        public void DeletePositionIm(PositionIm positionIm, DbTransaction dbTran)
        {
            if (positionIm == null)
            {
                return;
            }

            _stringProcessor.DeleteFullString(positionIm.OrderPositionId, dbTran);
            _moduleProcessor.DeleteModule(positionIm.OrderPositionId, dbTran);
            _moduleMaketProcessor.DeleteModuleGraphics(positionIm.OrderPositionId);

            _repository.SetPositionIm(positionIm, newTaskFile: false, newMaketFile: false, isActual: false, dbTran);
            _context.Entry(positionIm).Reload();

            var orderIm = _orderImProcessor.GetOrderIm(positionIm.OrderId, positionIm.PositionImType.OrderImTypeId);

            if (_orderImProcessor.NeedDeleteOrderIm(orderIm))
            {
                _orderImProcessor.DeleteOrderIm(orderIm, dbTran);
            }
            else
            {
                _orderImProcessor.UpdateOrderIm(orderIm, dbTran);
            }
        }