示例#1
0
        public static string BuildParametersDescription(DataRow row, IList <ParameterProfile> paramInfos)
        {
            StringBuilder stringBuilder = new StringBuilder();

            foreach (ParameterProfile parameterProfile in paramInfos)
            {
                if (parameterProfile.IsRunnable(row) && !parameterProfile.HideDisplay)
                {
                    switch (parameterProfile.ParameterType)
                    {
                    case ParameterType.Switched:
                        stringBuilder.Append(Strings.NameValueFormat(parameterProfile.Name, string.Empty));
                        break;

                    case ParameterType.Column:
                    case ParameterType.ModifiedColumn:
                    {
                        object value = MonadSaveTask.ConvertToParameterValue(row, parameterProfile);
                        stringBuilder.Append(Strings.NameValueFormat(parameterProfile.Name, MonadCommand.FormatParameterValue(value)));
                        break;
                    }
                    }
                }
            }
            return(stringBuilder.ToString());
        }
示例#2
0
        public static void BuildParametersCore(DataRow row, IList <ParameterProfile> paramInfos, object parameters)
        {
            MonadParameterCollection monadParameterCollection = parameters as MonadParameterCollection;

            foreach (ParameterProfile parameterProfile in paramInfos)
            {
                if (parameterProfile.IsRunnable(row))
                {
                    switch (parameterProfile.ParameterType)
                    {
                    case ParameterType.Switched:
                        monadParameterCollection.AddSwitch(parameterProfile.Name);
                        break;

                    case ParameterType.Column:
                    case ParameterType.ModifiedColumn:
                    {
                        object value = MonadSaveTask.ConvertToParameterValue(row, parameterProfile);
                        monadParameterCollection.AddWithValue(parameterProfile.Name, value);
                        break;
                    }
                    }
                }
            }
        }
示例#3
0
 public static object ConvertToParameterValue(DataRow row, ParameterProfile paramInfo)
 {
     if (string.IsNullOrEmpty(paramInfo.LambdaExpression))
     {
         return(MonadSaveTask.ConvertToParameterValue(row, paramInfo.Reference));
     }
     return(ExpressionCalculator.CalculateLambdaExpression(ExpressionCalculator.BuildColumnExpression(paramInfo.LambdaExpression), typeof(object), row, null));
 }
示例#4
0
 public override void BuildParameters(DataRow row, DataObjectStore store, IList <ParameterProfile> paramInfos)
 {
     if (!string.IsNullOrEmpty(this.CommandTextLambdaExpression))
     {
         this.DataHandler.CommandText = (string)ExpressionCalculator.CalculateLambdaExpression(ExpressionCalculator.BuildColumnExpression(this.CommandTextLambdaExpression), typeof(string), row, null);
     }
     this.DataHandler.Parameters.Clear();
     if (!string.IsNullOrEmpty(this.DataObjectName))
     {
         this.DataHandler.Parameters.AddWithValue("Instance", store.GetDataObject(this.DataObjectName));
     }
     else
     {
         this.DataHandler.KeepInstanceParamerter = true;
     }
     MonadSaveTask.BuildParametersCore(row, paramInfos, this.DataHandler.Parameters);
     this.workUnitDescription = MonadSaveTask.BuildParametersDescription(row, paramInfos);
     this.DataHandler.ClearParameterNames();
     this.DataHandler.SpecifyParameterNames(store.GetModifiedPropertiesBasedOnDataObject(row, this.DataObjectName));
 }
示例#5
0
 public override void BuildParameters(DataRow row, DataObjectStore store, IList <ParameterProfile> paramInfos)
 {
     this.Command.Parameters.Clear();
     MonadSaveTask.BuildParametersCore(row, paramInfos, this.Command.Parameters);
 }