public bool ValidCreateObject(RecoveryAccessoryDetail recoveryAccessoryDetail, IRecoveryOrderService _recoveryOrderService, IRecoveryOrderDetailService _recoveryOrderDetailService,
                               IItemService _itemService, IItemTypeService _itemTypeService, IWarehouseItemService _warehouseItemService)
 {
     VCreateObject(recoveryAccessoryDetail, _recoveryOrderService, _recoveryOrderDetailService, _itemService, _itemTypeService, _warehouseItemService);
     return(isValid(recoveryAccessoryDetail));
 }
 public bool ValidDeleteObject(RecoveryAccessoryDetail recoveryAccessoryDetail, IRecoveryOrderDetailService _recoveryOrderDetailService)
 {
     recoveryAccessoryDetail.Errors.Clear();
     VDeleteObject(recoveryAccessoryDetail, _recoveryOrderDetailService);
     return(isValid(recoveryAccessoryDetail));
 }
 public RecoveryAccessoryDetail VDeleteObject(RecoveryAccessoryDetail recoveryAccessoryDetail, IRecoveryOrderDetailService _recoveryOrderDetailService)
 {
     VRecoveryOrderDetailHasNotBeenFinishedNorRejected(recoveryAccessoryDetail, _recoveryOrderDetailService);
     return(recoveryAccessoryDetail);
 }
Ejemplo n.º 4
0
 public RecoveryAccessoryDetail SoftDeleteObject(RecoveryAccessoryDetail recoveryAccessoryDetail, IRecoveryOrderDetailService _recoveryOrderDetailService)
 {
     return(recoveryAccessoryDetail = _validator.ValidDeleteObject(recoveryAccessoryDetail, _recoveryOrderDetailService) ? _repository.SoftDeleteObject(recoveryAccessoryDetail) : recoveryAccessoryDetail);
 }
Ejemplo n.º 5
0
 public RecoveryAccessoryDetail UpdateObject(RecoveryAccessoryDetail recoveryAccessoryDetail, IRecoveryOrderService _recoveryOrderService, IRecoveryOrderDetailService _recoveryOrderDetailService,
                                             IItemService _itemService, IItemTypeService _itemTypeService, IWarehouseItemService _warehouseItemService)
 {
     return(recoveryAccessoryDetail = _validator.ValidUpdateObject(recoveryAccessoryDetail, _recoveryOrderService, _recoveryOrderDetailService, _itemService, _itemTypeService, _warehouseItemService) ?
                                      _repository.UpdateObject(recoveryAccessoryDetail) : recoveryAccessoryDetail);
 }
Ejemplo n.º 6
0
        public RecoveryAccessoryDetail VRecoveryOrderDetailHasNotBeenFinishedNorRejected(RecoveryAccessoryDetail recoveryAccessoryDetail, IRecoveryOrderDetailService _recoveryOrderDetailService)
        {
            RecoveryOrderDetail detail = _recoveryOrderDetailService.GetObjectById(recoveryAccessoryDetail.RecoveryOrderDetailId);

            if (detail.IsRejected || detail.IsFinished)
            {
                recoveryAccessoryDetail.Errors.Add("Generic", "Recovery Order Detail sudah selesai atau di reject");
            }
            return(recoveryAccessoryDetail);
        }
Ejemplo n.º 7
0
        public bool isValid(RecoveryAccessoryDetail obj)
        {
            bool isValid = !obj.Errors.Any();

            return(isValid);
        }