示例#1
0
        public IActionResult Create([FromBody] FieldPostModel fieldPostModel)
        {
            var field = fieldsService.Create(fieldPostModel);

            if (field == null)
            {
                return(BadRequest(new { ErrorMessage = "NameId and FieldNumber already exists." }));
            }
            return(Ok(field));
        }
示例#2
0
        public FieldsMappingRuleModel Create(int businessEntityTypeId, FieldsMappingRuleModel fieldsMappingRule)
        {
            var originField = _fieldsService.Create(businessEntityTypeId, fieldsMappingRule.OriginField);
            var sourceField = _fieldsService.Create(businessEntityTypeId, fieldsMappingRule.SourceField);

            var result = _repository.Create(new FieldsMappingRule
            {
                ConfigurationId = fieldsMappingRule.ConfigurationId,
                IsVisible       = true,
                OriginFieldId   = originField.Id,
                SourceFieldId   = sourceField.Id
            });

            return(new FieldsMappingRuleModel
            {
                Id = result.Id,
                ConfigurationId = result.ConfigurationId,
                IsVisible = result.IsVisible,
                OriginField = originField,
                SourceField = sourceField
            });
        }
 public FieldModel Post([FromQuery] int businessEntityTypeId, [FromBody] FieldModel value)
 {
     return(_service.Create(businessEntityTypeId, value));
 }