public RollerWarehouseMutationDetail UnconfirmObject(RollerWarehouseMutationDetail rollerWarehouseMutationDetail, IRollerWarehouseMutationService _rollerWarehouseMutationService,
                                                             IItemService _itemService, IBarringService _barringService, IWarehouseItemService _warehouseItemService, IStockMutationService _stockMutationService,
                                                             ICoreIdentificationDetailService _coreIdentificationDetailService, ICoreIdentificationService _coreIdentificationService)
        {
            if (_validator.ValidUnconfirmObject(rollerWarehouseMutationDetail, _rollerWarehouseMutationService, _itemService, _barringService, _warehouseItemService))
            {
                _repository.UnconfirmObject(rollerWarehouseMutationDetail);

                // Set IsDelivered = false
                CoreIdentificationDetail coreIdentificationDetail = _coreIdentificationDetailService.GetObjectById(rollerWarehouseMutationDetail.CoreIdentificationDetailId);
                _coreIdentificationDetailService.UndoDeliverObject(coreIdentificationDetail, _coreIdentificationService, this);

                // reverse stock mutate warehouseFromItem and warehouseToItem
                RollerWarehouseMutation rollerWarehouseMutation = _rollerWarehouseMutationService.GetObjectById(rollerWarehouseMutationDetail.RollerWarehouseMutationId);
                WarehouseItem           warehouseItemFrom       = _warehouseItemService.FindOrCreateObject(rollerWarehouseMutation.WarehouseFromId, rollerWarehouseMutationDetail.ItemId);
                WarehouseItem           warehouseItemTo         = _warehouseItemService.FindOrCreateObject(rollerWarehouseMutation.WarehouseToId, rollerWarehouseMutationDetail.ItemId);

                IList <StockMutation> stockMutations = _stockMutationService.SoftDeleteStockMutationForRollerWarehouseMutation(rollerWarehouseMutationDetail, warehouseItemFrom, warehouseItemTo);
                foreach (var stockMutation in stockMutations)
                {
                    _stockMutationService.ReverseStockMutateObject(stockMutation, _itemService, _barringService, _warehouseItemService);
                }
            }
            return(rollerWarehouseMutationDetail);
        }
Exemplo n.º 2
0
        public CoreBuilder SoftDeleteObject(CoreBuilder coreBuilder, IItemService _itemService, IRollerBuilderService _rollerBuilderService,
                                            ICoreIdentificationDetailService _coreIdentificationDetailService, IRecoveryOrderDetailService _recoveryOrderDetailService,
                                            IRecoveryAccessoryDetailService _recoveryAccessoryDetailService, IWarehouseItemService _warehouseItemService,
                                            IStockMutationService _stockMutationService, IItemTypeService _itemTypeService)
        {
            Item UsedCore = _itemService.GetObjectById(coreBuilder.UsedCoreItemId);
            Item NewCore  = _itemService.GetObjectById(coreBuilder.NewCoreItemId);

            if (_itemService.GetValidator().ValidDeleteLegacyObject(UsedCore, _stockMutationService, _itemTypeService, _warehouseItemService) &&
                _itemService.GetValidator().ValidDeleteLegacyObject(UsedCore, _stockMutationService, _itemTypeService, _warehouseItemService))
            {
                if (_validator.ValidDeleteObject(coreBuilder, _coreIdentificationDetailService, _rollerBuilderService))
                {
                    _itemService.GetRepository().SoftDeleteObject(UsedCore);
                    _itemService.GetRepository().SoftDeleteObject(NewCore);
                    _repository.SoftDeleteObject(coreBuilder);
                }
            }
            else
            {
                if (UsedCore.Errors.Count() > 0)
                {
                    coreBuilder.Errors.Add(UsedCore.Errors.First().Key, UsedCore.Errors.First().Value);
                }
                else if (NewCore.Errors.Count() > 0)
                {
                    coreBuilder.Errors.Add(NewCore.Errors.First().Key, NewCore.Errors.First().Value);
                }
                else
                {
                    coreBuilder.Errors.Add("Generic", "Item tidak dapat di hapus");
                }
            }
            return(coreBuilder);
        }
 public RollerWarehouseMutationDetail CreateObject(RollerWarehouseMutationDetail rollerWarehouseMutationDetail, IRollerWarehouseMutationService _rollerWarehouseMutationService,
                                                   ICoreIdentificationDetailService _coreIdentificationDetailService, IItemService _itemService, IWarehouseItemService _warehouseItemService)
 {
     rollerWarehouseMutationDetail.Errors = new Dictionary <String, String>();
     return(rollerWarehouseMutationDetail = _validator.ValidCreateObject(rollerWarehouseMutationDetail, _rollerWarehouseMutationService, _coreIdentificationDetailService, this, _itemService, _warehouseItemService) ?
                                            _repository.CreateObject(rollerWarehouseMutationDetail) : rollerWarehouseMutationDetail);
 }
 public RecoveryOrderDetail VCreateObject(RecoveryOrderDetail recoveryOrderDetail, IRecoveryOrderService _recoveryOrderService,
                                          ICoreIdentificationDetailService _coreIdentificationDetailService, IRollerBuilderService _rollerBuilderService)
 {
     VHasRecoveryOrder(recoveryOrderDetail, _recoveryOrderService);
     if (!isValid(recoveryOrderDetail))
     {
         return(recoveryOrderDetail);
     }
     VHasCoreIdentificationDetail(recoveryOrderDetail, _coreIdentificationDetailService);
     if (!isValid(recoveryOrderDetail))
     {
         return(recoveryOrderDetail);
     }
     VHasRollerBuilder(recoveryOrderDetail, _rollerBuilderService);
     if (!isValid(recoveryOrderDetail))
     {
         return(recoveryOrderDetail);
     }
     VHasCoreTypeCase(recoveryOrderDetail);
     if (!isValid(recoveryOrderDetail))
     {
         return(recoveryOrderDetail);
     }
     VHasAcc(recoveryOrderDetail);
     if (!isValid(recoveryOrderDetail))
     {
         return(recoveryOrderDetail);
     }
     VHasRepairRequestCase(recoveryOrderDetail);
     return(recoveryOrderDetail);
 }
Exemplo n.º 5
0
 public RecoveryOrder VConfirmObject(RecoveryOrder recoveryOrder, ICoreIdentificationDetailService _coreIdentificationDetailService,
                                     IRecoveryOrderDetailService _recoveryOrderDetailService, ICoreBuilderService _coreBuilderService, IItemService _itemService, IWarehouseItemService _warehouseItemService)
 {
     VHasConfirmationDate(recoveryOrder);
     if (!isValid(recoveryOrder))
     {
         return(recoveryOrder);
     }
     VHasNotBeenConfirmed(recoveryOrder);
     if (!isValid(recoveryOrder))
     {
         return(recoveryOrder);
     }
     VHasRecoveryOrderDetails(recoveryOrder, _recoveryOrderDetailService);
     if (!isValid(recoveryOrder))
     {
         return(recoveryOrder);
     }
     VQuantityReceivedEqualDetails(recoveryOrder, _recoveryOrderDetailService);
     if (!isValid(recoveryOrder))
     {
         return(recoveryOrder);
     }
     VQuantityIsInStock(recoveryOrder, _coreIdentificationDetailService, _recoveryOrderDetailService, _coreBuilderService, _itemService, _warehouseItemService);
     return(recoveryOrder);
 }
Exemplo n.º 6
0
 public bool ValidUnfinishObject(CoreIdentificationDetail coreIdentificationDetail, ICoreIdentificationService _coreIdentificationService,
                                 ICoreIdentificationDetailService _coreIdentificationDetailService, ICoreBuilderService _coreBuilderService, IWarehouseItemService _warehouseItemService)
 {
     coreIdentificationDetail.Errors.Clear();
     VUnfinishObject(coreIdentificationDetail, _coreIdentificationService, _coreIdentificationDetailService, _coreBuilderService, _warehouseItemService);
     return(isValid(coreIdentificationDetail));
 }
        public RollerWarehouseMutationDetail ConfirmObject(RollerWarehouseMutationDetail rollerWarehouseMutationDetail, DateTime ConfirmationDate, IRollerWarehouseMutationService _rollerWarehouseMutationService,
                                                           IItemService _itemService, IBarringService _barringService, IWarehouseItemService _warehouseItemService, IStockMutationService _stockMutationService,
                                                           ICoreIdentificationDetailService _coreIdentificationDetailService, ICoreIdentificationService _coreIdentificationService)
        {
            rollerWarehouseMutationDetail.ConfirmationDate = ConfirmationDate;
            if (_validator.ValidConfirmObject(rollerWarehouseMutationDetail, _rollerWarehouseMutationService, _itemService, _barringService, _warehouseItemService))
            {
                _repository.ConfirmObject(rollerWarehouseMutationDetail);

                // Set IsDelivered = true
                CoreIdentificationDetail coreIdentificationDetail = _coreIdentificationDetailService.GetObjectById(rollerWarehouseMutationDetail.CoreIdentificationDetailId);
                _coreIdentificationDetailService.DeliverObject(coreIdentificationDetail, _coreIdentificationService, this);

                // reduce warehouseFromItem
                // add warehouseToItem

                RollerWarehouseMutation rollerWarehouseMutation = _rollerWarehouseMutationService.GetObjectById(rollerWarehouseMutationDetail.RollerWarehouseMutationId);
                WarehouseItem           warehouseItemFrom       = _warehouseItemService.FindOrCreateObject(rollerWarehouseMutation.WarehouseFromId, rollerWarehouseMutationDetail.ItemId);
                WarehouseItem           warehouseItemTo         = _warehouseItemService.FindOrCreateObject(rollerWarehouseMutation.WarehouseToId, rollerWarehouseMutationDetail.ItemId);

                IList <StockMutation> stockMutations = _stockMutationService.CreateStockMutationForRollerWarehouseMutation(rollerWarehouseMutationDetail, warehouseItemFrom, warehouseItemTo);
                foreach (var stockMutation in stockMutations)
                {
                    _stockMutationService.StockMutateObject(stockMutation, _itemService, _barringService, _warehouseItemService);
                }
            }
            return(rollerWarehouseMutationDetail);
        }
 public bool ValidConfirmObject(CoreIdentification coreIdentification, ICoreIdentificationDetailService _coreIdentificationDetailService,
                                ICoreBuilderService _coreBuilderService, IItemService _itemService, IWarehouseItemService _warehouseItemService)
 {
     coreIdentification.Errors.Clear();
     VConfirmObject(coreIdentification, _coreIdentificationDetailService, _coreBuilderService, _itemService, _warehouseItemService);
     return(isValid(coreIdentification));
 }
Exemplo n.º 9
0
 public bool ValidCreateObject(CoreIdentificationDetail coreIdentificationDetail, ICoreIdentificationService _coreIdentificationService,
                               ICoreIdentificationDetailService _coreIdentificationDetailService, ICoreBuilderService _coreBuilderService,
                               IRollerTypeService _rollerTypeService, IMachineService _machineService)
 {
     VCreateObject(coreIdentificationDetail, _coreIdentificationService, _coreIdentificationDetailService, _coreBuilderService, _rollerTypeService, _machineService);
     return(isValid(coreIdentificationDetail));
 }
Exemplo n.º 10
0
 public RecoveryOrderDetail CreateObject(RecoveryOrderDetail recoveryOrderDetail, IRecoveryOrderService _recoveryOrderService,
                                         ICoreIdentificationDetailService _coreIdentificationDetailService, IRollerBuilderService _rollerBuilderService)
 {
     recoveryOrderDetail.Errors = new Dictionary <String, String>();
     return(recoveryOrderDetail = _validator.ValidCreateObject(recoveryOrderDetail, _recoveryOrderService, _coreIdentificationDetailService, _rollerBuilderService) ?
                                  _repository.CreateObject(recoveryOrderDetail) : recoveryOrderDetail);
 }
Exemplo n.º 11
0
        public RecoveryOrder VQuantityIsInStock(RecoveryOrder recoveryOrder, ICoreIdentificationDetailService _coreIdentificationDetailService,
                                                IRecoveryOrderDetailService _recoveryOrderDetailService, ICoreBuilderService _coreBuilderService, IItemService _itemService,
                                                IWarehouseItemService _warehouseItemService)
        {
            IList <RecoveryOrderDetail> details = _recoveryOrderDetailService.GetObjectsByRecoveryOrderId(recoveryOrder.Id);
            IDictionary <int, int>      ValuePairItemIdQuantity = new Dictionary <int, int>();

            foreach (var detail in details)
            {
                CoreIdentificationDetail coreIdentificationDetail = _coreIdentificationDetailService.GetObjectById(detail.CoreIdentificationDetailId);
                CoreBuilder coreBuilder = _coreBuilderService.GetObjectById(coreIdentificationDetail.CoreBuilderId);
                Item        item        = (coreIdentificationDetail.MaterialCase == Core.Constants.Constant.MaterialCase.New) ?
                                          _coreBuilderService.GetNewCore(coreBuilder.Id) : _coreBuilderService.GetUsedCore(coreBuilder.Id);
                WarehouseItem warehouseItem = _warehouseItemService.FindOrCreateObject(recoveryOrder.WarehouseId, item.Id);
                if (ValuePairItemIdQuantity.ContainsKey(warehouseItem.Id))
                {
                    ValuePairItemIdQuantity[warehouseItem.Id] += 1;
                }
                else
                {
                    ValuePairItemIdQuantity.Add(warehouseItem.Id, 1);
                }
            }

            foreach (var ValuePair in ValuePairItemIdQuantity)
            {
                WarehouseItem warehouseItem = _warehouseItemService.GetObjectById(ValuePair.Key);
                if (warehouseItem.Quantity < ValuePair.Value)
                {
                    recoveryOrder.Errors.Add("Generic", "Stock quantity core item tidak boleh kurang dari jumlah di dalam recovery order");
                    return(recoveryOrder);
                }
            }
            return(recoveryOrder);
        }
Exemplo n.º 12
0
 public bool ValidDeleteObject(Machine machine, IRollerBuilderService _rollerBuilderService,
                               ICoreIdentificationDetailService _coreIdentificationDetailService, IBarringService _barringService)
 {
     machine.Errors.Clear();
     VDeleteObject(machine, _rollerBuilderService, _coreIdentificationDetailService, _barringService);
     return(isValid(machine));
 }
Exemplo n.º 13
0
 public bool ValidUpdateObject(CoreIdentificationDetail coreIdentificationDetail, ICoreIdentificationService _coreIdentificationService,
                               ICoreIdentificationDetailService _coreIdentificationDetailService, ICoreBuilderService _coreBuilderService,
                               IRollerTypeService _rollerTypeService, IMachineService _machineService)
 {
     coreIdentificationDetail.Errors.Clear();
     VUpdateObject(coreIdentificationDetail, _coreIdentificationService, _coreIdentificationDetailService, _coreBuilderService, _rollerTypeService, _machineService);
     return(isValid(coreIdentificationDetail));
 }
Exemplo n.º 14
0
 public MstMachineController()
 {
     _MachineService                  = new MachineService(new MachineRepository(), new MachineValidator());
     _itemService                     = new ItemService(new ItemRepository(), new ItemValidator());
     _rollerBuilderService            = new RollerBuilderService(new RollerBuilderRepository(), new RollerBuilderValidator());
     _coreIdentificationDetailService = new CoreIdentificationDetailService(new CoreIdentificationDetailRepository(), new CoreIdentificationDetailValidator());
     _barringService                  = new BarringService(new BarringRepository(), new BarringValidator());
 }
Exemplo n.º 15
0
        public Item GetCore(RecoveryOrderDetail recoveryOrderDetail, ICoreIdentificationDetailService _coreIdentificationDetailService,
                            ICoreBuilderService _coreBuilderService, IItemService _itemService)
        {
            CoreIdentificationDetail coreIdentificationDetail = _coreIdentificationDetailService.GetObjectById(recoveryOrderDetail.CoreIdentificationDetailId);
            Item core = (coreIdentificationDetail.MaterialCase == Core.Constants.Constant.MaterialCase.New) ?
                        _coreBuilderService.GetNewCore(coreIdentificationDetail.CoreBuilderId) : _coreBuilderService.GetUsedCore(coreIdentificationDetail.CoreBuilderId);

            return(core);
        }
Exemplo n.º 16
0
 public RecoveryOrder CompleteObject(RecoveryOrder recoveryOrder, ICoreIdentificationDetailService _coreIdentificationDetailService, IRecoveryOrderDetailService _recoveryOrderDetailService,
                                     IRecoveryAccessoryDetailService _recoveryAccessoryDetailService)
 {
     if (_validator.ValidCompleteObject(recoveryOrder, _recoveryOrderDetailService, _recoveryAccessoryDetailService))
     {
         _repository.CompleteObject(recoveryOrder);
     }
     return(recoveryOrder);
 }
Exemplo n.º 17
0
        public Item GetRoller(RecoveryOrderDetail recoveryOrderDetail, ICoreIdentificationDetailService _coreIdentificationDetailService,
                              IRollerBuilderService _rollerBuilderService, IItemService _itemService)
        {
            CoreIdentificationDetail coreIdentificationDetail = _coreIdentificationDetailService.GetObjectById(recoveryOrderDetail.CoreIdentificationDetailId);
            Item roller = (coreIdentificationDetail.MaterialCase == Core.Constants.Constant.MaterialCase.New) ?
                          _rollerBuilderService.GetRollerNewCore(recoveryOrderDetail.RollerBuilderId) : _rollerBuilderService.GetRollerUsedCore(recoveryOrderDetail.RollerBuilderId);

            return(roller);
        }
Exemplo n.º 18
0
        public CoreBuilder VIsInCoreIdentificationDetail(CoreBuilder coreBuilder, ICoreIdentificationDetailService _coreIdentificationDetailService)
        {
            IList <CoreIdentificationDetail> details = _coreIdentificationDetailService.GetObjectsByCoreBuilderId(coreBuilder.Id);

            if (details.Any())
            {
                coreBuilder.Errors.Add("Generic", "Tidak boleh terasosiasi dengan Core Identification Detail");
            }
            return(coreBuilder);
        }
Exemplo n.º 19
0
 public CoreBuilder VDeleteObject(CoreBuilder coreBuilder, ICoreIdentificationDetailService _coreIdentificationDetailService, IRollerBuilderService _rollerBuilderService)
 {
     VIsInCoreIdentificationDetail(coreBuilder, _coreIdentificationDetailService);
     if (!isValid(coreBuilder))
     {
         return(coreBuilder);
     }
     VIsInRollerBuilder(coreBuilder, _rollerBuilderService);
     return(coreBuilder);
 }
Exemplo n.º 20
0
        public RollerType VIsInCoreIdentificationDetail(RollerType rollerType, ICoreIdentificationDetailService _coreIdentificationDetailService)
        {
            IList <CoreIdentificationDetail> details = _coreIdentificationDetailService.GetObjectsByRollerTypeId(rollerType.Id);

            if (details.Any())
            {
                rollerType.Errors.Add("Generic", "CoreIdentificationDetail tidak boleh ada yang terasosiakan dengan rollerType");
            }
            return(rollerType);
        }
Exemplo n.º 21
0
        public Machine VIsInCoreIdentificationDetail(Machine machine, ICoreIdentificationDetailService _coreIdentificationDetailService)
        {
            IList <CoreIdentificationDetail> details = _coreIdentificationDetailService.GetObjectsByMachineId(machine.Id);

            if (details.Any())
            {
                machine.Errors.Add("Generic", "CoreIdentificationDetail tidak boleh ada yang terasosiakan dengan machine");
            }
            return(machine);
        }
Exemplo n.º 22
0
 public CoreIdentificationDetail VFinishObject(CoreIdentificationDetail coreIdentificationDetail, ICoreIdentificationService _coreIdentificationService,
                                               ICoreIdentificationDetailService _coreIdentificationDetailService, ICoreBuilderService _coreBuilderService, IWarehouseItemService _warehouseItemService)
 {
     VHasFinishedDate(coreIdentificationDetail);
     if (!isValid(coreIdentificationDetail))
     {
         return(coreIdentificationDetail);
     }
     VCoreIdentificationHasBeenConfirmed(coreIdentificationDetail, _coreIdentificationService);
     return(coreIdentificationDetail);
 }
        public RollerWarehouseMutationDetail CreateObject(int rollerWarehouseMutationId, int itemId, int quantity, IRollerWarehouseMutationService _rollerWarehouseMutationService,
                                                          ICoreIdentificationDetailService _coreIdentificationDetailService, IItemService _itemService, IWarehouseItemService _warehouseItemService)
        {
            RollerWarehouseMutationDetail rollerWarehouseMutationDetail = new RollerWarehouseMutationDetail
            {
                RollerWarehouseMutationId = rollerWarehouseMutationId,
                ItemId = itemId,
                // Price = price
            };

            return(this.CreateObject(rollerWarehouseMutationDetail, _rollerWarehouseMutationService, _coreIdentificationDetailService, _itemService, _warehouseItemService));
        }
Exemplo n.º 24
0
 public CoreIdentificationDetail VUpdateObject(CoreIdentificationDetail coreIdentificationDetail, ICoreIdentificationService _coreIdentificationService,
                                               ICoreIdentificationDetailService _coreIdentificationDetailService, ICoreBuilderService _coreBuilderService,
                                               IRollerTypeService _rollerTypeService, IMachineService _machineService)
 {
     VCreateObject(coreIdentificationDetail, _coreIdentificationService, _coreIdentificationDetailService, _coreBuilderService, _rollerTypeService, _machineService);
     if (!isValid(coreIdentificationDetail))
     {
         return(coreIdentificationDetail);
     }
     VHasNotBeenFinished(coreIdentificationDetail);
     return(coreIdentificationDetail);
 }
Exemplo n.º 25
0
 public MstCoreBuilderController()
 {
     _coreBuilderService              = new CoreBuilderService(new CoreBuilderRepository(), new CoreBuilderValidator());
     _itemTypeService                 = new ItemTypeService(new ItemTypeRepository(), new ItemTypeValidator());
     _rollerBuilderService            = new RollerBuilderService(new RollerBuilderRepository(), new RollerBuilderValidator());
     _coreIdentificationDetailService = new CoreIdentificationDetailService(new CoreIdentificationDetailRepository(), new CoreIdentificationDetailValidator());
     _recoveryOrderDetailService      = new RecoveryOrderDetailService(new RecoveryOrderDetailRepository(), new RecoveryOrderDetailValidator());
     _recoveryAccessoryDetailService  = new RecoveryAccessoryDetailService(new RecoveryAccessoryDetailRepository(), new RecoveryAccessoryDetailValidator());
     _warehouseItemService            = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _stockMutationService            = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _itemService      = new ItemService(new ItemRepository(), new ItemValidator());
     _uomService       = new UoMService(new UoMRepository(), new UoMValidator());
     _warehouseService = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
 }
Exemplo n.º 26
0
 public Machine VDeleteObject(Machine machine, IRollerBuilderService _rollerBuilderService,
                              ICoreIdentificationDetailService _coreIdentificationDetailService, IBarringService _barringService)
 {
     VIsInCoreIdentificationDetail(machine, _coreIdentificationDetailService);
     if (!isValid(machine))
     {
         return(machine);
     }
     VIsInRollerBuilder(machine, _rollerBuilderService);
     if (!isValid(machine))
     {
         return(machine);
     }
     VHasBarring(machine, _barringService);
     return(machine);
 }
Exemplo n.º 27
0
 public CoreIdentificationDetail VUnfinishObject(CoreIdentificationDetail coreIdentificationDetail, ICoreIdentificationService _coreIdentificationService,
                                                 ICoreIdentificationDetailService _coreIdentificationDetailService, ICoreBuilderService _coreBuilderService, IWarehouseItemService _warehouseItemService)
 {
     VCoreIdentificationHasBeenConfirmed(coreIdentificationDetail, _coreIdentificationService);
     if (!isValid(coreIdentificationDetail))
     {
         return(coreIdentificationDetail);
     }
     VHasNotBeenJobScheduled(coreIdentificationDetail);
     if (!isValid(coreIdentificationDetail))
     {
         return(coreIdentificationDetail);
     }
     VQuantityIsInStockForContact(coreIdentificationDetail, _coreIdentificationService, _coreBuilderService, _warehouseItemService);
     return(coreIdentificationDetail);
 }
 public RecoveryOrderDetail VUpdateObject(RecoveryOrderDetail recoveryOrderDetail, IRecoveryOrderService _recoveryOrderService,
                                          ICoreIdentificationDetailService _coreIdentificationDetailService, IRollerBuilderService _rollerBuilderService)
 {
     VHasNotBeenDisassembled(recoveryOrderDetail);
     if (!isValid(recoveryOrderDetail))
     {
         return(recoveryOrderDetail);
     }
     VHasNotBeenRejected(recoveryOrderDetail);
     if (!isValid(recoveryOrderDetail))
     {
         return(recoveryOrderDetail);
     }
     VCreateObject(recoveryOrderDetail, _recoveryOrderService, _coreIdentificationDetailService, _rollerBuilderService);
     return(recoveryOrderDetail);
 }
 public RollerWarehouseMutationController()
 {
     _itemService                          = new ItemService(new ItemRepository(), new ItemValidator());
     _warehouseItemService                 = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _stockMutationService                 = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService                       = new BarringService(new BarringRepository(), new BarringValidator());
     _rollerWarehouseMutationService       = new RollerWarehouseMutationService(new RollerWarehouseMutationRepository(), new RollerWarehouseMutationValidator());
     _rollerWarehouseMutationDetailService = new RollerWarehouseMutationDetailService(new RollerWarehouseMutationDetailRepository(), new RollerWarehouseMutationDetailValidator());
     _contactService                       = new ContactService(new ContactRepository(), new ContactValidator());
     _purchaseReceivalService              = new PurchaseReceivalService(new PurchaseReceivalRepository(), new PurchaseReceivalValidator());
     _purchaseReceivalDetailService        = new PurchaseReceivalDetailService(new PurchaseReceivalDetailRepository(), new PurchaseReceivalDetailValidator());
     _coreIdentificationService            = new CoreIdentificationService(new CoreIdentificationRepository(), new CoreIdentificationValidator());
     _coreIdentificationDetailService      = new CoreIdentificationDetailService(new CoreIdentificationDetailRepository(), new CoreIdentificationDetailValidator());
     _warehouseService                     = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _coreBuilderService                   = new CoreBuilderService(new CoreBuilderRepository(), new CoreBuilderValidator());
 }
Exemplo n.º 30
0
 public RecoveryOrder UnconfirmObject(RecoveryOrder recoveryOrder, ICoreIdentificationDetailService _coreIdentificationDetailService, IRecoveryOrderDetailService _recoveryOrderDetailService,
                                      IRecoveryAccessoryDetailService _recoveryAccessoryDetailService, ICoreBuilderService _coreBuilderService, IStockMutationService _stockMutationService,
                                      IItemService _itemService, IBarringService _barringService, IWarehouseItemService _warehouseItemService, IWarehouseService _warehouseService)
 {
     if (_validator.ValidUnconfirmObject(recoveryOrder, _recoveryOrderDetailService, _recoveryAccessoryDetailService))
     {
         IList <RecoveryOrderDetail> details = _recoveryOrderDetailService.GetObjectsByRecoveryOrderId(recoveryOrder.Id);
         IDictionary <int, int>      ValuePairItemIdQuantity = new Dictionary <int, int>();
         foreach (var detail in details)
         {
             CoreIdentificationDetail coreIdentificationDetail = _coreIdentificationDetailService.GetObjectById(detail.CoreIdentificationDetailId);
             _coreIdentificationDetailService.UnsetJobScheduled(coreIdentificationDetail, this, _recoveryOrderDetailService);
         }
         _repository.UnconfirmObject(recoveryOrder);
     }
     return(recoveryOrder);
 }