public ExpandoObject ExecuteExpandoObject(string sql, params object[] paras) { var scalarBuiler = WhereHelper.CreateScalarWhere(sql, paras); DataSet ds = ExecuteQuery(scalarBuiler.Where, paras); if (ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { return(null); } foreach (DataTable table in ds.Tables) { foreach (DataRow row in table.Rows) { IDictionary <string, object> expando = new ExpandoObject(); foreach (DataColumn column in table.Columns) { expando.Add(column.Caption, row[column]); } return((ExpandoObject)expando); } } return(null); }
public DataSet ExecuteQueryScalar(string sql, params object[] paras) { if (paras != null && paras.Length > 0 && paras[0] is IDictionary <string, object> ) { return(ExecuteQueryDict(sql, (IDictionary <string, object>)paras[0])); } var scalarBuiler = WhereHelper.CreateScalarWhere(sql, paras); return(ExecuteQuery(scalarBuiler.Where, scalarBuiler.SqlParameters.ToArray())); }
public PageResult <T> QueryPage(string where, string order, int pageIndex, int pageSize, params object[] paras) { var scalarBuiler = WhereHelper.CreateScalarWhere(where, paras); return(QueryPage(scalarBuiler.Where, scalarBuiler.Paras, order, pageIndex, pageSize)); }
public List <T> Query(string where, string order = "", params object[] paras) { var scalarBuiler = WhereHelper.CreateScalarWhere(where, paras); return(Query(scalarBuiler.Where, scalarBuiler.Paras, order)); }
public ExPageResult ExecutePageExpandoObjects(string sql, string order, int pageIndex, int pageSize, params object[] paras) { var scalarBuiler = WhereHelper.CreateScalarWhere(sql, paras); return(ExecutePageExpandoObjects(scalarBuiler.Where, scalarBuiler.Paras, order, pageIndex, pageSize)); }
public IEnumerable <ExpandoObject> ExecuteExpandoObjects(string sql, params object[] paras) { var scalarBuiler = WhereHelper.CreateScalarWhere(sql, paras); return(ExecuteExpandoObjects(scalarBuiler.Where, scalarBuiler.SqlParameters)); }