Exemple #1
0
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeleteShipmentPackageDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         ShipmentPackagesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _shipmentPackageApplicationService.When(value as IDeleteShipmentPackage);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #2
0
 public IShipmentReceiptImageStateDto GetShipmentReceiptImage(string shipmentId, string shipmentReceiptReceiptSeqId, string sequenceId)
 {
     try {
         var state = (ShipmentReceiptImageState)_shipmentApplicationService.GetShipmentReceiptImage(shipmentId, shipmentReceiptReceiptSeqId, sequenceId);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new ShipmentReceiptImageStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #3
0
        public HttpResponseMessage Post([FromBody] CreateAttributeSetInstanceExtensionFieldGroupDto value)
        {
            try {
                if (value.Id == default(string))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "AttributeSetInstanceExtensionFieldGroup");
                }
                _attributeSetInstanceExtensionFieldGroupApplicationService.When(value as ICreateAttributeSetInstanceExtensionFieldGroup);
                var idObj = value.Id;

                return(Request.CreateResponse <string>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Exemple #4
0
 public IAttributeUseStateDto GetAttributeUse(string attributeSetId, string attributeId)
 {
     try {
         var state = (AttributeUseState)_attributeSetApplicationService.GetAttributeUse(attributeSetId, attributeId);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new AttributeUseStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #5
0
 public IShipmentPackageContentStateDto GetShipmentPackageContent(string shipmentPackageId, string shipmentItemSeqId)
 {
     try {
         var state = (ShipmentPackageContentState)_shipmentPackageApplicationService.GetShipmentPackageContent(((new ValueObjectTextFormatter <ShipmentPackageId>()).Parse(shipmentPackageId)), shipmentItemSeqId);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new ShipmentPackageContentStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
        public HttpResponseMessage Post([FromBody] CreatePicklistBinDto value)
        {
            try {
                if (value.PicklistBinId == default(string))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "PicklistBin");
                }
                _picklistBinApplicationService.When(value as ICreatePicklistBin);
                var idObj = value.PicklistBinId;

                return(Request.CreateResponse <string>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Exemple #7
0
 public IGoodIdentificationStateDto GetGoodIdentification(string productId, string goodIdentificationTypeId)
 {
     try {
         var state = (GoodIdentificationState)_productApplicationService.GetGoodIdentification(productId, goodIdentificationTypeId);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new GoodIdentificationStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #8
0
 public IOrderRoleStateDto GetOrderRole(string orderId, string partyRoleId)
 {
     try {
         var state = (OrderRoleState)_orderApplicationService.GetOrderRole(orderId, ((new ValueObjectTextFormatter <PartyRoleId>()).Parse(partyRoleId)));
         if (state == null)
         {
             return(null);
         }
         var stateDto = new OrderRoleStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
 public IPicklistItemStateDto GetPicklistItem(string picklistBinId, string picklistItemOrderShipGrpInvId)
 {
     try {
         var state = (PicklistItemState)_picklistBinApplicationService.GetPicklistItem(picklistBinId, ((new ValueObjectTextFormatter <PicklistItemOrderShipGrpInvId>()).Parse(picklistItemOrderShipGrpInvId)));
         if (state == null)
         {
             return(null);
         }
         var stateDto = new PicklistItemStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
        public HttpResponseMessage Post([FromBody] CreateSellableInventoryItemDto value)
        {
            try {
                if (value.SellableInventoryItemId == default(InventoryItemId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "SellableInventoryItem");
                }
                _sellableInventoryItemApplicationService.When(value as ICreateSellableInventoryItem);
                var idObj = value.SellableInventoryItemId;

                return(Request.CreateResponse <InventoryItemId>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
 public ISellableInventoryItemEntryStateDto GetSellableInventoryItemEntry(string sellableInventoryItemId, long entrySeqId)
 {
     try {
         var state = (SellableInventoryItemEntryState)_sellableInventoryItemApplicationService.GetSellableInventoryItemEntry(((new ValueObjectTextFormatter <InventoryItemId>()).Parse(sellableInventoryItemId)), entrySeqId);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new SellableInventoryItemEntryStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
 public IPhysicalInventoryLineStateDto GetPhysicalInventoryLine(string physicalInventoryDocumentNumber, string inventoryItemId)
 {
     try {
         var state = (PhysicalInventoryLineState)_physicalInventoryApplicationService.GetPhysicalInventoryLine(physicalInventoryDocumentNumber, ((new ValueObjectTextFormatter <InventoryItemId>()).Parse(inventoryItemId)));
         if (state == null)
         {
             return(null);
         }
         var stateDto = new PhysicalInventoryLineStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #13
0
 public IMovementLineStateDto GetMovementLine(string movementDocumentNumber, string lineNumber)
 {
     try {
         var state = (MovementLineState)_movementApplicationService.GetMovementLine(movementDocumentNumber, lineNumber);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new MovementLineStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #14
0
 public IItemIssuanceStateDto GetItemIssuance(string shipmentId, string itemIssuanceSeqId)
 {
     try {
         var state = (ItemIssuanceState)_shipmentApplicationService.GetItemIssuance(shipmentId, itemIssuanceSeqId);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new ItemIssuanceStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #15
0
 public IInOutLineImageStateDto GetInOutLineImage(string inOutDocumentNumber, string inOutLineLineNumber, string sequenceId)
 {
     try {
         var state = (InOutLineImageState)_inOutApplicationService.GetInOutLineImage(inOutDocumentNumber, inOutLineLineNumber, sequenceId);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new InOutLineImageStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #16
0
 public IOrderItemShipGroupAssociationStateDto GetOrderItemShipGroupAssociation(string orderId, string orderShipGroupShipGroupSeqId, string orderItemSeqId)
 {
     try {
         var state = (OrderItemShipGroupAssociationState)_orderApplicationService.GetOrderItemShipGroupAssociation(orderId, orderShipGroupShipGroupSeqId, orderItemSeqId);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new OrderItemShipGroupAssociationStateDtoWrapper(state);
         stateDto.AllFieldsReturned = true;
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
        public HttpResponseMessage Post([FromBody] CreateOrganizationStructureDto value)
        {
            try {
                if (value.Id == default(OrganizationStructureId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "OrganizationStructure");
                }
                _organizationStructureApplicationService.When(value as ICreateOrganizationStructure);
                var idObj = value.Id;

                return(Request.CreateResponse <OrganizationStructureId>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Exemple #18
0
        public HttpResponseMessage Post([FromBody] CreateProductCategoryMemberDto value)
        {
            try {
                if (value.ProductCategoryMemberId == default(ProductCategoryMemberId))
                {
                    throw DomainError.Named("nullId", "Aggregate Id in cmd is null, aggregate name: {0}.", "ProductCategoryMember");
                }
                _productCategoryMemberApplicationService.When(value as ICreateProductCategoryMember);
                var idObj = value.ProductCategoryMemberId;

                return(Request.CreateResponse <ProductCategoryMemberId>(HttpStatusCode.Created, idObj));
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Exemple #19
0
 public IEnumerable <PropertyMetadata> GetMetadataFilteringFields()
 {
     try {
         var filtering = new List <PropertyMetadata>();
         foreach (var p in LocatorMetadata.Instance.Properties)
         {
             if (p.IsFilteringProperty)
             {
                 filtering.Add(p);
             }
         }
         return(filtering);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #20
0
 public void DocumentAction(string id, [FromBody] InOutCommandDtos.DocumentActionRequestContent content)
 {
     try {
         var cmd   = content.ToDocumentAction();
         var idObj = id;
         if (cmd.DocumentNumber == null)
         {
             cmd.DocumentNumber = idObj;
         }
         else if (!cmd.DocumentNumber.Equals(idObj))
         {
             throw DomainError.Named("inconsistentId", "Argument Id {0} NOT equals body Id {1}", id, cmd.DocumentNumber);
         }
         _inOutApplicationService.When(cmd);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #21
0
 public void OrderShipGroupAction(string orderId, string shipGroupSeqId, [FromBody] OrderCommandDtos.OrderShipGroupActionRequestContent content)
 {
     try {
         var cmd   = content.ToOrderShipGroupAction();
         var idObj = new OrderShipGroupId(orderId, shipGroupSeqId);
         if (cmd.OrderShipGroupId == null)
         {
             cmd.OrderShipGroupId = idObj;
         }
         else if (!cmd.OrderShipGroupId.Equals(idObj))
         {
             throw DomainError.Named("inconsistentId", "Argument Id {0} NOT equals body Id {1}", idObj, cmd.OrderShipGroupId);
         }
         _orderApplicationService.When(cmd);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #22
0
 public long GetCount(string filter = null)
 {
     try {
         long count = 0;
         if (!String.IsNullOrWhiteSpace(filter))
         {
             count = _attributeSetInstanceExtensionFieldGroupApplicationService.GetCount(CriterionDto.ToSubclass(JObject.Parse(filter).ToObject <CriterionDto>(), new WebApiControllerTypeConverter(), new PropertyTypeResolver()
                                                                                                                 , n => (AttributeSetInstanceExtensionFieldGroupMetadata.Instance.FilteringPropertyAliasDictionary.ContainsKey(n) ? AttributeSetInstanceExtensionFieldGroupMetadata.Instance.FilteringPropertyAliasDictionary[n] : n)));
         }
         else
         {
             count = _attributeSetInstanceExtensionFieldGroupApplicationService.GetCount(AttributeSetInstanceExtensionFieldGroupsControllerUtils.GetQueryFilterDictionary(this.Request.GetQueryNameValuePairs()));
         }
         return(count);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #23
0
 public void ConfirmAllItemsIssued(string id, [FromBody] ShipmentCommandDtos.ConfirmAllItemsIssuedRequestContent content)
 {
     try {
         var cmd   = content.ToConfirmAllItemsIssued();
         var idObj = id;
         if (cmd.ShipmentId == null)
         {
             cmd.ShipmentId = idObj;
         }
         else if (!cmd.ShipmentId.Equals(idObj))
         {
             throw DomainError.Named("inconsistentId", "Argument Id {0} NOT equals body Id {1}", id, cmd.ShipmentId);
         }
         _shipmentApplicationService.When(cmd);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #24
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteAttributeSetInstanceExtensionFieldGroupDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    AttributeSetInstanceExtensionFieldGroupsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _attributeSetInstanceExtensionFieldGroupApplicationService.When(value as IMergePatchAttributeSetInstanceExtensionFieldGroup);
                    return;
                }
                // ///////////////////////////////

                AttributeSetInstanceExtensionFieldGroupsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _attributeSetInstanceExtensionFieldGroupApplicationService.When(value as ICreateAttributeSetInstanceExtensionFieldGroup);
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Exemple #25
0
 public IEnumerable <PropertyMetadataDto> GetMetadataFilteringFields()
 {
     try {
         var filtering = new List <PropertyMetadataDto>();
         foreach (var p in AttributeSetInstanceExtensionFieldGroupMetadata.Instance.Properties)
         {
             if (p.IsFilteringProperty)
             {
                 var pdto = new PropertyMetadataDto(p.Name, p.TypeName, p.IsFilteringProperty,
                                                    !String.IsNullOrWhiteSpace(p.SourceChainingName) ? p.SourceChainingName :
                                                    (!String.IsNullOrWhiteSpace(p.DerivedFrom) ? p.DerivedFrom : p.Name));
                 filtering.Add(pdto);
             }
         }
         return(filtering);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteOrganizationStructureDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    OrganizationStructuresControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _organizationStructureApplicationService.When(value as IMergePatchOrganizationStructure);
                    return;
                }
                // ///////////////////////////////

                OrganizationStructuresControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _organizationStructureApplicationService.When(value as ICreateOrganizationStructure);
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }
Exemple #27
0
 public IEnumerable <IAttributeUseStateDto> GetAttributeUses(string attributeSetId)
 {
     try {
         var states = _attributeSetApplicationService.GetAttributeUses(attributeSetId);
         if (states == null)
         {
             return(null);
         }
         var stateDtos = new List <IAttributeUseStateDto>();
         foreach (var s in states)
         {
             var dto = s is AttributeUseStateDtoWrapper ? (AttributeUseStateDtoWrapper)s : new AttributeUseStateDtoWrapper((IAttributeUseState)s);
             dto.AllFieldsReturned = true;
             stateDtos.Add(dto);
         }
         return(stateDtos);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #28
0
 public IEnumerable <IInOutLineImageStateDto> GetInOutLineImages(string inOutDocumentNumber, string inOutLineLineNumber)
 {
     try {
         var states = _inOutApplicationService.GetInOutLineImages(inOutDocumentNumber, inOutLineLineNumber);
         if (states == null)
         {
             return(null);
         }
         var stateDtos = new List <IInOutLineImageStateDto>();
         foreach (var s in states)
         {
             var dto = s is InOutLineImageStateDtoWrapper ? (InOutLineImageStateDtoWrapper)s : new InOutLineImageStateDtoWrapper((IInOutLineImageState)s);
             dto.AllFieldsReturned = true;
             stateDtos.Add(dto);
         }
         return(stateDtos);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
 public IEnumerable <IPicklistItemStateDto> GetPicklistItems(string picklistBinId)
 {
     try {
         var states = _picklistBinApplicationService.GetPicklistItems(picklistBinId);
         if (states == null)
         {
             return(null);
         }
         var stateDtos = new List <IPicklistItemStateDto>();
         foreach (var s in states)
         {
             var dto = s is PicklistItemStateDtoWrapper ? (PicklistItemStateDtoWrapper)s : new PicklistItemStateDtoWrapper((IPicklistItemState)s);
             dto.AllFieldsReturned = true;
             stateDtos.Add(dto);
         }
         return(stateDtos);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #30
0
 public IEnumerable <IGoodIdentificationStateDto> GetGoodIdentifications(string productId)
 {
     try {
         var states = _productApplicationService.GetGoodIdentifications(productId);
         if (states == null)
         {
             return(null);
         }
         var stateDtos = new List <IGoodIdentificationStateDto>();
         foreach (var s in states)
         {
             var dto = s is GoodIdentificationStateDtoWrapper ? (GoodIdentificationStateDtoWrapper)s : new GoodIdentificationStateDtoWrapper((IGoodIdentificationState)s);
             dto.AllFieldsReturned = true;
             stateDtos.Add(dto);
         }
         return(stateDtos);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }