protected void AddSetParameterStatements(DesignParameter parameter, string parameterName, DesignParameter isNullParameter, CodeExpression cmdExpression, int parameterIndex, int isNullParameterIndex, IList statements)
        {
            Type parameterUrtType    = this.GetParameterUrtType(parameter);
            CodeCastExpression right = new CodeCastExpression(parameterUrtType, CodeGenHelper.Argument(parameterName));

            right.UserData.Add("CastIsBoxing", true);
            CodeCastExpression expression2 = null;
            CodeCastExpression expression3 = null;

            if ((this.codeGenerator != null) && CodeGenHelper.IsGeneratingJSharpCode(this.codeGenerator.CodeProvider))
            {
                expression2 = new CodeCastExpression(typeof(int), CodeGenHelper.Primitive(0));
                expression2.UserData.Add("CastIsBoxing", true);
                expression3 = new CodeCastExpression(typeof(int), CodeGenHelper.Primitive(1));
                expression3.UserData.Add("CastIsBoxing", true);
            }
            else
            {
                expression2 = new CodeCastExpression(typeof(object), CodeGenHelper.Primitive(0));
                expression3 = new CodeCastExpression(typeof(object), CodeGenHelper.Primitive(1));
            }
            CodeExpression left        = CodeGenHelper.Property(CodeGenHelper.Indexer(CodeGenHelper.Property(cmdExpression, "Parameters"), CodeGenHelper.Primitive(parameterIndex)), "Value");
            CodeExpression expression5 = null;

            if (isNullParameter != null)
            {
                expression5 = CodeGenHelper.Property(CodeGenHelper.Indexer(CodeGenHelper.Property(cmdExpression, "Parameters"), CodeGenHelper.Primitive(isNullParameterIndex)), "Value");
            }
            int num = (isNullParameter == null) ? 1 : 2;

            CodeStatement[] trueStms  = new CodeStatement[num];
            CodeStatement[] falseStms = new CodeStatement[num];
            if (parameter.AllowDbNull && parameterUrtType.IsValueType)
            {
                right = new CodeCastExpression(parameterUrtType, CodeGenHelper.Property(CodeGenHelper.Argument(parameterName), "Value"));
                right.UserData.Add("CastIsBoxing", true);
                trueStms[0]  = CodeGenHelper.Assign(left, right);
                falseStms[0] = CodeGenHelper.Assign(left, CodeGenHelper.Field(CodeGenHelper.GlobalTypeExpr(typeof(DBNull)), "Value"));
                if (isNullParameter != null)
                {
                    trueStms[1]  = trueStms[0];
                    falseStms[1] = falseStms[0];
                    trueStms[0]  = CodeGenHelper.Assign(expression5, expression2);
                    falseStms[0] = CodeGenHelper.Assign(expression5, expression3);
                }
                statements.Add(CodeGenHelper.If(CodeGenHelper.EQ(CodeGenHelper.Property(CodeGenHelper.Argument(parameterName), "HasValue"), CodeGenHelper.Primitive(true)), trueStms, falseStms));
            }
            else if (parameter.AllowDbNull && !parameterUrtType.IsValueType)
            {
                trueStms[0]  = CodeGenHelper.Assign(left, CodeGenHelper.Field(CodeGenHelper.GlobalTypeExpr(typeof(DBNull)), "Value"));
                falseStms[0] = CodeGenHelper.Assign(left, right);
                if (isNullParameter != null)
                {
                    trueStms[1]  = trueStms[0];
                    falseStms[1] = falseStms[0];
                    trueStms[0]  = CodeGenHelper.Assign(expression5, expression3);
                    falseStms[0] = CodeGenHelper.Assign(expression5, expression2);
                }
                statements.Add(CodeGenHelper.If(CodeGenHelper.IdEQ(CodeGenHelper.Argument(parameterName), CodeGenHelper.Primitive(null)), trueStms, falseStms));
            }
            else if (!parameter.AllowDbNull && !parameterUrtType.IsValueType)
            {
                CodeStatement[] statementArray3 = new CodeStatement[] { CodeGenHelper.Throw(CodeGenHelper.GlobalType(typeof(ArgumentNullException)), parameterName) };
                falseStms[0] = CodeGenHelper.Assign(left, right);
                if (isNullParameter != null)
                {
                    falseStms[1] = falseStms[0];
                    falseStms[0] = CodeGenHelper.Assign(expression5, expression2);
                }
                statements.Add(CodeGenHelper.If(CodeGenHelper.IdEQ(CodeGenHelper.Argument(parameterName), CodeGenHelper.Primitive(null)), statementArray3, falseStms));
            }
            else if (!parameter.AllowDbNull && parameterUrtType.IsValueType)
            {
                if (isNullParameter != null)
                {
                    statements.Add(CodeGenHelper.Assign(expression5, expression2));
                }
                statements.Add(CodeGenHelper.Assign(left, right));
            }
        }