Beispiel #1
0
 public void Patch(string id, [FromBody] MergePatchInventoryPostingRuleDto value)
 {
     try {
         InventoryPostingRulesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _inventoryPostingRuleApplicationService.When(value as IMergePatchInventoryPostingRule);
     } catch (Exception ex) { var response = InventoryPostingRulesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Beispiel #2
0
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeleteInventoryPostingRuleDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         InventoryPostingRulesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _inventoryPostingRuleApplicationService.When(value as IDeleteInventoryPostingRule);
     } catch (Exception ex) { var response = InventoryPostingRulesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Beispiel #3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteInventoryPostingRuleDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    InventoryPostingRulesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _inventoryPostingRuleApplicationService.When(value as IMergePatchInventoryPostingRule);
                    return;
                }
                // ///////////////////////////////

                InventoryPostingRulesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _inventoryPostingRuleApplicationService.When(value as ICreateInventoryPostingRule);
            } catch (Exception ex) { var response = InventoryPostingRulesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }