GetAllValueParameters() public method

public GetAllValueParameters ( ) : object[]
return object[]
Ejemplo n.º 1
0
        public virtual int DeleteSql(string table, Filter filter)
        {
            string sql = Dialect.GetDeleteSql(table);

            if (filter != null) {
                string whereSql = Dialect.GetWhereSql(filter, 0);
                object[] pars = filter.GetAllValueParameters();
                In[] parameters = Dialect.ConvertToNamedParameters(0, pars);
                return Database.ExecuteSql(sql + " " + whereSql, parameters);
            }

            return Database.ExecuteSql(sql);
        }
Ejemplo n.º 2
0
        public virtual int UpdateSql(string table, string[] columns, object[] values, Filter filter)
        {
            string sql = Dialect.GetUpdateSql(table, columns, values);

            In[] parameters = Dialect.ConvertToNamedParameters(values);
            if (filter != null) {
                string whereSql = Dialect.GetWhereSql(filter, parameters.Count());
                object[] pars = filter.GetAllValueParameters();
                In[] filterParameters = Dialect.ConvertToNamedParameters(parameters.Count(), pars);
                filterParameters = filterParameters.Where(x => x.Value != null && x.Value != DBNull.Value).ToArray();
                parameters = parameters.Concat(filterParameters).ToArray();
                sql = sql + " " + whereSql;
            }

            return Database.ExecuteSql(sql, parameters);
        }
Ejemplo n.º 3
0
        public virtual int CountSql(string table, Filter filter)
        {
            string sql = Dialect.GetCountSql(table);
            object obj;

            if (filter != null) {
                string whereSql = Dialect.GetWhereSql(filter, 0);
                object[] pars = filter.GetAllValueParameters();
                In[] parameters = Dialect.ConvertToNamedParameters(0, pars);
                obj = Database.QueryScalar(sql + " " + whereSql, parameters);
                return Convert.ToInt32(obj);
            }

            obj = Database.QueryScalar(sql);
            return Convert.ToInt32(obj);
        }