Esempio n. 1
0
        public static IEnumerable <IInventoryPostingRuleStateDto> ToInventoryPostingRuleStateDtoCollection(IEnumerable <string> ids)
        {
            var states = new List <IInventoryPostingRuleStateDto>();

            foreach (var id in ids)
            {
                var dto = new InventoryPostingRuleStateDtoWrapper();
                dto.InventoryPostingRuleId = id;
                states.Add(dto);
            }
            return(states);
        }
Esempio n. 2
0
 public IInventoryPostingRuleStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = id;
         var state = _inventoryPostingRuleApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new InventoryPostingRuleStateDtoWrapper(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = InventoryPostingRulesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }