//新增
        public new Result <IndexView> Add(IndexView entity)
        {
            //查询并将名字赋予字段
            var interfaceField  = interfaceFieldService.GetById(entity.FieldListId);
            var searchCondition = searchConditionService.GetById(entity.SearchConditionId);

            entity.FieldListName       = interfaceField.Name;
            entity.SearchConditionName = searchCondition.Name;
            entity.Title = entity.Name;

            base.Add(entity);
            return(Result <IndexView> .Success());
        }
Example #2
0
        //新增组织接口
        public new ResultModel Add(InterfaceAggregation entity)
        {
            if (entity.InterfaceType == (int)InterfaceType.TriggerScriptDataSource)
            {
                entity.FieldListName       = "-";
                entity.SearchConditionName = "-";
            }
            else
            {
                //查询并将名字赋予接口的字段
                var interfaceField  = interfaceFieldService.GetById(entity.FieldListId);
                var searchCondition = searchConditionService.GetById(entity.SearchConditionId);
                entity.FieldListName       = interfaceField.Name;
                entity.SearchConditionName = searchCondition.Name;
            }

            base.Add(entity);
            return(ResultModel.Success());
        }
        private void SetInterfacePropertyNameByPropertyId(ref InterfaceAggregation entity)
        {
            switch ((InterfaceType)entity.InterfaceType)
            {
            case InterfaceType.Add:
            case InterfaceType.BatchAdd:
                entity.FormName = _formService.GetById(entity.FormId)?.Name;
                break;

            case InterfaceType.Update:
                entity.FormName            = _formService.GetById(entity.FormId)?.Name;
                entity.SearchConditionName = searchConditionService.GetById(entity.SearchConditionId)?.Name;
                break;

            case InterfaceType.Delete:
                entity.SearchConditionName = searchConditionService.GetById(entity.SearchConditionId)?.Name;
                break;

            case InterfaceType.SingleObject:
            case InterfaceType.TableList:
                entity.FieldListName       = _fieldListService.GetById(entity.FieldListId)?.Name;
                entity.SearchConditionName = searchConditionService.GetById(entity.SearchConditionId)?.Name;
                break;

            case InterfaceType.Count:
                entity.SearchConditionName = searchConditionService.GetById(entity.SearchConditionId)?.Name;
                break;

            case InterfaceType.JsonDataSource:
            case InterfaceType.ExecutableScriptDataSource:
                entity.DataSourceName = _dataSourceService.GetById(entity.DataSourceId)?.Name;
                break;

            default:
                break;
            }
        }
Example #4
0
        public IActionResult Update(int id)
        {
            var entity = searchConditionService.GetById(id);

            return(View(ResponseModel.Success(entity)));
        }