コード例 #1
0
ファイル: PosAnalysisCode.cs プロジェクト: paulusyeung/RT2020
        /// <summary>
        /// Loads a collection of PosAnalysisCode objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the PosAnalysisCode objects in the database.</returns>
        public static PosAnalysisCodeCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            PosAnalysisCodeCollection result = new PosAnalysisCodeCollection();

            using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms))
            {
                while (reader.Read())
                {
                    PosAnalysisCode tmp = new PosAnalysisCode();
                    tmp.LoadFromReader(reader);
                    result.Add(tmp);
                }
            }
            return(result);
        }
コード例 #2
0
ファイル: PosAnalysisCode.cs プロジェクト: paulusyeung/RT2020
 /// <summary>
 /// Loads a PosAnalysisCode object from the database using the given AnalysisCodeId
 /// </summary>
 /// <param name="analysisCodeId">The primary key value</param>
 /// <returns>A PosAnalysisCode object</returns>
 public static PosAnalysisCode Load(Guid analysisCodeId)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@AnalysisCodeId", analysisCodeId) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spPosAnalysisCode_SelRec", parameterValues))
     {
         if (reader.Read())
         {
             PosAnalysisCode result = new PosAnalysisCode();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }
コード例 #3
0
ファイル: PosAnalysisCode.cs プロジェクト: paulusyeung/RT2020
 /// <summary>
 /// Loads a PosAnalysisCode object from the database using the given where clause
 /// </summary>
 /// <param name="whereClause">The filter expression for the query</param>
 /// <returns>A PosAnalysisCode object</returns>
 public static PosAnalysisCode LoadWhere(string whereClause)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@WhereClause", whereClause) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spPosAnalysisCode_SelAll", parameterValues))
     {
         if (reader.Read())
         {
             PosAnalysisCode result = new PosAnalysisCode();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }