/// <summary> /// Loads a collection of PosLedgerAnalysis objects from the database. /// </summary> /// <returns>A collection containing all of the PosLedgerAnalysis objects in the database.</returns> public static PosLedgerAnalysisCollection LoadCollection(string spName, SqlParameter[] parms) { PosLedgerAnalysisCollection result = new PosLedgerAnalysisCollection(); using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms)) { while (reader.Read()) { PosLedgerAnalysis tmp = new PosLedgerAnalysis(); tmp.LoadFromReader(reader); result.Add(tmp); } } return(result); }
/// <summary> /// Loads a PosLedgerAnalysis object from the database using the given where clause /// </summary> /// <param name="whereClause">The filter expression for the query</param> /// <returns>A PosLedgerAnalysis object</returns> public static PosLedgerAnalysis LoadWhere(string whereClause) { SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@WhereClause", whereClause) }; using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spPosLedgerAnalysis_SelAll", parameterValues)) { if (reader.Read()) { PosLedgerAnalysis result = new PosLedgerAnalysis(); result.LoadFromReader(reader); return(result); } else { return(null); } } }
/// <summary> /// Loads a PosLedgerAnalysis object from the database using the given AnalysisId /// </summary> /// <param name="analysisId">The primary key value</param> /// <returns>A PosLedgerAnalysis object</returns> public static PosLedgerAnalysis Load(Guid analysisId) { SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@AnalysisId", analysisId) }; using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spPosLedgerAnalysis_SelRec", parameterValues)) { if (reader.Read()) { PosLedgerAnalysis result = new PosLedgerAnalysis(); result.LoadFromReader(reader); return(result); } else { return(null); } } }