Exemplo n.º 1
0
        //Assuming @p0, @p1 is the paremeters
        public static SqlQuery SimpleQueryHelper(String aQuery, params object[] aValues)
        {
            NativeQuery query = new NativeQuery();

            query.Query = aQuery;
            for (int i = 0; i < aValues.Length; i++)
            {
                ParemetersHelper helper = ParemetersHelperFactory.GetParemeterHelper();
                query.Parameters.Add(helper.GetSqlParemeter(query.Parameters.Count, aValues[i]));
            }

            return(query);
        }
        public static SqlQuery GetSQLQuery(String aStoreProcedurName, Dictionary <String, Object> aParamaters)
        {
            ParemetersHelper           helper = ParemetersHelperFactory.GetParemeterHelper();
            NativeStoredProcedureQuery query  = new NativeStoredProcedureQuery();

            query.ProcedureName = aStoreProcedurName;

            foreach (KeyValuePair <string, object> entry in aParamaters)
            {
                var sqlparam = helper.GetSqlParemeter(entry.Key, entry.Value);

                query.Parameters.Add(sqlparam);
            }
            return(query);
        }
Exemplo n.º 3
0
 protected void AddExpressionParameters(Object aValue)
 {
     Parameters.Add(ParemeterHelper.GetSqlParemeter(this.ParemeterCount, aValue));
     ParemeterCount++;
 }
Exemplo n.º 4
0
        protected void AddExpressionParameters(List <SqlParameter> aParameters, Object aValue)
        {
            ParemetersHelper helper = ParemetersHelperFactory.GetParemeterHelper();

            aParameters.Add(helper.GetSqlParemeter(aParameters.Count, aValue));
        }