Ejemplo n.º 1
0
 /// <summary>
 /// Loads a TransferReason object from the database using the given TxfReasonId
 /// </summary>
 /// <param name="txfReasonId">The primary key value</param>
 /// <returns>A TransferReason object</returns>
 public static TransferReason Load(Guid txfReasonId)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@TxfReasonId", txfReasonId) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spTransferReason_SelRec", parameterValues))
     {
         if (reader.Read())
         {
             TransferReason result = new TransferReason();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Loads a TransferReason object from the database using the given where clause
 /// </summary>
 /// <param name="whereClause">The filter expression for the query</param>
 /// <returns>A TransferReason object</returns>
 public static TransferReason LoadWhere(string whereClause)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@WhereClause", whereClause) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spTransferReason_SelAll", parameterValues))
     {
         if (reader.Read())
         {
             TransferReason result = new TransferReason();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }
Ejemplo n.º 3
0
        private static bool IgnorThis(TransferReason target, string parentFilter)
        {
            bool result = true;

            parentFilter = parentFilter.Replace(" ", "");                       // remove spaces
            parentFilter = parentFilter.Replace("'", "");                       // remove '
            string [] parsed = parentFilter.Split('=');                         // parse

            PropertyInfo pi          = target.GetType().GetProperty(parsed[0]);
            string       filterField = (string)pi.GetValue(target, null);

            if (filterField.ToLower() == parsed[1].ToLower())
            {
                result = false;
            }
            return(result);
        }