public ClassName ExecuteClassQuery <ClassName>(string storedProcedureName, ObjectFromDataRowHandler <ClassName> generateMethod, Dictionary <string, object> parameters) { if (parameters == null) { parameters = new Dictionary <string, object>(); } DataTable table = ExecuteDataTable(storedProcedureName, parameters); DoPostCommandProcessing(); if (table.Rows.Count > 0) { return(generateMethod(table.Rows[0])); } return(default(ClassName)); }
public PagedList <ClassName> ExecutePagedClassListQuery <ClassName>(string countStatement, string selectStatement, ObjectFromDataRowHandler <ClassName> generateMethod, int?startIndex, int?endIndex, Dictionary <string, object> parameters) { if (parameters == null) { parameters = new Dictionary <string, object>(); } int virtualCount = ExecuteScalar <int>(countStatement, parameters); DataTable table = ExecuteDataTable(selectStatement, parameters); PagedList <ClassName> result = new PagedList <ClassName> { VirtualCount = virtualCount }; foreach (DataRow row in table.Rows) { result.Add(generateMethod(row)); } DoPostCommandProcessing(); return(result); }
public PagedList <ClassName> ExecutePagedClassListQuery <ClassName>(string countStatement, string selectStatement, ObjectFromDataRowHandler <ClassName> generateMethod, int?startIndex, int?endIndex, params object[] parameters) { return(ExecutePagedClassListQuery(countStatement, selectStatement, generateMethod, startIndex, endIndex, GetParametersFromObjectArray(parameters))); }
public PagedList <ClassName> ExecutePagedClassListQuery <ClassName>(string countStatement, string selectStatement, ObjectFromDataRowHandler <ClassName> generateMethod, int?startIndex, int?endIndex) { return(ExecutePagedClassListQuery(countStatement, selectStatement, generateMethod, startIndex, endIndex, (object[])null)); }
public List <ClassName> ExecuteClassListQuery <ClassName>(string selectStatement, ObjectFromDataRowHandler <ClassName> generateMethod, Dictionary <string, object> parameters) { if (parameters == null) { parameters = new Dictionary <string, object>(); } DataTable table = ExecuteDataTable(selectStatement, parameters); List <ClassName> result = new List <ClassName>(); foreach (DataRow row in table.Rows) { result.Add(generateMethod(row)); } DoPostCommandProcessing(); return(result); }
public List <ClassName> ExecuteClassListQuery <ClassName>(string selectStatement, ObjectFromDataRowHandler <ClassName> generateMethod, params object[] parameters) { return(ExecuteClassListQuery(selectStatement, generateMethod, GetParametersFromObjectArray(parameters))); }
public List <ClassName> ExecuteClassListQuery <ClassName>(string selectStatement, ObjectFromDataRowHandler <ClassName> generateMethod) { return(ExecuteClassListQuery(selectStatement, generateMethod, (object[])null)); }
public ClassName ExecuteClassQuery <ClassName>(string storedProcedureName, ObjectFromDataRowHandler <ClassName> generateMethod, params object[] parameters) { return(ExecuteClassQuery(storedProcedureName, generateMethod, GetParametersFromObjectArray(parameters))); }
public ClassName ExecuteClassQuery <ClassName>(string storedProcedureName, ObjectFromDataRowHandler <ClassName> generateMethod) { return(ExecuteClassQuery(storedProcedureName, generateMethod, (object[])null)); }
public PagedList <ClassName> ExecutePagedClassListQuery <ClassName>(string storedProcedureName, ObjectFromDataRowHandler <ClassName> generateMethod, int?startIndex, int?endIndex, Dictionary <string, object> parameters) { if (parameters == null) { parameters = new Dictionary <string, object>(); } SqlParameter virtualCountParameter = new SqlParameter("@VirtualCount", SqlDbType.Int) { Direction = ParameterDirection.Output }; SqlParameter startIndexParameter = new SqlParameter("@StartIndex", startIndex == null ? DBNull.Value : (object)startIndex.Value); SqlParameter endIndexParameter = new SqlParameter("@EndIndex", endIndex == null ? DBNull.Value : (object)endIndex.Value); SqlParameterCollection outputParameters; DataTable table = ExecuteDataTable(storedProcedureName, parameters, new[] { startIndexParameter, endIndexParameter, virtualCountParameter }, out outputParameters); PagedList <ClassName> result = new PagedList <ClassName> { VirtualCount = Convert.ToInt32(outputParameters["@VirtualCount"].Value) }; foreach (DataRow row in table.Rows) { result.Add(generateMethod(row)); } DoPostCommandProcessing(); return(result); }
public PagedList <ClassName> ExecutePagedClassListQuery <ClassName>(string storedProcedureName, ObjectFromDataRowHandler <ClassName> generateMethod, int?startIndex, int?endIndex, params object[] parameters) { return(ExecutePagedClassListQuery(storedProcedureName, generateMethod, startIndex, endIndex, GetParametersFromObjectArray(parameters))); }
public PagedList <ClassName> ExecutePagedClassListQuery <ClassName>(string storedProcedureName, ObjectFromDataRowHandler <ClassName> generateMethod, int?startIndex, int?endIndex) { return(ExecutePagedClassListQuery(storedProcedureName, generateMethod, startIndex, endIndex, (object[])null)); }