Exemple #1
0
        public SqlCommand UP__Table__ErrorLog__Insert(SqlConnection connection = null, SqlTransaction transaction = null)
        {
            SqlCommand cmd = new SqlCommand()
            {
                Connection  = connection,
                CommandType = CommandType.StoredProcedure,
                CommandText = @"[data].[UP__Table__ErrorLog__Insert]",
                Transaction = transaction,
            };

            SqlParameter[] pa = new SqlParameter[]
            {
                ParameterFactory.ReturnValueParameter(),
                           ParameterFactory.PrimaryKeyParameter(parameterName: "@pErrorLogID", sourceColumn: "ErrorLogID", forInsert: true),
                new SqlParameter()
                {
                    ParameterName = "@pErrorNumber", SqlDbType = SqlDbType.BigInt, SourceColumn = "@ErrorNumber"
                },
                ParameterFactory.NVarCharMaxParameter(parameterName: "@pErrorProcedure", "ErrorProcedure"),
                ParameterFactory.NVarCharMaxParameter(parameterName: "@pErrorMessage", "ErrorMessage"),
                new SqlParameter()
                {
                    ParameterName = "@pErrorSeverity", SqlDbType = SqlDbType.BigInt, SourceColumn = "@ErrorSeverity"
                },
                new SqlParameter()
                {
                    ParameterName = "@pErrorState", SqlDbType = SqlDbType.BigInt, SourceColumn = "@ErrorState"
                },
            };

            cmd.Parameters.AddRange(pa);

            return(cmd);
        }
        public SqlCommand UP__Table__Account__Update(SqlConnection connection = null, SqlTransaction transaction = null)
        {
            SqlCommand cmd = new SqlCommand()
            {
                Connection  = connection,
                CommandType = CommandType.StoredProcedure,
                CommandText = @"[customer].[UP__Table__Account__Update]",
                Transaction = transaction,
            };

            SqlParameter[] pa = new SqlParameter[]
            {
                ParameterFactory.ReturnValueParameter(),
                           ParameterFactory.PrimaryKeyParameter(parameterName: "@pAccountID", sourceColumn: "AccountID", forInsert: false),
                ParameterFactory.RowVersionParameter(forInsert: false),
                ParameterFactory.ForeignKeyParameter(parameterName: "@pCustomerID", sourceColumn: "CustomerID"),
                ParameterFactory.NVarCharCodeParameter(),
                ParameterFactory.NVarCharEntityNameParameter(parameterName: "@pAccount", sourceColumn: "Account"),
                ParameterFactory.BitParameter(parameterName: "@pActive", sourceColumn: "Active"),
            };

            cmd.Parameters.AddRange(pa);

            return(cmd);
        }
        public SqlCommand UP__Table__Customer__Delete(SqlConnection connection = null, SqlTransaction transaction = null)
        {
            SqlCommand cmd = new SqlCommand()
            {
                Connection  = connection,
                CommandType = CommandType.StoredProcedure,
                CommandText = @"[customer].[UP__Table__Customer__Delete]",
                Transaction = transaction,
            };

            SqlParameter[] pa = new SqlParameter[]
            {
                ParameterFactory.ReturnValueParameter(),
                           ParameterFactory.PrimaryKeyParameter(parameterName: "@pCustomerID", sourceColumn: "CustomerID", forInsert: false),
                ParameterFactory.RowVersionParameter(forInsert: false),
            };

            cmd.Parameters.AddRange(pa);

            return(cmd);
        }