Пример #1
0
        protected override void InvokeInternal(CommandProcessorContext cpc)
        {
            var service  = cpc.EditingContext.GetEFArtifactService();
            var artifact = service.Artifact;

            var function = new Function(artifact.StorageModel(), null);

            function.Name.Value         = Name;
            function.Schema.Value       = SchemaName;
            function.IsComposable.Value = IsComposable;
            function.ReturnType.Value   = ReturnType;

            if (Name != StoreFunctionName)
            {
                function.StoreFunctionName.Value = StoreFunctionName;
            }

            foreach (var parameterInfo in ParameterInfos)
            {
                var parameter = new Parameter(function, null);
                parameter.Name.Value = parameterInfo.Name;
                parameter.Mode.Value = parameterInfo.Mode;
                parameter.Type.Value = parameterInfo.Type;
                function.AddParameter(parameter);
            }

            artifact.StorageModel().AddFunction(function);
            XmlModelHelper.NormalizeAndResolve(function);

            CreatedFunction = function;
        }
Пример #2
0
 private void SaveBtn_Click(object sender, RoutedEventArgs e)
 {
     if (currentFunction != null)
     {
         currentFunction.Reset(CodeEdit.Code, Function.IndexToType(Data.ReturnIndex));
         foreach (var p in Data.Parameters)
         {
             if (!string.IsNullOrEmpty(p.ParamName) && !string.IsNullOrWhiteSpace(p.ParamName) && !string.IsNullOrEmpty(p.ParamType) && !string.IsNullOrWhiteSpace(p.ParamType))
             {
                 currentFunction.AddParameter(p.ParamName, Function.StringToType(p.ParamType));
             }
         }
         currentFunction.Save();
     }
 }
        protected override void InvokeInternal(CommandProcessorContext cpc)
        {
            var service = cpc.EditingContext.GetEFArtifactService();
            var artifact = service.Artifact;

            var function = new Function(artifact.StorageModel(), null);

            function.Name.Value = Name;
            function.Schema.Value = SchemaName;
            function.IsComposable.Value = IsComposable;
            function.ReturnType.Value = ReturnType;

            if (Name != StoreFunctionName)
            {
                function.StoreFunctionName.Value = StoreFunctionName;
            }

            foreach (var parameterInfo in ParameterInfos)
            {
                var parameter = new Parameter(function, null);
                parameter.Name.Value = parameterInfo.Name;
                parameter.Mode.Value = parameterInfo.Mode;
                parameter.Type.Value = parameterInfo.Type;
                function.AddParameter(parameter);
            }

            artifact.StorageModel().AddFunction(function);
            XmlModelHelper.NormalizeAndResolve(function);

            CreatedFunction = function;
        }