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